xertica-ui 2.5.2 → 2.5.3

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.
@@ -0,0 +1,3551 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
5
+ const lucideReact = require('lucide-react');
6
+ const React = require('react');
7
+ const button = require('./button-0BlA47It.cjs');
8
+ const NavigationMenuPrimitive = require('@radix-ui/react-navigation-menu');
9
+ const classVarianceAuthority = require('class-variance-authority');
10
+ const ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
11
+ const TogglePrimitive = require('@radix-ui/react-toggle');
12
+ const inputOtp = require('input-otp');
13
+ const reactSlot = require('@radix-ui/react-slot');
14
+ const reactHookForm = require('react-hook-form');
15
+ const alertDialog = require('./alert-dialog-DhwPioBa.cjs');
16
+ const reactDayPicker = require('react-day-picker');
17
+ const DialogPrimitive = require('@radix-ui/react-dialog');
18
+ const vaul = require('vaul');
19
+ const HoverCardPrimitive = require('@radix-ui/react-hover-card');
20
+ const ContextMenuPrimitive = require('@radix-ui/react-context-menu');
21
+ const MenubarPrimitive = require('@radix-ui/react-menubar');
22
+ const cmdk = require('cmdk');
23
+ const richTextEditor = require('./rich-text-editor-DnSDglzW.cjs');
24
+ const skeleton = require('./skeleton-DjiHerJn.cjs');
25
+ const CollapsiblePrimitive = require('@radix-ui/react-collapsible');
26
+ const AccordionPrimitive = require('@radix-ui/react-accordion');
27
+ const useEmblaCarousel = require('embla-carousel-react');
28
+ const googleMapsLoader = require('./google-maps-loader-casMyxlo.cjs');
29
+ const RechartsPrimitive = require('recharts');
30
+
31
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
32
+ function _interopNamespaceDefault(e) {
33
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
34
+ if (e) {
35
+ for (const k in e) {
36
+ if (k !== 'default') {
37
+ const d = Object.getOwnPropertyDescriptor(e, k);
38
+ Object.defineProperty(n, k, d.get ? d : {
39
+ enumerable: true,
40
+ get: () => e[k]
41
+ });
42
+ }
43
+ }
44
+ }
45
+ n.default = e;
46
+ return Object.freeze(n);
47
+ }
48
+
49
+ const AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(AspectRatioPrimitive);
50
+ const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
51
+ const NavigationMenuPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(NavigationMenuPrimitive);
52
+ const ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(ToggleGroupPrimitive);
53
+ const TogglePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TogglePrimitive);
54
+ const DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DialogPrimitive);
55
+ const HoverCardPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(HoverCardPrimitive);
56
+ const ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(ContextMenuPrimitive);
57
+ const MenubarPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(MenubarPrimitive);
58
+ const CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CollapsiblePrimitive);
59
+ const AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(AccordionPrimitive);
60
+
61
+ function AspectRatio({ ...props }) {
62
+ return /* @__PURE__ */ jsxRuntime.jsx(AspectRatioPrimitive__namespace.Root, { "data-slot": "aspect-ratio", ...props });
63
+ }
64
+
65
+ const ResizableContext = React__namespace.createContext(null);
66
+ const ResizablePanelGroup = ({
67
+ children,
68
+ className,
69
+ direction = "horizontal",
70
+ id,
71
+ autoSaveId,
72
+ storage,
73
+ onLayout,
74
+ ...props
75
+ }) => {
76
+ const [panels, setPanels] = React__namespace.useState(/* @__PURE__ */ new Map());
77
+ const [handles, setHandles] = React__namespace.useState(/* @__PURE__ */ new Map());
78
+ const [sizes, setSizes] = React__namespace.useState(/* @__PURE__ */ new Map());
79
+ const [isDragging, setIsDragging] = React__namespace.useState(false);
80
+ const containerRef = React__namespace.useRef(null);
81
+ const getSortedItems = React__namespace.useCallback(
82
+ (items) => {
83
+ if (!containerRef.current) return [];
84
+ return Array.from(items.values()).sort((a, b) => {
85
+ if (!a.ref.current || !b.ref.current) return 0;
86
+ const position = a.ref.current.compareDocumentPosition(b.ref.current);
87
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
88
+ if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
89
+ return 0;
90
+ });
91
+ },
92
+ []
93
+ );
94
+ React__namespace.useEffect(() => {
95
+ const sortedPanels = getSortedItems(panels);
96
+ if (sortedPanels.length === 0) return;
97
+ const uninitialized = sortedPanels.some((p) => !sizes.has(p.id));
98
+ if (uninitialized) {
99
+ const newSizes = new Map(sizes);
100
+ const remainingSpace = 100;
101
+ const defaultSizeCount = sortedPanels.filter((p) => p.defaultSize).length;
102
+ let usedSpace = 0;
103
+ sortedPanels.forEach((p) => {
104
+ if (p.defaultSize) usedSpace += p.defaultSize;
105
+ });
106
+ const spaceForOthers = Math.max(0, remainingSpace - usedSpace);
107
+ const countOthers = sortedPanels.length - defaultSizeCount;
108
+ const sizeForOthers = countOthers > 0 ? spaceForOthers / countOthers : 0;
109
+ sortedPanels.forEach((p) => {
110
+ if (!newSizes.has(p.id)) {
111
+ newSizes.set(p.id, p.defaultSize ?? sizeForOthers);
112
+ }
113
+ });
114
+ setSizes(newSizes);
115
+ }
116
+ }, [panels, sizes, getSortedItems]);
117
+ const registerPanel = React__namespace.useCallback((data) => {
118
+ setPanels((prev) => {
119
+ const next = new Map(prev);
120
+ next.set(data.id, data);
121
+ return next;
122
+ });
123
+ }, []);
124
+ const unregisterPanel = React__namespace.useCallback((id2) => {
125
+ setPanels((prev) => {
126
+ const next = new Map(prev);
127
+ next.delete(id2);
128
+ return next;
129
+ });
130
+ setSizes((prev) => {
131
+ const next = new Map(prev);
132
+ next.delete(id2);
133
+ return next;
134
+ });
135
+ }, []);
136
+ const registerHandle = React__namespace.useCallback((data) => {
137
+ setHandles((prev) => {
138
+ const next = new Map(prev);
139
+ next.set(data.id, data);
140
+ return next;
141
+ });
142
+ }, []);
143
+ const unregisterHandle = React__namespace.useCallback((id2) => {
144
+ setHandles((prev) => {
145
+ const next = new Map(prev);
146
+ next.delete(id2);
147
+ return next;
148
+ });
149
+ }, []);
150
+ const startDragging = React__namespace.useCallback(
151
+ (handleId, event) => {
152
+ event.preventDefault();
153
+ setIsDragging(true);
154
+ const sortedPanels = getSortedItems(panels);
155
+ const sortedHandles = getSortedItems(handles);
156
+ const handleIndex = sortedHandles.findIndex((h) => h.id === handleId);
157
+ if (handleIndex === -1) return;
158
+ const leftPanel = sortedPanels[handleIndex];
159
+ const rightPanel = sortedPanels[handleIndex + 1];
160
+ if (!leftPanel || !rightPanel) return;
161
+ const startX = "touches" in event ? event.touches[0].clientX : event.clientX;
162
+ const startY = "touches" in event ? event.touches[0].clientY : event.clientY;
163
+ const startSizeLeft = sizes.get(leftPanel.id) || 0;
164
+ const startSizeRight = sizes.get(rightPanel.id) || 0;
165
+ const containerSize = direction === "horizontal" ? containerRef.current?.offsetWidth || 1 : containerRef.current?.offsetHeight || 1;
166
+ const onMove = (e) => {
167
+ const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
168
+ const currentY = "touches" in e ? e.touches[0].clientY : e.clientY;
169
+ const deltaPixels = direction === "horizontal" ? currentX - startX : currentY - startY;
170
+ const deltaPercent = deltaPixels / containerSize * 100;
171
+ let finalLeft = startSizeLeft + deltaPercent;
172
+ let finalRight = startSizeRight - deltaPercent;
173
+ if (leftPanel.minSize !== void 0 && finalLeft < leftPanel.minSize) {
174
+ const diff = leftPanel.minSize - finalLeft;
175
+ finalLeft = leftPanel.minSize;
176
+ finalRight -= diff;
177
+ }
178
+ if (rightPanel.minSize !== void 0 && finalRight < rightPanel.minSize) {
179
+ const diff = rightPanel.minSize - finalRight;
180
+ finalRight = rightPanel.minSize;
181
+ finalLeft -= diff;
182
+ }
183
+ if (leftPanel.maxSize !== void 0 && finalLeft > leftPanel.maxSize) {
184
+ const diff = finalLeft - leftPanel.maxSize;
185
+ finalLeft = leftPanel.maxSize;
186
+ finalRight += diff;
187
+ }
188
+ if (rightPanel.maxSize !== void 0 && finalRight > rightPanel.maxSize) {
189
+ const diff = finalRight - rightPanel.maxSize;
190
+ finalRight = rightPanel.maxSize;
191
+ finalLeft -= diff;
192
+ }
193
+ finalLeft = Math.max(0, Math.min(100, finalLeft));
194
+ finalRight = Math.max(0, Math.min(100, finalRight));
195
+ setSizes((prev) => {
196
+ const next = new Map(prev);
197
+ next.set(leftPanel.id, finalLeft);
198
+ next.set(rightPanel.id, finalRight);
199
+ return next;
200
+ });
201
+ leftPanel.onResize?.(finalLeft);
202
+ rightPanel.onResize?.(finalRight);
203
+ };
204
+ const onUp = () => {
205
+ setIsDragging(false);
206
+ window.removeEventListener("mousemove", onMove);
207
+ window.removeEventListener("mouseup", onUp);
208
+ window.removeEventListener("touchmove", onMove);
209
+ window.removeEventListener("touchend", onUp);
210
+ if (onLayout) {
211
+ onLayout(sortedPanels.map((p) => sizes.get(p.id) || 0));
212
+ }
213
+ };
214
+ window.addEventListener("mousemove", onMove);
215
+ window.addEventListener("mouseup", onUp);
216
+ window.addEventListener("touchmove", onMove);
217
+ window.addEventListener("touchend", onUp);
218
+ },
219
+ [panels, handles, sizes, direction, getSortedItems, onLayout]
220
+ );
221
+ const getPanelStyle = React__namespace.useCallback(
222
+ (id2) => {
223
+ const size = sizes.get(id2);
224
+ if (size === void 0) return { flex: "1 1 0%", overflow: "hidden" };
225
+ return { flex: `${size} 1 0%`, overflow: "hidden" };
226
+ },
227
+ [sizes]
228
+ );
229
+ const contextValue = React__namespace.useMemo(
230
+ () => ({
231
+ direction,
232
+ registerPanel,
233
+ unregisterPanel,
234
+ registerHandle,
235
+ unregisterHandle,
236
+ isDragging,
237
+ startDragging,
238
+ getPanelStyle
239
+ }),
240
+ [
241
+ direction,
242
+ registerPanel,
243
+ unregisterPanel,
244
+ registerHandle,
245
+ unregisterHandle,
246
+ isDragging,
247
+ startDragging,
248
+ getPanelStyle
249
+ ]
250
+ );
251
+ return /* @__PURE__ */ jsxRuntime.jsx(ResizableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
252
+ "div",
253
+ {
254
+ ref: containerRef,
255
+ "data-slot": "resizable-panel-group",
256
+ "data-panel-group-direction": direction,
257
+ className: button.cn(
258
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
259
+ className
260
+ ),
261
+ ...props,
262
+ children
263
+ }
264
+ ) });
265
+ };
266
+ const ResizablePanel = ({
267
+ className,
268
+ defaultSize,
269
+ minSize = 0,
270
+ maxSize = 100,
271
+ collapsible,
272
+ collapsedSize,
273
+ onCollapse,
274
+ onExpand,
275
+ onResize,
276
+ order,
277
+ tagName,
278
+ id: propId,
279
+ children,
280
+ ...props
281
+ }) => {
282
+ const context = React__namespace.useContext(ResizableContext);
283
+ const ref = React__namespace.useRef(null);
284
+ const [generatedId] = React__namespace.useState(() => Math.random().toString(36).substr(2, 9));
285
+ const id = propId || generatedId;
286
+ const registerPanel = context?.registerPanel;
287
+ const unregisterPanel = context?.unregisterPanel;
288
+ React__namespace.useLayoutEffect(() => {
289
+ if (!registerPanel || !unregisterPanel) return;
290
+ registerPanel({
291
+ id,
292
+ ref,
293
+ defaultSize,
294
+ minSize,
295
+ maxSize,
296
+ collapsible,
297
+ onCollapse,
298
+ onExpand,
299
+ onResize
300
+ });
301
+ return () => unregisterPanel(id);
302
+ }, [
303
+ registerPanel,
304
+ unregisterPanel,
305
+ id,
306
+ defaultSize,
307
+ minSize,
308
+ maxSize,
309
+ collapsible,
310
+ onCollapse,
311
+ onExpand,
312
+ onResize
313
+ ]);
314
+ if (!context) {
315
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("flex-1", className), ...props, children });
316
+ }
317
+ return /* @__PURE__ */ jsxRuntime.jsx(
318
+ "div",
319
+ {
320
+ ref,
321
+ "data-slot": "resizable-panel",
322
+ className: button.cn("relative transition-[flex-grow] duration-0", className),
323
+ style: context.getPanelStyle(id),
324
+ ...props,
325
+ children
326
+ }
327
+ );
328
+ };
329
+ const ResizableHandle = ({
330
+ withHandle,
331
+ className,
332
+ id: propId,
333
+ tagName,
334
+ ...props
335
+ }) => {
336
+ const context = React__namespace.useContext(ResizableContext);
337
+ const ref = React__namespace.useRef(null);
338
+ const [generatedId] = React__namespace.useState(() => Math.random().toString(36).substr(2, 9));
339
+ const id = propId || generatedId;
340
+ const registerHandle = context?.registerHandle;
341
+ const unregisterHandle = context?.unregisterHandle;
342
+ React__namespace.useLayoutEffect(() => {
343
+ if (!registerHandle || !unregisterHandle) return;
344
+ registerHandle({ id, ref });
345
+ return () => unregisterHandle(id);
346
+ }, [registerHandle, unregisterHandle, id]);
347
+ const handleMouseDown = (e) => {
348
+ if (context) {
349
+ context.startDragging(id, e);
350
+ }
351
+ };
352
+ if (!context) return null;
353
+ return /* @__PURE__ */ jsxRuntime.jsx(
354
+ "div",
355
+ {
356
+ ref,
357
+ "data-slot": "resizable-handle",
358
+ className: button.cn(
359
+ "bg-border relative flex items-center justify-center focus-visible:outline-hidden",
360
+ "touch-none select-none",
361
+ context.direction === "vertical" ? "h-px w-full cursor-row-resize after:left-0 after:h-1 after:w-full after:-translate-y-1/2 hover:after:h-4" : "w-px h-full cursor-col-resize after:top-0 after:w-1 after:h-full after:-translate-x-1/2 hover:after:w-4",
362
+ "after:absolute after:z-10",
363
+ className
364
+ ),
365
+ onMouseDown: handleMouseDown,
366
+ onTouchStart: handleMouseDown,
367
+ ...props,
368
+ children: withHandle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVerticalIcon, { className: "size-2.5" }) })
369
+ }
370
+ );
371
+ };
372
+
373
+ function NavigationMenu({
374
+ className,
375
+ children,
376
+ viewport = true,
377
+ ...props
378
+ }) {
379
+ return /* @__PURE__ */ jsxRuntime.jsxs(
380
+ NavigationMenuPrimitive__namespace.Root,
381
+ {
382
+ "data-slot": "navigation-menu",
383
+ className: button.cn("relative z-10 flex w-full flex-1 items-center justify-center", className),
384
+ ...props,
385
+ children: [
386
+ children,
387
+ viewport && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuViewport, {})
388
+ ]
389
+ }
390
+ );
391
+ }
392
+ function NavigationMenuList({
393
+ className,
394
+ ...props
395
+ }) {
396
+ return /* @__PURE__ */ jsxRuntime.jsx(
397
+ NavigationMenuPrimitive__namespace.List,
398
+ {
399
+ "data-slot": "navigation-menu-list",
400
+ className: button.cn("group flex flex-1 list-none items-center justify-center gap-1", className),
401
+ ...props
402
+ }
403
+ );
404
+ }
405
+ function NavigationMenuItem({
406
+ className,
407
+ ...props
408
+ }) {
409
+ return /* @__PURE__ */ jsxRuntime.jsx(
410
+ NavigationMenuPrimitive__namespace.Item,
411
+ {
412
+ "data-slot": "navigation-menu-item",
413
+ className: button.cn("relative", className),
414
+ ...props
415
+ }
416
+ );
417
+ }
418
+ const navigationMenuTriggerStyle = classVarianceAuthority.cva(
419
+ "group inline-flex h-10 w-max items-center justify-center rounded-[var(--radius)] bg-background px-4 py-2 text-[var(--text-p)] font-[var(--font-weight-medium)] hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 outline-none focus-visible:ring-2 focus-visible:ring-ring"
420
+ );
421
+ function NavigationMenuTrigger({
422
+ className,
423
+ children,
424
+ ...props
425
+ }) {
426
+ return /* @__PURE__ */ jsxRuntime.jsxs(
427
+ NavigationMenuPrimitive__namespace.Trigger,
428
+ {
429
+ "data-slot": "navigation-menu-trigger",
430
+ className: button.cn(navigationMenuTriggerStyle(), "group", className),
431
+ ...props,
432
+ children: [
433
+ children,
434
+ " ",
435
+ /* @__PURE__ */ jsxRuntime.jsx(
436
+ lucideReact.ChevronDownIcon,
437
+ {
438
+ className: "relative top-[1px] ml-1 size-3 group-data-[state=open]:rotate-180",
439
+ "aria-hidden": "true"
440
+ }
441
+ )
442
+ ]
443
+ }
444
+ );
445
+ }
446
+ function NavigationMenuContent({
447
+ className,
448
+ ...props
449
+ }) {
450
+ return /* @__PURE__ */ jsxRuntime.jsx(
451
+ NavigationMenuPrimitive__namespace.Content,
452
+ {
453
+ "data-slot": "navigation-menu-content",
454
+ className: button.cn("left-0 top-0 w-full md:w-auto", className),
455
+ ...props
456
+ }
457
+ );
458
+ }
459
+ function NavigationMenuViewport({
460
+ className,
461
+ ...props
462
+ }) {
463
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("absolute left-0 top-full flex justify-center w-full"), children: /* @__PURE__ */ jsxRuntime.jsx(
464
+ NavigationMenuPrimitive__namespace.Viewport,
465
+ {
466
+ "data-slot": "navigation-menu-viewport",
467
+ className: button.cn(
468
+ "origin-top-center relative mt-1.5 overflow-hidden rounded-[var(--radius)] border border-border bg-popover text-popover-foreground shadow-lg",
469
+ className
470
+ ),
471
+ ...props
472
+ }
473
+ ) });
474
+ }
475
+ function NavigationMenuLink({
476
+ className,
477
+ ...props
478
+ }) {
479
+ return /* @__PURE__ */ jsxRuntime.jsx(
480
+ NavigationMenuPrimitive__namespace.Link,
481
+ {
482
+ "data-slot": "navigation-menu-link",
483
+ className: button.cn(
484
+ "block select-none space-y-1 rounded-[var(--radius)] p-3 leading-none no-underline outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
485
+ className
486
+ ),
487
+ ...props
488
+ }
489
+ );
490
+ }
491
+ function NavigationMenuIndicator({
492
+ className,
493
+ ...props
494
+ }) {
495
+ return /* @__PURE__ */ jsxRuntime.jsx(
496
+ NavigationMenuPrimitive__namespace.Indicator,
497
+ {
498
+ "data-slot": "navigation-menu-indicator",
499
+ className: button.cn(
500
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
501
+ className
502
+ ),
503
+ ...props,
504
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
505
+ }
506
+ );
507
+ }
508
+
509
+ function Pagination({ className, ...props }) {
510
+ return /* @__PURE__ */ jsxRuntime.jsx(
511
+ "nav",
512
+ {
513
+ role: "navigation",
514
+ "aria-label": "pagination",
515
+ "data-slot": "pagination",
516
+ className: button.cn("mx-auto flex w-full justify-center", className),
517
+ ...props
518
+ }
519
+ );
520
+ }
521
+ function PaginationContent({ className, ...props }) {
522
+ return /* @__PURE__ */ jsxRuntime.jsx(
523
+ "ul",
524
+ {
525
+ "data-slot": "pagination-content",
526
+ className: button.cn("flex flex-row items-center gap-1", className),
527
+ ...props
528
+ }
529
+ );
530
+ }
531
+ function PaginationItem({ ...props }) {
532
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "pagination-item", ...props });
533
+ }
534
+ function PaginationLink({
535
+ className,
536
+ isActive,
537
+ disabled,
538
+ size = "icon",
539
+ href,
540
+ ...props
541
+ }) {
542
+ return /* @__PURE__ */ jsxRuntime.jsx(
543
+ "a",
544
+ {
545
+ "aria-current": isActive ? "page" : void 0,
546
+ "aria-disabled": disabled || void 0,
547
+ tabIndex: disabled ? -1 : void 0,
548
+ "data-slot": "pagination-link",
549
+ "data-active": isActive,
550
+ href: disabled ? void 0 : href ?? "#",
551
+ className: button.cn(
552
+ button.buttonVariants({
553
+ variant: isActive ? "outline" : "ghost",
554
+ size
555
+ }),
556
+ disabled && "pointer-events-none opacity-50",
557
+ className
558
+ ),
559
+ ...props
560
+ }
561
+ );
562
+ }
563
+ function PaginationPrevious({
564
+ className,
565
+ disabled,
566
+ ...props
567
+ }) {
568
+ return /* @__PURE__ */ jsxRuntime.jsxs(
569
+ PaginationLink,
570
+ {
571
+ "aria-label": "Go to previous page",
572
+ size: "default",
573
+ disabled,
574
+ className: button.cn("gap-1 px-2.5 sm:pl-2.5", className),
575
+ ...props,
576
+ children: [
577
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, {}),
578
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Previous" })
579
+ ]
580
+ }
581
+ );
582
+ }
583
+ function PaginationNext({
584
+ className,
585
+ disabled,
586
+ ...props
587
+ }) {
588
+ return /* @__PURE__ */ jsxRuntime.jsxs(
589
+ PaginationLink,
590
+ {
591
+ "aria-label": "Go to next page",
592
+ size: "default",
593
+ disabled,
594
+ className: button.cn("gap-1 px-2.5 sm:pr-2.5", className),
595
+ ...props,
596
+ children: [
597
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Next" }),
598
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
599
+ ]
600
+ }
601
+ );
602
+ }
603
+ function PaginationEllipsis({ className, ...props }) {
604
+ return /* @__PURE__ */ jsxRuntime.jsxs(
605
+ "span",
606
+ {
607
+ "aria-hidden": true,
608
+ "data-slot": "pagination-ellipsis",
609
+ className: button.cn("flex size-9 items-center justify-center", className),
610
+ ...props,
611
+ children: [
612
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontalIcon, { className: "size-4" }),
613
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
614
+ ]
615
+ }
616
+ );
617
+ }
618
+
619
+ function usePagination({
620
+ totalItems,
621
+ pageSize = 10,
622
+ initialPage = 1,
623
+ page: controlledPage,
624
+ onPageChange,
625
+ siblingCount = 1
626
+ }) {
627
+ const [internalPage, setInternalPage] = React.useState(initialPage);
628
+ const isControlled = controlledPage !== void 0;
629
+ const currentPage = isControlled ? controlledPage : internalPage;
630
+ const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
631
+ const setPage = React.useCallback(
632
+ (p) => {
633
+ const clamped = Math.min(Math.max(1, p), totalPages);
634
+ if (!isControlled) setInternalPage(clamped);
635
+ onPageChange?.(clamped);
636
+ },
637
+ [isControlled, onPageChange, totalPages]
638
+ );
639
+ const startIndex = (currentPage - 1) * pageSize;
640
+ const endIndex = Math.min(startIndex + pageSize, totalItems);
641
+ const canGoPrev = currentPage > 1;
642
+ const canGoNext = currentPage < totalPages;
643
+ const isFirstPage = currentPage === 1;
644
+ const isLastPage = currentPage === totalPages;
645
+ const items = React.useMemo(() => {
646
+ const pageSet = /* @__PURE__ */ new Set();
647
+ pageSet.add(1);
648
+ if (totalPages > 1) pageSet.add(totalPages);
649
+ for (let p = Math.max(2, currentPage - siblingCount); p <= Math.min(totalPages - 1, currentPage + siblingCount); p++) {
650
+ pageSet.add(p);
651
+ }
652
+ const sorted = Array.from(pageSet).sort((a, b) => a - b);
653
+ const result = [];
654
+ for (let i = 0; i < sorted.length; i++) {
655
+ result.push({ type: "page", page: sorted[i] });
656
+ if (i < sorted.length - 1 && sorted[i + 1] - sorted[i] > 1) {
657
+ result.push({ type: "ellipsis", key: `ellipsis-${sorted[i]}` });
658
+ }
659
+ }
660
+ return result;
661
+ }, [currentPage, siblingCount, totalPages]);
662
+ const goTo = React.useCallback((p) => setPage(p), [setPage]);
663
+ const next = React.useCallback(() => setPage(currentPage + 1), [currentPage, setPage]);
664
+ const prev = React.useCallback(() => setPage(currentPage - 1), [currentPage, setPage]);
665
+ const first = React.useCallback(() => setPage(1), [setPage]);
666
+ const last = React.useCallback(() => setPage(totalPages), [setPage, totalPages]);
667
+ return {
668
+ currentPage,
669
+ totalPages,
670
+ startIndex,
671
+ endIndex,
672
+ canGoPrev,
673
+ canGoNext,
674
+ isFirstPage,
675
+ isLastPage,
676
+ items,
677
+ goTo,
678
+ next,
679
+ prev,
680
+ first,
681
+ last
682
+ };
683
+ }
684
+
685
+ const toggleVariants = classVarianceAuthority.cva(
686
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
687
+ {
688
+ variants: {
689
+ variant: {
690
+ default: "bg-transparent",
691
+ outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
692
+ },
693
+ size: {
694
+ default: "h-9 px-2 min-w-9",
695
+ sm: "h-8 px-1.5 min-w-8",
696
+ lg: "h-10 px-2.5 min-w-10"
697
+ }
698
+ },
699
+ defaultVariants: {
700
+ variant: "default",
701
+ size: "default"
702
+ }
703
+ }
704
+ );
705
+ const Toggle = React__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
706
+ TogglePrimitive__namespace.Root,
707
+ {
708
+ ref,
709
+ "data-slot": "toggle",
710
+ className: button.cn(toggleVariants({ variant, size, className })),
711
+ ...props
712
+ }
713
+ ));
714
+ Toggle.displayName = TogglePrimitive__namespace.Root.displayName;
715
+
716
+ const ToggleGroupContext = React__namespace.createContext({
717
+ size: "default",
718
+ variant: "default"
719
+ });
720
+ const ToggleGroup = React__namespace.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
721
+ ToggleGroupPrimitive__namespace.Root,
722
+ {
723
+ ref,
724
+ "data-slot": "toggle-group",
725
+ "data-variant": variant,
726
+ "data-size": size,
727
+ className: button.cn(
728
+ "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
729
+ className
730
+ ),
731
+ ...props,
732
+ children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
733
+ }
734
+ ));
735
+ ToggleGroup.displayName = ToggleGroupPrimitive__namespace.Root.displayName;
736
+ const ToggleGroupItem = React__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => {
737
+ const context = React__namespace.useContext(ToggleGroupContext);
738
+ return /* @__PURE__ */ jsxRuntime.jsx(
739
+ ToggleGroupPrimitive__namespace.Item,
740
+ {
741
+ ref,
742
+ "data-slot": "toggle-group-item",
743
+ "data-variant": context.variant || variant,
744
+ "data-size": context.size || size,
745
+ className: button.cn(
746
+ toggleVariants({
747
+ variant: context.variant || variant,
748
+ size: context.size || size
749
+ }),
750
+ "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
751
+ className
752
+ ),
753
+ ...props,
754
+ children
755
+ }
756
+ );
757
+ });
758
+ ToggleGroupItem.displayName = ToggleGroupPrimitive__namespace.Item.displayName;
759
+
760
+ function InputOTP({
761
+ className,
762
+ containerClassName,
763
+ ...props
764
+ }) {
765
+ return /* @__PURE__ */ jsxRuntime.jsx(
766
+ inputOtp.OTPInput,
767
+ {
768
+ "data-slot": "input-otp",
769
+ containerClassName: button.cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
770
+ className: button.cn("disabled:cursor-not-allowed", className),
771
+ ...props
772
+ }
773
+ );
774
+ }
775
+ function InputOTPGroup({ className, ...props }) {
776
+ return /* @__PURE__ */ jsxRuntime.jsx(
777
+ "div",
778
+ {
779
+ "data-slot": "input-otp-group",
780
+ className: button.cn("flex items-center gap-1", className),
781
+ ...props
782
+ }
783
+ );
784
+ }
785
+ function InputOTPSlot({
786
+ index,
787
+ className,
788
+ size = "md",
789
+ ...props
790
+ }) {
791
+ const inputOTPContext = React__namespace.useContext(inputOtp.OTPInputContext);
792
+ const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
793
+ const sizeClasses = {
794
+ sm: "h-8 w-8 text-sm",
795
+ md: "h-10 w-10 text-base",
796
+ lg: "h-12 w-12 text-lg"
797
+ };
798
+ return /* @__PURE__ */ jsxRuntime.jsxs(
799
+ "div",
800
+ {
801
+ "data-slot": "input-otp-slot",
802
+ "data-active": isActive,
803
+ className: button.cn(
804
+ "data-[active=true]:border-primary data-[active=true]:ring-primary/20 data-[active=true]:aria-invalid:ring-destructive/20 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex items-center justify-center border border-border rounded-[var(--radius)] bg-background transition-all outline-none data-[active=true]:z-10 data-[active=true]:ring-2",
805
+ sizeClasses[size],
806
+ className
807
+ ),
808
+ ...props,
809
+ children: [
810
+ char,
811
+ hasFakeCaret && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
812
+ ]
813
+ }
814
+ );
815
+ }
816
+ function InputOTPSeparator({ ...props }) {
817
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, {}) });
818
+ }
819
+
820
+ const Form = reactHookForm.FormProvider;
821
+ const FormFieldContext = React__namespace.createContext({});
822
+ const FormField = ({
823
+ ...props
824
+ }) => {
825
+ return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
826
+ };
827
+ const useFormField = () => {
828
+ const fieldContext = React__namespace.useContext(FormFieldContext);
829
+ const itemContext = React__namespace.useContext(FormItemContext);
830
+ const { getFieldState } = reactHookForm.useFormContext();
831
+ const formState = reactHookForm.useFormState({ name: fieldContext.name });
832
+ const fieldState = getFieldState(fieldContext.name, formState);
833
+ if (!fieldContext) {
834
+ throw new Error("useFormField should be used within <FormField>");
835
+ }
836
+ const { id } = itemContext;
837
+ return {
838
+ id,
839
+ name: fieldContext.name,
840
+ formItemId: `${id}-form-item`,
841
+ formDescriptionId: `${id}-form-item-description`,
842
+ formMessageId: `${id}-form-item-message`,
843
+ ...fieldState
844
+ };
845
+ };
846
+ const FormItemContext = React__namespace.createContext({});
847
+ function FormItem({ className, ...props }) {
848
+ const id = React__namespace.useId();
849
+ return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "form-item", className: button.cn("grid gap-2", className), ...props }) });
850
+ }
851
+ function FormLabel({ className, ...props }) {
852
+ const { error, formItemId } = useFormField();
853
+ return /* @__PURE__ */ jsxRuntime.jsx(
854
+ alertDialog.Label,
855
+ {
856
+ "data-slot": "form-label",
857
+ "data-error": !!error,
858
+ className: button.cn("data-[error=true]:text-destructive", className),
859
+ htmlFor: formItemId,
860
+ ...props
861
+ }
862
+ );
863
+ }
864
+ function FormControl({ ...props }) {
865
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
866
+ return /* @__PURE__ */ jsxRuntime.jsx(
867
+ reactSlot.Slot,
868
+ {
869
+ "data-slot": "form-control",
870
+ id: formItemId,
871
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
872
+ "aria-invalid": !!error,
873
+ ...props
874
+ }
875
+ );
876
+ }
877
+ function FormDescription({ className, ...props }) {
878
+ const { formDescriptionId } = useFormField();
879
+ return /* @__PURE__ */ jsxRuntime.jsx(
880
+ "p",
881
+ {
882
+ "data-slot": "form-description",
883
+ id: formDescriptionId,
884
+ className: button.cn("text-muted-foreground text-sm", className),
885
+ ...props
886
+ }
887
+ );
888
+ }
889
+ function FormMessage({ className, ...props }) {
890
+ const { error, formMessageId } = useFormField();
891
+ const body = error ? String(error?.message ?? "") : props.children;
892
+ if (!body) {
893
+ return null;
894
+ }
895
+ return /* @__PURE__ */ jsxRuntime.jsx(
896
+ "p",
897
+ {
898
+ "data-slot": "form-message",
899
+ id: formMessageId,
900
+ className: button.cn("text-destructive text-sm", className),
901
+ ...props,
902
+ children: body
903
+ }
904
+ );
905
+ }
906
+
907
+ function Calendar({
908
+ className,
909
+ classNames,
910
+ showOutsideDays = true,
911
+ captionLayout = "label",
912
+ buttonVariant = "ghost",
913
+ formatters,
914
+ components,
915
+ ...props
916
+ }) {
917
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
918
+ const isDropdownCaption = captionLayout.startsWith("dropdown");
919
+ return /* @__PURE__ */ jsxRuntime.jsx(
920
+ reactDayPicker.DayPicker,
921
+ {
922
+ showOutsideDays,
923
+ className: button.cn(
924
+ "bg-background group/calendar p-4 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent font-sans",
925
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
926
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
927
+ className
928
+ ),
929
+ captionLayout,
930
+ formatters,
931
+ classNames: {
932
+ root: button.cn("w-fit", defaultClassNames.root),
933
+ months: button.cn("flex gap-6 flex-col md:flex-row relative", defaultClassNames.months),
934
+ month: button.cn("flex flex-col w-full gap-5", defaultClassNames.month),
935
+ nav: button.cn(
936
+ "flex items-center gap-2 w-full absolute top-0 inset-x-0 justify-between",
937
+ defaultClassNames.nav
938
+ ),
939
+ button_previous: button.cn(
940
+ button.buttonVariants({ variant: buttonVariant }),
941
+ "size-(--cell-size) aria-disabled:opacity-40 p-0 select-none hover:bg-accent/50 transition-colors duration-200",
942
+ defaultClassNames.button_previous
943
+ ),
944
+ button_next: button.cn(
945
+ button.buttonVariants({ variant: buttonVariant }),
946
+ "size-(--cell-size) aria-disabled:opacity-40 p-0 select-none hover:bg-accent/50 transition-colors duration-200",
947
+ defaultClassNames.button_next
948
+ ),
949
+ month_caption: button.cn(
950
+ "flex items-center justify-center w-full",
951
+ isDropdownCaption ? "h-auto px-0" : "h-(--cell-size) px-(--cell-size)",
952
+ defaultClassNames.month_caption
953
+ ),
954
+ dropdowns: button.cn(
955
+ "w-full flex items-center justify-center gap-2",
956
+ isDropdownCaption ? "h-auto" : "h-(--cell-size)",
957
+ defaultClassNames.dropdowns
958
+ ),
959
+ dropdown_root: button.cn(
960
+ isDropdownCaption ? "relative flex min-w-[7rem] items-center rounded-[var(--radius)] border border-border bg-background text-foreground transition-colors outline-none focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 px-2.5 py-1" : "relative rounded-[var(--radius)] hover:bg-accent transition-colors",
961
+ defaultClassNames.dropdown_root
962
+ ),
963
+ dropdown: button.cn(
964
+ isDropdownCaption ? "absolute inset-0 cursor-pointer opacity-0" : "absolute bg-popover inset-0 opacity-0 cursor-pointer",
965
+ defaultClassNames.dropdown
966
+ ),
967
+ caption_label: button.cn(
968
+ "select-none font-[family-name:var(--font-family,Roboto)] tracking-tight transition-all duration-200",
969
+ captionLayout === "label" ? "rounded-[var(--radius)] px-2 py-1 text-[length:var(--calendar-caption-size)] font-[number:var(--font-weight-semibold)] hover:bg-accent hover:text-accent-foreground" : "flex h-full w-full items-center justify-between gap-2 rounded-[var(--radius)] text-[length:var(--calendar-caption-size)] font-[number:var(--font-weight-semibold)] [&>svg]:text-muted-foreground [&>svg]:size-4",
970
+ defaultClassNames.caption_label
971
+ ),
972
+ table: "w-full border-collapse mt-1",
973
+ weekdays: button.cn("flex gap-1", defaultClassNames.weekdays),
974
+ weekday: button.cn(
975
+ "text-muted-foreground rounded-(--cell-radius) flex-1 select-none text-[length:var(--calendar-weekday-size)] font-[number:var(--font-weight-medium)] uppercase tracking-wider",
976
+ defaultClassNames.weekday
977
+ ),
978
+ week: button.cn("flex w-full gap-1", defaultClassNames.week),
979
+ week_number_header: button.cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
980
+ week_number: button.cn(
981
+ "select-none text-muted-foreground text-[length:var(--calendar-weekday-size)]",
982
+ defaultClassNames.week_number
983
+ ),
984
+ day: button.cn(
985
+ "relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",
986
+ props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
987
+ defaultClassNames.day
988
+ ),
989
+ range_start: button.cn(
990
+ "rounded-l-(--cell-radius) bg-accent/50 relative after:bg-accent/50 after:absolute after:inset-y-0 after:w-2 after:right-0 -z-0 isolate",
991
+ defaultClassNames.range_start
992
+ ),
993
+ range_middle: button.cn("rounded-none bg-accent/30", defaultClassNames.range_middle),
994
+ range_end: button.cn(
995
+ "rounded-r-(--cell-radius) bg-accent/50 relative after:bg-accent/50 after:absolute after:inset-y-0 after:w-2 after:left-0 -z-0 isolate",
996
+ defaultClassNames.range_end
997
+ ),
998
+ today: button.cn(
999
+ "bg-accent/60 text-accent-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none font-[number:var(--font-weight-semibold)]",
1000
+ defaultClassNames.today
1001
+ ),
1002
+ outside: button.cn(
1003
+ "text-muted-foreground aria-selected:text-muted-foreground",
1004
+ defaultClassNames.outside
1005
+ ),
1006
+ disabled: button.cn("text-muted-foreground/30 opacity-40", defaultClassNames.disabled),
1007
+ hidden: button.cn("invisible", defaultClassNames.hidden),
1008
+ ...classNames
1009
+ },
1010
+ components: {
1011
+ Root: ({ className: className2, rootRef, ...props2 }) => {
1012
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "calendar", ref: rootRef, className: button.cn(className2), ...props2 });
1013
+ },
1014
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
1015
+ if (orientation === "left") {
1016
+ return /* @__PURE__ */ jsxRuntime.jsx(
1017
+ lucideReact.ChevronLeft,
1018
+ {
1019
+ className: button.cn("size-5 transition-transform group-hover:scale-110", className2),
1020
+ ...props2
1021
+ }
1022
+ );
1023
+ }
1024
+ if (orientation === "right") {
1025
+ return /* @__PURE__ */ jsxRuntime.jsx(
1026
+ lucideReact.ChevronRight,
1027
+ {
1028
+ className: button.cn("size-5 transition-transform group-hover:scale-110", className2),
1029
+ ...props2
1030
+ }
1031
+ );
1032
+ }
1033
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: button.cn("size-4", className2), ...props2 });
1034
+ },
1035
+ DayButton: CalendarDayButton,
1036
+ WeekNumber: ({ children, ...props2 }) => {
1037
+ return /* @__PURE__ */ jsxRuntime.jsx("td", { ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center font-[number:var(--font-weight-medium)]", children }) });
1038
+ },
1039
+ ...components
1040
+ },
1041
+ ...props
1042
+ }
1043
+ );
1044
+ }
1045
+ function CalendarDayButton({
1046
+ className,
1047
+ day,
1048
+ modifiers,
1049
+ ...props
1050
+ }) {
1051
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
1052
+ const ref = React__namespace.useRef(null);
1053
+ React__namespace.useEffect(() => {
1054
+ if (modifiers.focused) ref.current?.focus();
1055
+ }, [modifiers.focused]);
1056
+ return /* @__PURE__ */ jsxRuntime.jsx(
1057
+ button.Button,
1058
+ {
1059
+ ref,
1060
+ variant: "ghost",
1061
+ size: "icon",
1062
+ "data-day": day.date.toLocaleDateString(),
1063
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
1064
+ "data-range-start": modifiers.range_start,
1065
+ "data-range-end": modifiers.range_end,
1066
+ "data-range-middle": modifiers.range_middle,
1067
+ className: button.cn(
1068
+ "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col items-center justify-center gap-1 border-0 leading-none transition-all duration-200 cursor-pointer disabled:cursor-not-allowed",
1069
+ "text-[length:var(--calendar-day-size)] font-[number:var(--font-weight-regular)]",
1070
+ "hover:bg-accent/70 hover:text-accent-foreground hover:scale-105",
1071
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[selected-single=true]:font-[number:var(--font-weight-semibold)] data-[selected-single=true]:shadow-sm",
1072
+ "data-[range-middle=true]:bg-accent/50 data-[range-middle=true]:text-foreground",
1073
+ "data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-start=true]:font-[number:var(--font-weight-semibold)] data-[range-start=true]:shadow-sm",
1074
+ "data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-end=true]:font-[number:var(--font-weight-semibold)] data-[range-end=true]:shadow-sm",
1075
+ "group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 group-data-[focused=true]/day:ring-2 group-data-[focused=true]/day:ring-offset-2 group-data-[focused=true]/day:ring-offset-background",
1076
+ "data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius)",
1077
+ "data-[range-middle=true]:rounded-none",
1078
+ "data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius)",
1079
+ "[&>span]:opacity-80",
1080
+ defaultClassNames.day,
1081
+ className
1082
+ ),
1083
+ ...props,
1084
+ children: day.date.getDate()
1085
+ }
1086
+ );
1087
+ }
1088
+
1089
+ function Sheet({ ...props }) {
1090
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
1091
+ }
1092
+ function SheetTrigger({ ...props }) {
1093
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "sheet-trigger", ...props });
1094
+ }
1095
+ function SheetClose({ ...props }) {
1096
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "sheet-close", ...props });
1097
+ }
1098
+ function SheetPortal({ ...props }) {
1099
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
1100
+ }
1101
+ const SheetOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1102
+ DialogPrimitive__namespace.Overlay,
1103
+ {
1104
+ className: button.cn(
1105
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
1106
+ className
1107
+ ),
1108
+ ...props,
1109
+ ref
1110
+ }
1111
+ ));
1112
+ SheetOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
1113
+ function SheetContent({
1114
+ className,
1115
+ children,
1116
+ side = "right",
1117
+ ...props
1118
+ }) {
1119
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
1120
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
1121
+ /* @__PURE__ */ jsxRuntime.jsxs(
1122
+ DialogPrimitive__namespace.Content,
1123
+ {
1124
+ "data-slot": "sheet-content",
1125
+ className: button.cn(
1126
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1127
+ side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
1128
+ side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
1129
+ side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
1130
+ side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
1131
+ className
1132
+ ),
1133
+ ...props,
1134
+ children: [
1135
+ children,
1136
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
1137
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
1138
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
1139
+ ] })
1140
+ ]
1141
+ }
1142
+ )
1143
+ ] });
1144
+ }
1145
+ function SheetHeader({ className, ...props }) {
1146
+ return /* @__PURE__ */ jsxRuntime.jsx(
1147
+ "div",
1148
+ {
1149
+ "data-slot": "sheet-header",
1150
+ className: button.cn("flex flex-col gap-1.5 px-6 pt-6", className),
1151
+ ...props
1152
+ }
1153
+ );
1154
+ }
1155
+ function SheetBody({ className, ...props }) {
1156
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-body", className: button.cn("flex-1 overflow-auto px-6", className), ...props });
1157
+ }
1158
+ function SheetFooter({ className, ...props }) {
1159
+ return /* @__PURE__ */ jsxRuntime.jsx(
1160
+ "div",
1161
+ {
1162
+ "data-slot": "sheet-footer",
1163
+ className: button.cn("mt-auto flex flex-col gap-2 px-6 pb-6", className),
1164
+ ...props
1165
+ }
1166
+ );
1167
+ }
1168
+ function SheetTitle({ className, ...props }) {
1169
+ return /* @__PURE__ */ jsxRuntime.jsx(
1170
+ DialogPrimitive__namespace.Title,
1171
+ {
1172
+ "data-slot": "sheet-title",
1173
+ className: button.cn("text-foreground font-semibold", className),
1174
+ ...props
1175
+ }
1176
+ );
1177
+ }
1178
+ function SheetDescription({
1179
+ className,
1180
+ ...props
1181
+ }) {
1182
+ return /* @__PURE__ */ jsxRuntime.jsx(
1183
+ DialogPrimitive__namespace.Description,
1184
+ {
1185
+ "data-slot": "sheet-description",
1186
+ className: button.cn("text-muted-foreground text-sm", className),
1187
+ ...props
1188
+ }
1189
+ );
1190
+ }
1191
+
1192
+ function Drawer({ ...props }) {
1193
+ return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Root, { "data-slot": "drawer", ...props });
1194
+ }
1195
+ function DrawerTrigger({ ...props }) {
1196
+ return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Trigger, { "data-slot": "drawer-trigger", ...props });
1197
+ }
1198
+ function DrawerPortal({ ...props }) {
1199
+ return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
1200
+ }
1201
+ function DrawerClose({ ...props }) {
1202
+ return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Close, { "data-slot": "drawer-close", ...props });
1203
+ }
1204
+ const DrawerOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => {
1205
+ return /* @__PURE__ */ jsxRuntime.jsx(
1206
+ vaul.Drawer.Overlay,
1207
+ {
1208
+ ref,
1209
+ "data-slot": "drawer-overlay",
1210
+ className: button.cn(
1211
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
1212
+ className
1213
+ ),
1214
+ ...props
1215
+ }
1216
+ );
1217
+ });
1218
+ DrawerOverlay.displayName = vaul.Drawer.Overlay.displayName;
1219
+ function DrawerContent({
1220
+ className,
1221
+ children,
1222
+ ...props
1223
+ }) {
1224
+ return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
1225
+ /* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
1226
+ /* @__PURE__ */ jsxRuntime.jsxs(
1227
+ vaul.Drawer.Content,
1228
+ {
1229
+ "data-slot": "drawer-content",
1230
+ className: button.cn(
1231
+ "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
1232
+ "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
1233
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
1234
+ "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
1235
+ "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
1236
+ className
1237
+ ),
1238
+ ...props,
1239
+ children: [
1240
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
1241
+ children
1242
+ ]
1243
+ }
1244
+ )
1245
+ ] });
1246
+ }
1247
+ function DrawerHeader({ className, ...props }) {
1248
+ return /* @__PURE__ */ jsxRuntime.jsx(
1249
+ "div",
1250
+ {
1251
+ "data-slot": "drawer-header",
1252
+ className: button.cn("flex flex-col gap-1.5 p-4", className),
1253
+ ...props
1254
+ }
1255
+ );
1256
+ }
1257
+ function DrawerFooter({ className, ...props }) {
1258
+ return /* @__PURE__ */ jsxRuntime.jsx(
1259
+ "div",
1260
+ {
1261
+ "data-slot": "drawer-footer",
1262
+ className: button.cn("mt-auto flex flex-col gap-2 p-4", className),
1263
+ ...props
1264
+ }
1265
+ );
1266
+ }
1267
+ function DrawerTitle({ className, ...props }) {
1268
+ return /* @__PURE__ */ jsxRuntime.jsx(
1269
+ vaul.Drawer.Title,
1270
+ {
1271
+ "data-slot": "drawer-title",
1272
+ className: button.cn("text-foreground font-semibold", className),
1273
+ ...props
1274
+ }
1275
+ );
1276
+ }
1277
+ function DrawerDescription({
1278
+ className,
1279
+ ...props
1280
+ }) {
1281
+ return /* @__PURE__ */ jsxRuntime.jsx(
1282
+ vaul.Drawer.Description,
1283
+ {
1284
+ "data-slot": "drawer-description",
1285
+ className: button.cn("text-muted-foreground text-sm", className),
1286
+ ...props
1287
+ }
1288
+ );
1289
+ }
1290
+ function DrawerHandle({ className, ...props }) {
1291
+ return /* @__PURE__ */ jsxRuntime.jsx(
1292
+ "div",
1293
+ {
1294
+ "data-slot": "drawer-handle",
1295
+ className: button.cn("bg-muted mx-auto mt-4 h-2 w-[100px] shrink-0 rounded-full", className),
1296
+ ...props
1297
+ }
1298
+ );
1299
+ }
1300
+
1301
+ function HoverCard({ ...props }) {
1302
+ return /* @__PURE__ */ jsxRuntime.jsx(HoverCardPrimitive__namespace.Root, { "data-slot": "hover-card", ...props });
1303
+ }
1304
+ function HoverCardTrigger({ ...props }) {
1305
+ return /* @__PURE__ */ jsxRuntime.jsx(HoverCardPrimitive__namespace.Trigger, { "data-slot": "hover-card-trigger", ...props });
1306
+ }
1307
+ function HoverCardContent({
1308
+ className,
1309
+ align = "center",
1310
+ sideOffset = 4,
1311
+ ...props
1312
+ }) {
1313
+ return /* @__PURE__ */ jsxRuntime.jsx(HoverCardPrimitive__namespace.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsxRuntime.jsx(
1314
+ HoverCardPrimitive__namespace.Content,
1315
+ {
1316
+ "data-slot": "hover-card-content",
1317
+ align,
1318
+ sideOffset,
1319
+ className: button.cn(
1320
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
1321
+ className
1322
+ ),
1323
+ ...props
1324
+ }
1325
+ ) });
1326
+ }
1327
+
1328
+ function ContextMenu({ ...props }) {
1329
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Root, { "data-slot": "context-menu", ...props });
1330
+ }
1331
+ function ContextMenuTrigger({
1332
+ ...props
1333
+ }) {
1334
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Trigger, { "data-slot": "context-menu-trigger", ...props });
1335
+ }
1336
+ function ContextMenuGroup({ ...props }) {
1337
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Group, { "data-slot": "context-menu-group", ...props });
1338
+ }
1339
+ function ContextMenuPortal({ ...props }) {
1340
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Portal, { "data-slot": "context-menu-portal", ...props });
1341
+ }
1342
+ function ContextMenuSub({ ...props }) {
1343
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Sub, { "data-slot": "context-menu-sub", ...props });
1344
+ }
1345
+ function ContextMenuRadioGroup({
1346
+ ...props
1347
+ }) {
1348
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.RadioGroup, { "data-slot": "context-menu-radio-group", ...props });
1349
+ }
1350
+ function ContextMenuSubTrigger({
1351
+ className,
1352
+ inset,
1353
+ children,
1354
+ ...props
1355
+ }) {
1356
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1357
+ ContextMenuPrimitive__namespace.SubTrigger,
1358
+ {
1359
+ "data-slot": "context-menu-sub-trigger",
1360
+ "data-inset": inset,
1361
+ className: button.cn(
1362
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1363
+ className
1364
+ ),
1365
+ ...props,
1366
+ children: [
1367
+ children,
1368
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto" })
1369
+ ]
1370
+ }
1371
+ );
1372
+ }
1373
+ function ContextMenuSubContent({
1374
+ className,
1375
+ ...props
1376
+ }) {
1377
+ return /* @__PURE__ */ jsxRuntime.jsx(
1378
+ ContextMenuPrimitive__namespace.SubContent,
1379
+ {
1380
+ "data-slot": "context-menu-sub-content",
1381
+ className: button.cn(
1382
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
1383
+ className
1384
+ ),
1385
+ ...props
1386
+ }
1387
+ );
1388
+ }
1389
+ function ContextMenuContent({
1390
+ className,
1391
+ ...props
1392
+ }) {
1393
+ return /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1394
+ ContextMenuPrimitive__namespace.Content,
1395
+ {
1396
+ "data-slot": "context-menu-content",
1397
+ className: button.cn(
1398
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
1399
+ className
1400
+ ),
1401
+ ...props
1402
+ }
1403
+ ) });
1404
+ }
1405
+ function ContextMenuItem({
1406
+ className,
1407
+ inset,
1408
+ variant = "default",
1409
+ ...props
1410
+ }) {
1411
+ return /* @__PURE__ */ jsxRuntime.jsx(
1412
+ ContextMenuPrimitive__namespace.Item,
1413
+ {
1414
+ "data-slot": "context-menu-item",
1415
+ "data-inset": inset,
1416
+ "data-variant": variant,
1417
+ className: button.cn(
1418
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1419
+ className
1420
+ ),
1421
+ ...props
1422
+ }
1423
+ );
1424
+ }
1425
+ function ContextMenuCheckboxItem({
1426
+ className,
1427
+ children,
1428
+ checked,
1429
+ ...props
1430
+ }) {
1431
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1432
+ ContextMenuPrimitive__namespace.CheckboxItem,
1433
+ {
1434
+ "data-slot": "context-menu-checkbox-item",
1435
+ className: button.cn(
1436
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1437
+ className
1438
+ ),
1439
+ checked,
1440
+ ...props,
1441
+ children: [
1442
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) }) }),
1443
+ children
1444
+ ]
1445
+ }
1446
+ );
1447
+ }
1448
+ function ContextMenuRadioItem({
1449
+ className,
1450
+ children,
1451
+ ...props
1452
+ }) {
1453
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1454
+ ContextMenuPrimitive__namespace.RadioItem,
1455
+ {
1456
+ "data-slot": "context-menu-radio-item",
1457
+ className: button.cn(
1458
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1459
+ className
1460
+ ),
1461
+ ...props,
1462
+ children: [
1463
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "size-2 fill-current" }) }) }),
1464
+ children
1465
+ ]
1466
+ }
1467
+ );
1468
+ }
1469
+ function ContextMenuLabel({
1470
+ className,
1471
+ inset,
1472
+ ...props
1473
+ }) {
1474
+ return /* @__PURE__ */ jsxRuntime.jsx(
1475
+ ContextMenuPrimitive__namespace.Label,
1476
+ {
1477
+ "data-slot": "context-menu-label",
1478
+ "data-inset": inset,
1479
+ className: button.cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
1480
+ ...props
1481
+ }
1482
+ );
1483
+ }
1484
+ function ContextMenuSeparator({
1485
+ className,
1486
+ ...props
1487
+ }) {
1488
+ return /* @__PURE__ */ jsxRuntime.jsx(
1489
+ ContextMenuPrimitive__namespace.Separator,
1490
+ {
1491
+ "data-slot": "context-menu-separator",
1492
+ className: button.cn("bg-border -mx-1 my-1 h-px", className),
1493
+ ...props
1494
+ }
1495
+ );
1496
+ }
1497
+ function ContextMenuShortcut({ className, ...props }) {
1498
+ return /* @__PURE__ */ jsxRuntime.jsx(
1499
+ "span",
1500
+ {
1501
+ "data-slot": "context-menu-shortcut",
1502
+ className: button.cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1503
+ ...props
1504
+ }
1505
+ );
1506
+ }
1507
+
1508
+ function Menubar({ className, ...props }) {
1509
+ return /* @__PURE__ */ jsxRuntime.jsx(
1510
+ MenubarPrimitive__namespace.Root,
1511
+ {
1512
+ "data-slot": "menubar",
1513
+ className: button.cn(
1514
+ "bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
1515
+ className
1516
+ ),
1517
+ ...props
1518
+ }
1519
+ );
1520
+ }
1521
+ function MenubarMenu({ ...props }) {
1522
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.Menu, { "data-slot": "menubar-menu", ...props });
1523
+ }
1524
+ function MenubarGroup({ ...props }) {
1525
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.Group, { "data-slot": "menubar-group", ...props });
1526
+ }
1527
+ function MenubarPortal({ ...props }) {
1528
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.Portal, { "data-slot": "menubar-portal", ...props });
1529
+ }
1530
+ function MenubarRadioGroup({ ...props }) {
1531
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
1532
+ }
1533
+ function MenubarTrigger({
1534
+ className,
1535
+ ...props
1536
+ }) {
1537
+ return /* @__PURE__ */ jsxRuntime.jsx(
1538
+ MenubarPrimitive__namespace.Trigger,
1539
+ {
1540
+ "data-slot": "menubar-trigger",
1541
+ className: button.cn(
1542
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
1543
+ className
1544
+ ),
1545
+ ...props
1546
+ }
1547
+ );
1548
+ }
1549
+ function MenubarContent({
1550
+ className,
1551
+ align = "start",
1552
+ alignOffset = -4,
1553
+ sideOffset = 8,
1554
+ ...props
1555
+ }) {
1556
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1557
+ MenubarPrimitive__namespace.Content,
1558
+ {
1559
+ "data-slot": "menubar-content",
1560
+ align,
1561
+ alignOffset,
1562
+ sideOffset,
1563
+ className: button.cn(
1564
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
1565
+ className
1566
+ ),
1567
+ ...props
1568
+ }
1569
+ ) });
1570
+ }
1571
+ function MenubarItem({
1572
+ className,
1573
+ inset,
1574
+ variant = "default",
1575
+ ...props
1576
+ }) {
1577
+ return /* @__PURE__ */ jsxRuntime.jsx(
1578
+ MenubarPrimitive__namespace.Item,
1579
+ {
1580
+ "data-slot": "menubar-item",
1581
+ "data-inset": inset,
1582
+ "data-variant": variant,
1583
+ className: button.cn(
1584
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1585
+ className
1586
+ ),
1587
+ ...props
1588
+ }
1589
+ );
1590
+ }
1591
+ function MenubarCheckboxItem({
1592
+ className,
1593
+ children,
1594
+ checked,
1595
+ ...props
1596
+ }) {
1597
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1598
+ MenubarPrimitive__namespace.CheckboxItem,
1599
+ {
1600
+ "data-slot": "menubar-checkbox-item",
1601
+ className: button.cn(
1602
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1603
+ className
1604
+ ),
1605
+ checked,
1606
+ ...props,
1607
+ children: [
1608
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) }) }),
1609
+ children
1610
+ ]
1611
+ }
1612
+ );
1613
+ }
1614
+ function MenubarRadioItem({
1615
+ className,
1616
+ children,
1617
+ ...props
1618
+ }) {
1619
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1620
+ MenubarPrimitive__namespace.RadioItem,
1621
+ {
1622
+ "data-slot": "menubar-radio-item",
1623
+ className: button.cn(
1624
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1625
+ className
1626
+ ),
1627
+ ...props,
1628
+ children: [
1629
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "size-2 fill-current" }) }) }),
1630
+ children
1631
+ ]
1632
+ }
1633
+ );
1634
+ }
1635
+ function MenubarLabel({
1636
+ className,
1637
+ inset,
1638
+ ...props
1639
+ }) {
1640
+ return /* @__PURE__ */ jsxRuntime.jsx(
1641
+ MenubarPrimitive__namespace.Label,
1642
+ {
1643
+ "data-slot": "menubar-label",
1644
+ "data-inset": inset,
1645
+ className: button.cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
1646
+ ...props
1647
+ }
1648
+ );
1649
+ }
1650
+ function MenubarSeparator({
1651
+ className,
1652
+ ...props
1653
+ }) {
1654
+ return /* @__PURE__ */ jsxRuntime.jsx(
1655
+ MenubarPrimitive__namespace.Separator,
1656
+ {
1657
+ "data-slot": "menubar-separator",
1658
+ className: button.cn("bg-border -mx-1 my-1 h-px", className),
1659
+ ...props
1660
+ }
1661
+ );
1662
+ }
1663
+ function MenubarShortcut({ className, ...props }) {
1664
+ return /* @__PURE__ */ jsxRuntime.jsx(
1665
+ "span",
1666
+ {
1667
+ "data-slot": "menubar-shortcut",
1668
+ className: button.cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1669
+ ...props
1670
+ }
1671
+ );
1672
+ }
1673
+ function MenubarSub({ ...props }) {
1674
+ return /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.Sub, { "data-slot": "menubar-sub", ...props });
1675
+ }
1676
+ function MenubarSubTrigger({
1677
+ className,
1678
+ inset,
1679
+ children,
1680
+ ...props
1681
+ }) {
1682
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1683
+ MenubarPrimitive__namespace.SubTrigger,
1684
+ {
1685
+ "data-slot": "menubar-sub-trigger",
1686
+ "data-inset": inset,
1687
+ className: button.cn(
1688
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",
1689
+ className
1690
+ ),
1691
+ ...props,
1692
+ children: [
1693
+ children,
1694
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto h-4 w-4" })
1695
+ ]
1696
+ }
1697
+ );
1698
+ }
1699
+ function MenubarSubContent({
1700
+ className,
1701
+ ...props
1702
+ }) {
1703
+ return /* @__PURE__ */ jsxRuntime.jsx(
1704
+ MenubarPrimitive__namespace.SubContent,
1705
+ {
1706
+ "data-slot": "menubar-sub-content",
1707
+ className: button.cn(
1708
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
1709
+ className
1710
+ ),
1711
+ ...props
1712
+ }
1713
+ );
1714
+ }
1715
+
1716
+ function Command({ className, ...props }) {
1717
+ return /* @__PURE__ */ jsxRuntime.jsx(
1718
+ cmdk.Command,
1719
+ {
1720
+ "data-slot": "command",
1721
+ className: button.cn(
1722
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
1723
+ className
1724
+ ),
1725
+ ...props
1726
+ }
1727
+ );
1728
+ }
1729
+ function CommandDialog({
1730
+ title = "Command Palette",
1731
+ description = "Search for a command to run...",
1732
+ children,
1733
+ ...props
1734
+ }) {
1735
+ return /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.Dialog, { ...props, children: [
1736
+ /* @__PURE__ */ jsxRuntime.jsxs(richTextEditor.DialogHeader, { className: "sr-only", children: [
1737
+ /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.DialogTitle, { children: title }),
1738
+ /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.DialogDescription, { children: description })
1739
+ ] }),
1740
+ /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) })
1741
+ ] });
1742
+ }
1743
+ function CommandInput({
1744
+ className,
1745
+ ...props
1746
+ }) {
1747
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [
1748
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
1749
+ /* @__PURE__ */ jsxRuntime.jsx(
1750
+ cmdk.Command.Input,
1751
+ {
1752
+ "data-slot": "command-input",
1753
+ className: button.cn(
1754
+ "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
1755
+ className
1756
+ ),
1757
+ ...props
1758
+ }
1759
+ )
1760
+ ] });
1761
+ }
1762
+ function CommandList({ className, ...props }) {
1763
+ return /* @__PURE__ */ jsxRuntime.jsx(
1764
+ cmdk.Command.List,
1765
+ {
1766
+ "data-slot": "command-list",
1767
+ role: "listbox",
1768
+ className: button.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
1769
+ ...props
1770
+ }
1771
+ );
1772
+ }
1773
+ function CommandEmpty({ ...props }) {
1774
+ return /* @__PURE__ */ jsxRuntime.jsx(
1775
+ cmdk.Command.Empty,
1776
+ {
1777
+ "data-slot": "command-empty",
1778
+ className: "py-6 text-center text-sm",
1779
+ ...props
1780
+ }
1781
+ );
1782
+ }
1783
+ function CommandGroup({
1784
+ className,
1785
+ ...props
1786
+ }) {
1787
+ return /* @__PURE__ */ jsxRuntime.jsx(
1788
+ cmdk.Command.Group,
1789
+ {
1790
+ "data-slot": "command-group",
1791
+ className: button.cn(
1792
+ "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
1793
+ className
1794
+ ),
1795
+ ...props
1796
+ }
1797
+ );
1798
+ }
1799
+ function CommandSeparator({
1800
+ className,
1801
+ ...props
1802
+ }) {
1803
+ return /* @__PURE__ */ jsxRuntime.jsx(
1804
+ cmdk.Command.Separator,
1805
+ {
1806
+ "data-slot": "command-separator",
1807
+ className: button.cn("bg-border -mx-1 h-px", className),
1808
+ ...props
1809
+ }
1810
+ );
1811
+ }
1812
+ function CommandItem({ className, ...props }) {
1813
+ return /* @__PURE__ */ jsxRuntime.jsx(
1814
+ cmdk.Command.Item,
1815
+ {
1816
+ "data-slot": "command-item",
1817
+ role: "option",
1818
+ className: button.cn(
1819
+ "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1820
+ className
1821
+ ),
1822
+ ...props
1823
+ }
1824
+ );
1825
+ }
1826
+ function CommandShortcut({ className, ...props }) {
1827
+ return /* @__PURE__ */ jsxRuntime.jsx(
1828
+ "span",
1829
+ {
1830
+ "data-slot": "command-shortcut",
1831
+ className: button.cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1832
+ ...props
1833
+ }
1834
+ );
1835
+ }
1836
+
1837
+ const variantStyles = {
1838
+ default: "bg-primary text-primary-foreground",
1839
+ secondary: "bg-secondary text-secondary-foreground",
1840
+ destructive: "bg-destructive text-destructive-foreground",
1841
+ outline: "border-2 border-primary bg-background text-primary",
1842
+ success: "bg-success text-success-foreground",
1843
+ info: "bg-info text-info-foreground",
1844
+ warning: "bg-warning text-warning-foreground"
1845
+ };
1846
+ const NotificationBadge = React__namespace.forwardRef(
1847
+ ({
1848
+ className,
1849
+ count = 0,
1850
+ max = 99,
1851
+ showZero = false,
1852
+ dot = false,
1853
+ variant = "destructive",
1854
+ children,
1855
+ ...props
1856
+ }, ref) => {
1857
+ const displayCount = count > max ? `${max}+` : count;
1858
+ const shouldShow = count > 0 || showZero;
1859
+ if (!shouldShow && !dot) {
1860
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className, ...props, children });
1861
+ }
1862
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: button.cn("relative inline-block", className), ...props, children: [
1863
+ children,
1864
+ /* @__PURE__ */ jsxRuntime.jsx(
1865
+ "span",
1866
+ {
1867
+ className: button.cn(
1868
+ "absolute -right-1 -top-1 flex items-center justify-center rounded-full",
1869
+ variantStyles[variant],
1870
+ dot ? "h-2 w-2" : "min-w-[1.25rem] h-5 px-1.5"
1871
+ ),
1872
+ children: !dot && shouldShow && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium leading-none", children: displayCount })
1873
+ }
1874
+ )
1875
+ ] });
1876
+ }
1877
+ );
1878
+ NotificationBadge.displayName = "NotificationBadge";
1879
+
1880
+ const StatsCard = React__namespace.forwardRef(
1881
+ ({ className, title, value, description, trend, icon, iconColor, iconBg, ...props }, ref) => {
1882
+ const getTrendIcon = () => {
1883
+ if (!trend) return null;
1884
+ if (trend.value > 0) {
1885
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TrendingUp, { className: "h-4 w-4 text-success" });
1886
+ } else if (trend.value < 0) {
1887
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TrendingDown, { className: "h-4 w-4 text-destructive" });
1888
+ } else {
1889
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "h-4 w-4 text-muted-foreground" });
1890
+ }
1891
+ };
1892
+ const getTrendColor = () => {
1893
+ if (!trend) return "";
1894
+ if (trend.value > 0) {
1895
+ return "text-success";
1896
+ } else if (trend.value < 0) {
1897
+ return "text-destructive";
1898
+ } else {
1899
+ return "text-muted-foreground";
1900
+ }
1901
+ };
1902
+ return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Card, { ref, className: button.cn("", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
1903
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
1904
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mb-1 text-sm", children: title }),
1905
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
1906
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-foreground text-xl sm:text-2xl", children: value }),
1907
+ trend && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("flex items-center gap-1 text-sm", getTrendColor()), children: [
1908
+ getTrendIcon(),
1909
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1910
+ Math.abs(trend.value),
1911
+ "%"
1912
+ ] })
1913
+ ] })
1914
+ ] }),
1915
+ (description || trend?.label) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1 text-xs sm:text-sm", children: trend?.label || description })
1916
+ ] }),
1917
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
1918
+ "div",
1919
+ {
1920
+ className: button.cn(
1921
+ "rounded-[var(--radius)] p-2 sm:p-3 flex-shrink-0",
1922
+ iconBg || "bg-muted",
1923
+ iconColor || "text-muted-foreground"
1924
+ ),
1925
+ children: icon
1926
+ }
1927
+ )
1928
+ ] }) }) });
1929
+ }
1930
+ );
1931
+ StatsCard.displayName = "StatsCard";
1932
+
1933
+ function StatsCardSkeleton({
1934
+ showIcon = true,
1935
+ showTrend = true,
1936
+ className,
1937
+ ...props
1938
+ }) {
1939
+ return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Card, { className: button.cn("", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
1940
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
1941
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3.5 w-28 mb-2" }),
1942
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
1943
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-7 w-24" }),
1944
+ showTrend && /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-14 rounded-full" })
1945
+ ] }),
1946
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-32 mt-2" })
1947
+ ] }),
1948
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-9 sm:size-11 rounded-[var(--radius)] shrink-0" })
1949
+ ] }) }) });
1950
+ }
1951
+ StatsCardSkeleton.displayName = "StatsCardSkeleton";
1952
+
1953
+ const Timeline = React__namespace.forwardRef(
1954
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("ol", { ref, className: button.cn("relative border-l border-border", className), ...props })
1955
+ );
1956
+ Timeline.displayName = "Timeline";
1957
+ const TimelineItem = React__namespace.forwardRef(
1958
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: button.cn("mb-10 ml-6", className), ...props })
1959
+ );
1960
+ TimelineItem.displayName = "TimelineItem";
1961
+ const TimelineDot = React__namespace.forwardRef(({ className, variant = "default", icon, children, ...props }, ref) => {
1962
+ const variantStyles = {
1963
+ default: "bg-muted border-border",
1964
+ primary: "bg-primary border-primary",
1965
+ success: "bg-success border-success",
1966
+ info: "bg-info border-info",
1967
+ warning: "bg-warning border-warning",
1968
+ destructive: "bg-destructive border-destructive",
1969
+ outline: "bg-background border-border"
1970
+ };
1971
+ const iconColorStyles = {
1972
+ default: "text-muted-foreground",
1973
+ primary: "text-primary-foreground",
1974
+ success: "text-success-foreground",
1975
+ info: "text-info-foreground",
1976
+ warning: "text-warning-foreground",
1977
+ destructive: "text-destructive-foreground",
1978
+ outline: "text-foreground"
1979
+ };
1980
+ if (icon || children) {
1981
+ return /* @__PURE__ */ jsxRuntime.jsx(
1982
+ "div",
1983
+ {
1984
+ ref,
1985
+ className: button.cn(
1986
+ "absolute -left-[17px] mt-0.5 h-8 w-8 rounded-full border-2 flex items-center justify-center",
1987
+ variantStyles[variant],
1988
+ className
1989
+ ),
1990
+ ...props,
1991
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: button.cn("h-4 w-4", iconColorStyles[variant]), children: icon || children })
1992
+ }
1993
+ );
1994
+ }
1995
+ return /* @__PURE__ */ jsxRuntime.jsx(
1996
+ "div",
1997
+ {
1998
+ ref,
1999
+ className: button.cn(
2000
+ "absolute -left-[9px] mt-1.5 h-4 w-4 rounded-full border-2",
2001
+ variantStyles[variant],
2002
+ className
2003
+ ),
2004
+ ...props
2005
+ }
2006
+ );
2007
+ });
2008
+ TimelineDot.displayName = "TimelineDot";
2009
+ const TimelineContent = React__namespace.forwardRef(
2010
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: button.cn("", className), ...props })
2011
+ );
2012
+ TimelineContent.displayName = "TimelineContent";
2013
+ const TimelineHeading = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: button.cn("mb-1 text-foreground", className), ...props }));
2014
+ TimelineHeading.displayName = "TimelineHeading";
2015
+ const TimelineTime = React__namespace.forwardRef(
2016
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("time", { ref, className: button.cn("mb-2 block text-muted-foreground", className), ...props })
2017
+ );
2018
+ TimelineTime.displayName = "TimelineTime";
2019
+ const TimelineDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: button.cn("text-muted-foreground", className), ...props }));
2020
+ TimelineDescription.displayName = "TimelineDescription";
2021
+
2022
+ function useTreeView({
2023
+ data,
2024
+ defaultExpanded = [],
2025
+ selectedNodeId,
2026
+ onNodeClick,
2027
+ onNodeSelect
2028
+ }) {
2029
+ const [expanded, setExpanded] = React.useState(new Set(defaultExpanded));
2030
+ const [internalSelectedId, setInternalSelectedId] = React.useState(void 0);
2031
+ const nodeRefs = React.useRef(/* @__PURE__ */ new Map());
2032
+ const isControlled = selectedNodeId !== void 0;
2033
+ const effectiveSelectedId = isControlled ? selectedNodeId : internalSelectedId;
2034
+ const getNodeRef = React.useCallback(
2035
+ (nodeId) => (el) => {
2036
+ if (el) nodeRefs.current.set(nodeId, el);
2037
+ else nodeRefs.current.delete(nodeId);
2038
+ },
2039
+ []
2040
+ );
2041
+ const getVisibleNodes = React.useCallback(() => {
2042
+ const result = [];
2043
+ const traverse = (nodes) => {
2044
+ for (const node of nodes) {
2045
+ result.push(node);
2046
+ if (node.children?.length && expanded.has(node.id)) traverse(node.children);
2047
+ }
2048
+ };
2049
+ traverse(data);
2050
+ return result;
2051
+ }, [data, expanded]);
2052
+ const findParent = React.useCallback(
2053
+ (nodes, targetId) => {
2054
+ for (const n of nodes) {
2055
+ if (n.children?.some((c) => c.id === targetId)) return n;
2056
+ if (n.children) {
2057
+ const found = findParent(n.children, targetId);
2058
+ if (found) return found;
2059
+ }
2060
+ }
2061
+ return null;
2062
+ },
2063
+ // findParent is a pure recursive function over `data` — no reactive deps needed
2064
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2065
+ []
2066
+ );
2067
+ const toggleExpand = React.useCallback((nodeId) => {
2068
+ setExpanded((prev) => {
2069
+ const next = new Set(prev);
2070
+ next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);
2071
+ return next;
2072
+ });
2073
+ }, []);
2074
+ const handleSelect = React.useCallback(
2075
+ (node) => {
2076
+ if (!isControlled) setInternalSelectedId(node.id);
2077
+ onNodeSelect?.(node);
2078
+ onNodeClick?.(node);
2079
+ },
2080
+ [isControlled, onNodeClick, onNodeSelect]
2081
+ );
2082
+ const handleKeyDown = React.useCallback(
2083
+ (e, node) => {
2084
+ const visibleNodes = getVisibleNodes();
2085
+ const idx = visibleNodes.findIndex((n) => n.id === node.id);
2086
+ const hasChildren = !!node.children?.length;
2087
+ const isExpanded = expanded.has(node.id);
2088
+ const focusNode = (id) => {
2089
+ nodeRefs.current.get(id)?.focus();
2090
+ };
2091
+ switch (e.key) {
2092
+ case "ArrowDown": {
2093
+ e.preventDefault();
2094
+ const next = visibleNodes[idx + 1];
2095
+ if (next) focusNode(next.id);
2096
+ break;
2097
+ }
2098
+ case "ArrowUp": {
2099
+ e.preventDefault();
2100
+ const prev = visibleNodes[idx - 1];
2101
+ if (prev) focusNode(prev.id);
2102
+ break;
2103
+ }
2104
+ case "ArrowRight": {
2105
+ e.preventDefault();
2106
+ if (hasChildren && !isExpanded) {
2107
+ toggleExpand(node.id);
2108
+ } else if (hasChildren && isExpanded && node.children?.length) {
2109
+ focusNode(node.children[0].id);
2110
+ }
2111
+ break;
2112
+ }
2113
+ case "ArrowLeft": {
2114
+ e.preventDefault();
2115
+ if (hasChildren && isExpanded) {
2116
+ toggleExpand(node.id);
2117
+ } else {
2118
+ const parent = findParent(data, node.id);
2119
+ if (parent) focusNode(parent.id);
2120
+ }
2121
+ break;
2122
+ }
2123
+ case "Home": {
2124
+ e.preventDefault();
2125
+ if (visibleNodes.length > 0) focusNode(visibleNodes[0].id);
2126
+ break;
2127
+ }
2128
+ case "End": {
2129
+ e.preventDefault();
2130
+ const last = visibleNodes[visibleNodes.length - 1];
2131
+ if (last) focusNode(last.id);
2132
+ break;
2133
+ }
2134
+ case " ": {
2135
+ e.preventDefault();
2136
+ if (hasChildren) {
2137
+ toggleExpand(node.id);
2138
+ } else {
2139
+ handleSelect(node);
2140
+ }
2141
+ break;
2142
+ }
2143
+ case "Enter": {
2144
+ e.preventDefault();
2145
+ if (hasChildren) toggleExpand(node.id);
2146
+ handleSelect(node);
2147
+ break;
2148
+ }
2149
+ }
2150
+ },
2151
+ [data, expanded, findParent, getVisibleNodes, handleSelect, toggleExpand]
2152
+ );
2153
+ return {
2154
+ expanded,
2155
+ effectiveSelectedId,
2156
+ nodeRefs,
2157
+ getNodeRef,
2158
+ toggleExpand,
2159
+ handleSelect,
2160
+ handleKeyDown,
2161
+ getVisibleNodes
2162
+ };
2163
+ }
2164
+
2165
+ const TreeView = React__namespace.forwardRef(
2166
+ ({
2167
+ className,
2168
+ data,
2169
+ onNodeClick,
2170
+ onNodeSelect,
2171
+ defaultExpanded = [],
2172
+ selectedNodeId,
2173
+ ariaLabel,
2174
+ ...props
2175
+ }, ref) => {
2176
+ const { expanded, effectiveSelectedId, getNodeRef, toggleExpand, handleSelect, handleKeyDown } = useTreeView({ data, defaultExpanded, selectedNodeId, onNodeClick, onNodeSelect });
2177
+ const focusableId = effectiveSelectedId ?? data[0]?.id;
2178
+ return /* @__PURE__ */ jsxRuntime.jsx(
2179
+ "div",
2180
+ {
2181
+ ref,
2182
+ className: button.cn("w-full", className),
2183
+ role: "tree",
2184
+ "aria-label": ariaLabel ?? "Navegação em árvore",
2185
+ ...props,
2186
+ children: data.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
2187
+ TreeNodeComponent,
2188
+ {
2189
+ node,
2190
+ level: 0,
2191
+ expanded,
2192
+ selectedId: effectiveSelectedId,
2193
+ focusableId,
2194
+ onToggle: toggleExpand,
2195
+ onSelect: handleSelect,
2196
+ onKeyDown: handleKeyDown,
2197
+ getNodeRef
2198
+ },
2199
+ node.id
2200
+ ))
2201
+ }
2202
+ );
2203
+ }
2204
+ );
2205
+ TreeView.displayName = "TreeView";
2206
+ const TreeNodeComponent = ({
2207
+ node,
2208
+ level,
2209
+ expanded,
2210
+ selectedId,
2211
+ focusableId,
2212
+ onToggle,
2213
+ onSelect,
2214
+ onKeyDown,
2215
+ getNodeRef
2216
+ }) => {
2217
+ const hasChildren = !!node.children?.length;
2218
+ const isExpanded = expanded.has(node.id);
2219
+ const isSelected = node.id === selectedId;
2220
+ const handleClick = () => {
2221
+ if (hasChildren) onToggle(node.id);
2222
+ onSelect(node);
2223
+ };
2224
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "none", children: [
2225
+ /* @__PURE__ */ jsxRuntime.jsxs(
2226
+ "button",
2227
+ {
2228
+ ref: getNodeRef(node.id),
2229
+ role: "treeitem",
2230
+ "aria-expanded": hasChildren ? isExpanded : void 0,
2231
+ "aria-selected": isSelected,
2232
+ tabIndex: node.id === focusableId ? 0 : -1,
2233
+ onClick: handleClick,
2234
+ onKeyDown: (e) => onKeyDown(e, node),
2235
+ className: button.cn(
2236
+ "flex w-full items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-left transition-colors",
2237
+ "hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
2238
+ isSelected && "bg-primary/10 text-primary font-medium"
2239
+ ),
2240
+ style: { paddingLeft: `${level * 1.5 + 0.5}rem` },
2241
+ children: [
2242
+ hasChildren ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-4 flex-shrink-0", "aria-hidden": "true" }),
2243
+ node.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: node.icon }),
2244
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-foreground", children: node.label })
2245
+ ]
2246
+ }
2247
+ ),
2248
+ hasChildren && isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", children: node.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
2249
+ TreeNodeComponent,
2250
+ {
2251
+ node: child,
2252
+ level: level + 1,
2253
+ expanded,
2254
+ selectedId,
2255
+ focusableId,
2256
+ onToggle,
2257
+ onSelect,
2258
+ onKeyDown,
2259
+ getNodeRef
2260
+ },
2261
+ child.id
2262
+ )) })
2263
+ ] });
2264
+ };
2265
+
2266
+ function Collapsible({ ...props }) {
2267
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { "data-slot": "collapsible", ...props });
2268
+ }
2269
+ function CollapsibleTrigger({
2270
+ ...props
2271
+ }) {
2272
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
2273
+ }
2274
+ function CollapsibleContent({
2275
+ ...props
2276
+ }) {
2277
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
2278
+ }
2279
+
2280
+ function Accordion({ ...props }) {
2281
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { "data-slot": "accordion", ...props });
2282
+ }
2283
+ function AccordionItem({
2284
+ className,
2285
+ ...props
2286
+ }) {
2287
+ return /* @__PURE__ */ jsxRuntime.jsx(
2288
+ AccordionPrimitive__namespace.Item,
2289
+ {
2290
+ "data-slot": "accordion-item",
2291
+ className: button.cn("border-b last:border-b-0", className),
2292
+ ...props
2293
+ }
2294
+ );
2295
+ }
2296
+ function AccordionTrigger({
2297
+ className,
2298
+ children,
2299
+ ...props
2300
+ }) {
2301
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
2302
+ AccordionPrimitive__namespace.Trigger,
2303
+ {
2304
+ "data-slot": "accordion-trigger",
2305
+ className: button.cn(
2306
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
2307
+ className
2308
+ ),
2309
+ ...props,
2310
+ children: [
2311
+ children,
2312
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
2313
+ ]
2314
+ }
2315
+ ) });
2316
+ }
2317
+ function AccordionContent({
2318
+ className,
2319
+ children,
2320
+ ...props
2321
+ }) {
2322
+ return /* @__PURE__ */ jsxRuntime.jsx(
2323
+ AccordionPrimitive__namespace.Content,
2324
+ {
2325
+ "data-slot": "accordion-content",
2326
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
2327
+ ...props,
2328
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("pt-0 pb-4", className), children })
2329
+ }
2330
+ );
2331
+ }
2332
+
2333
+ const CarouselContext = React__namespace.createContext(null);
2334
+ function useCarousel() {
2335
+ const context = React__namespace.useContext(CarouselContext);
2336
+ if (!context) {
2337
+ throw new Error("useCarousel must be used within a <Carousel />");
2338
+ }
2339
+ return context;
2340
+ }
2341
+ function Carousel({
2342
+ orientation = "horizontal",
2343
+ opts,
2344
+ setApi,
2345
+ plugins,
2346
+ className,
2347
+ children,
2348
+ ...props
2349
+ }) {
2350
+ const [carouselRef, api] = useEmblaCarousel(
2351
+ {
2352
+ ...opts,
2353
+ axis: orientation === "horizontal" ? "x" : "y"
2354
+ },
2355
+ plugins
2356
+ );
2357
+ const [canScrollPrev, setCanScrollPrev] = React__namespace.useState(false);
2358
+ const [canScrollNext, setCanScrollNext] = React__namespace.useState(false);
2359
+ const onSelect = React__namespace.useCallback((api2) => {
2360
+ if (!api2) return;
2361
+ setCanScrollPrev(api2.canScrollPrev());
2362
+ setCanScrollNext(api2.canScrollNext());
2363
+ }, []);
2364
+ const scrollPrev = React__namespace.useCallback(() => {
2365
+ api?.scrollPrev();
2366
+ }, [api]);
2367
+ const scrollNext = React__namespace.useCallback(() => {
2368
+ api?.scrollNext();
2369
+ }, [api]);
2370
+ const handleKeyDown = React__namespace.useCallback(
2371
+ (event) => {
2372
+ if (event.key === "ArrowLeft") {
2373
+ event.preventDefault();
2374
+ scrollPrev();
2375
+ } else if (event.key === "ArrowRight") {
2376
+ event.preventDefault();
2377
+ scrollNext();
2378
+ }
2379
+ },
2380
+ [scrollPrev, scrollNext]
2381
+ );
2382
+ React__namespace.useEffect(() => {
2383
+ if (!api || !setApi) return;
2384
+ setApi(api);
2385
+ }, [api, setApi]);
2386
+ React__namespace.useEffect(() => {
2387
+ if (!api) return;
2388
+ onSelect(api);
2389
+ api.on("reInit", onSelect);
2390
+ api.on("select", onSelect);
2391
+ return () => {
2392
+ api?.off("select", onSelect);
2393
+ };
2394
+ }, [api, onSelect]);
2395
+ return /* @__PURE__ */ jsxRuntime.jsx(
2396
+ CarouselContext.Provider,
2397
+ {
2398
+ value: {
2399
+ carouselRef,
2400
+ api,
2401
+ opts,
2402
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
2403
+ scrollPrev,
2404
+ scrollNext,
2405
+ canScrollPrev,
2406
+ canScrollNext
2407
+ },
2408
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2409
+ "div",
2410
+ {
2411
+ onKeyDownCapture: handleKeyDown,
2412
+ className: button.cn("relative", className),
2413
+ role: "region",
2414
+ "aria-roledescription": "carousel",
2415
+ "data-slot": "carousel",
2416
+ ...props,
2417
+ children
2418
+ }
2419
+ )
2420
+ }
2421
+ );
2422
+ }
2423
+ function CarouselContent({ className, ...props }) {
2424
+ const { carouselRef, orientation } = useCarousel();
2425
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsxRuntime.jsx(
2426
+ "div",
2427
+ {
2428
+ className: button.cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
2429
+ ...props
2430
+ }
2431
+ ) });
2432
+ }
2433
+ function CarouselItem({ className, ...props }) {
2434
+ const { orientation } = useCarousel();
2435
+ return /* @__PURE__ */ jsxRuntime.jsx(
2436
+ "div",
2437
+ {
2438
+ role: "group",
2439
+ "aria-roledescription": "slide",
2440
+ "data-slot": "carousel-item",
2441
+ className: button.cn(
2442
+ "min-w-0 shrink-0 grow-0 basis-full",
2443
+ orientation === "horizontal" ? "pl-4" : "pt-4",
2444
+ className
2445
+ ),
2446
+ ...props
2447
+ }
2448
+ );
2449
+ }
2450
+ function CarouselPrevious({
2451
+ className,
2452
+ variant = "outline",
2453
+ size = "icon",
2454
+ ...props
2455
+ }) {
2456
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
2457
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2458
+ button.Button,
2459
+ {
2460
+ "data-slot": "carousel-previous",
2461
+ variant,
2462
+ size,
2463
+ className: button.cn(
2464
+ "absolute size-8 rounded-full",
2465
+ orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
2466
+ className
2467
+ ),
2468
+ disabled: !canScrollPrev,
2469
+ onClick: scrollPrev,
2470
+ ...props,
2471
+ children: [
2472
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, {}),
2473
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Previous slide" })
2474
+ ]
2475
+ }
2476
+ );
2477
+ }
2478
+ function CarouselNext({
2479
+ className,
2480
+ variant = "outline",
2481
+ size = "icon",
2482
+ ...props
2483
+ }) {
2484
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
2485
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2486
+ button.Button,
2487
+ {
2488
+ "data-slot": "carousel-next",
2489
+ variant,
2490
+ size,
2491
+ className: button.cn(
2492
+ "absolute size-8 rounded-full",
2493
+ orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
2494
+ className
2495
+ ),
2496
+ disabled: !canScrollNext,
2497
+ onClick: scrollNext,
2498
+ ...props,
2499
+ children: [
2500
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, {}),
2501
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Next slide" })
2502
+ ]
2503
+ }
2504
+ );
2505
+ }
2506
+
2507
+ const StepperContext = React__namespace.createContext(void 0);
2508
+ const useStepperContext = () => {
2509
+ const context = React__namespace.useContext(StepperContext);
2510
+ if (!context) throw new Error("useStepperContext must be used within a Stepper");
2511
+ return context;
2512
+ };
2513
+ const Stepper = React__namespace.forwardRef(
2514
+ ({ currentStep, orientation = "horizontal", className, children, ...props }, ref) => {
2515
+ const totalSteps = React__namespace.Children.count(children);
2516
+ return /* @__PURE__ */ jsxRuntime.jsx(StepperContext.Provider, { value: { currentStep, totalSteps, orientation }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: button.cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2517
+ "div",
2518
+ {
2519
+ className: button.cn(
2520
+ orientation === "horizontal" ? "flex items-start justify-between" : "flex flex-col gap-0"
2521
+ ),
2522
+ role: "list",
2523
+ "aria-label": `Progresso: etapa ${currentStep} de ${totalSteps}`,
2524
+ children
2525
+ }
2526
+ ) }) });
2527
+ }
2528
+ );
2529
+ Stepper.displayName = "Stepper";
2530
+ const Step = React__namespace.forwardRef(
2531
+ ({ step, label, description, error = false, className, ...props }, ref) => {
2532
+ const { currentStep, totalSteps, orientation } = useStepperContext();
2533
+ const isActive = step === currentStep;
2534
+ const isCompleted = step < currentStep && !error;
2535
+ const isFirst = step === 1;
2536
+ const isLast = step === totalSteps;
2537
+ const circleClasses = button.cn(
2538
+ "relative flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors",
2539
+ isActive && !error && "border-primary bg-primary text-primary-foreground",
2540
+ isCompleted && "border-primary bg-primary text-primary-foreground",
2541
+ error && "border-destructive bg-destructive text-destructive-foreground",
2542
+ !isActive && !isCompleted && !error && "border-muted bg-background text-muted-foreground"
2543
+ );
2544
+ const connectorClasses = (filled) => button.cn("transition-colors", filled ? "bg-primary" : "bg-muted");
2545
+ if (orientation === "vertical") {
2546
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2547
+ "div",
2548
+ {
2549
+ ref,
2550
+ className: button.cn("flex gap-4", className),
2551
+ role: "listitem",
2552
+ "aria-current": isActive ? "step" : void 0,
2553
+ "aria-label": `Etapa ${step}: ${label}${isCompleted ? ", concluída" : isActive ? ", atual" : ""}`,
2554
+ ...props,
2555
+ children: [
2556
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
2557
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: step }) }),
2558
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx(
2559
+ "div",
2560
+ {
2561
+ className: button.cn(
2562
+ "w-0.5 flex-1 min-h-[2rem] mt-1",
2563
+ connectorClasses(step < currentStep)
2564
+ )
2565
+ }
2566
+ )
2567
+ ] }),
2568
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("pb-6", isLast && "pb-0"), children: [
2569
+ /* @__PURE__ */ jsxRuntime.jsx(
2570
+ "div",
2571
+ {
2572
+ className: button.cn(
2573
+ "transition-colors",
2574
+ isActive || error ? "text-foreground" : "text-muted-foreground"
2575
+ ),
2576
+ children: label
2577
+ }
2578
+ ),
2579
+ description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
2580
+ ] })
2581
+ ]
2582
+ }
2583
+ );
2584
+ }
2585
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2586
+ "div",
2587
+ {
2588
+ ref,
2589
+ className: button.cn("flex flex-1 flex-col items-center", className),
2590
+ role: "listitem",
2591
+ "aria-current": isActive ? "step" : void 0,
2592
+ "aria-label": `Etapa ${step}: ${label}${isCompleted ? ", concluída" : isActive ? ", atual" : ""}`,
2593
+ ...props,
2594
+ children: [
2595
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-start", children: [
2596
+ step > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step <= currentStep)) }),
2597
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: step }) }),
2598
+ step < totalSteps && /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step < currentStep)) })
2599
+ ] }),
2600
+ /* @__PURE__ */ jsxRuntime.jsxs(
2601
+ "div",
2602
+ {
2603
+ className: button.cn(
2604
+ "mt-2 px-1",
2605
+ isFirst && "text-left self-start",
2606
+ isLast && "text-right self-end",
2607
+ !isFirst && !isLast && "text-center w-full"
2608
+ ),
2609
+ children: [
2610
+ /* @__PURE__ */ jsxRuntime.jsx(
2611
+ "div",
2612
+ {
2613
+ className: button.cn(
2614
+ "transition-colors",
2615
+ isActive || error ? "text-foreground" : "text-muted-foreground"
2616
+ ),
2617
+ children: label
2618
+ }
2619
+ ),
2620
+ description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
2621
+ ]
2622
+ }
2623
+ )
2624
+ ]
2625
+ }
2626
+ );
2627
+ }
2628
+ );
2629
+ Step.displayName = "Step";
2630
+
2631
+ function useStepper({
2632
+ totalSteps,
2633
+ initialStep = 1,
2634
+ step: controlledStep,
2635
+ onStepChange,
2636
+ onBeforeNext
2637
+ }) {
2638
+ const [internalStep, setInternalStep] = React.useState(
2639
+ () => Math.min(Math.max(1, initialStep), totalSteps)
2640
+ );
2641
+ const isControlled = controlledStep !== void 0;
2642
+ const currentStep = isControlled ? controlledStep : internalStep;
2643
+ const setStep = React.useCallback(
2644
+ (s) => {
2645
+ const clamped = Math.min(Math.max(1, s), totalSteps);
2646
+ if (!isControlled) setInternalStep(clamped);
2647
+ onStepChange?.(clamped);
2648
+ },
2649
+ [isControlled, onStepChange, totalSteps]
2650
+ );
2651
+ const isFirstStep = currentStep === 1;
2652
+ const isLastStep = currentStep === totalSteps;
2653
+ const canGoPrev = currentStep > 1;
2654
+ const canGoNext = currentStep < totalSteps;
2655
+ const next = React.useCallback(async () => {
2656
+ if (!canGoNext) return;
2657
+ if (onBeforeNext) {
2658
+ const allowed = await onBeforeNext(currentStep);
2659
+ if (!allowed) return;
2660
+ }
2661
+ setStep(currentStep + 1);
2662
+ }, [canGoNext, currentStep, onBeforeNext, setStep]);
2663
+ const prev = React.useCallback(() => {
2664
+ if (!canGoPrev) return;
2665
+ setStep(currentStep - 1);
2666
+ }, [canGoPrev, currentStep, setStep]);
2667
+ const goTo = React.useCallback((s) => setStep(s), [setStep]);
2668
+ const reset = React.useCallback(() => setStep(1), [setStep]);
2669
+ return {
2670
+ currentStep,
2671
+ totalSteps,
2672
+ isFirstStep,
2673
+ isLastStep,
2674
+ canGoPrev,
2675
+ canGoNext,
2676
+ next,
2677
+ prev,
2678
+ goTo,
2679
+ reset
2680
+ };
2681
+ }
2682
+
2683
+ function useFileUpload({
2684
+ maxFiles = 1,
2685
+ maxSize = 5 * 1024 * 1024,
2686
+ onFilesChange,
2687
+ onError,
2688
+ disabled = false
2689
+ } = {}) {
2690
+ const [files, setFiles] = React.useState([]);
2691
+ const [dragActive, setDragActive] = React.useState(false);
2692
+ const [errorMessage, setErrorMessage] = React.useState(null);
2693
+ const inputRef = React.useRef(null);
2694
+ const handleFiles = React.useCallback(
2695
+ (newFiles) => {
2696
+ if (!newFiles) return;
2697
+ setErrorMessage(null);
2698
+ const filesArray = Array.from(newFiles);
2699
+ const oversized = filesArray.filter((f) => f.size > maxSize);
2700
+ const validFiles = filesArray.filter((f) => f.size <= maxSize);
2701
+ if (oversized.length > 0) {
2702
+ const limitMB = (maxSize / 1024 / 1024).toFixed(0);
2703
+ setErrorMessage(
2704
+ `${oversized.length} file(s) exceed the ${limitMB}MB limit and were not added.`
2705
+ );
2706
+ onError?.(oversized, "size");
2707
+ }
2708
+ const merged = maxFiles === 1 ? validFiles.slice(0, 1) : [...files, ...validFiles].slice(0, maxFiles);
2709
+ const countRejected = maxFiles === 1 ? validFiles.slice(1) : [...files, ...validFiles].slice(maxFiles);
2710
+ if (countRejected.length > 0) {
2711
+ setErrorMessage(
2712
+ `Only ${maxFiles} file(s) allowed. ${countRejected.length} file(s) were not added.`
2713
+ );
2714
+ onError?.(countRejected, "count");
2715
+ }
2716
+ setFiles(merged);
2717
+ onFilesChange?.(merged);
2718
+ },
2719
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2720
+ [files, maxFiles, maxSize, onError, onFilesChange]
2721
+ );
2722
+ const handleDrag = React.useCallback((e) => {
2723
+ e.preventDefault();
2724
+ e.stopPropagation();
2725
+ if (e.type === "dragenter" || e.type === "dragover") {
2726
+ setDragActive(true);
2727
+ } else if (e.type === "dragleave") {
2728
+ setDragActive(false);
2729
+ }
2730
+ }, []);
2731
+ const handleDrop = React.useCallback(
2732
+ (e) => {
2733
+ e.preventDefault();
2734
+ e.stopPropagation();
2735
+ setDragActive(false);
2736
+ if (disabled) return;
2737
+ handleFiles(e.dataTransfer.files);
2738
+ },
2739
+ [disabled, handleFiles]
2740
+ );
2741
+ const handleChange = React.useCallback(
2742
+ (e) => {
2743
+ e.preventDefault();
2744
+ if (disabled) return;
2745
+ handleFiles(e.target.files);
2746
+ },
2747
+ [disabled, handleFiles]
2748
+ );
2749
+ const removeFile = React.useCallback(
2750
+ (index) => {
2751
+ setFiles((prev) => {
2752
+ const updated = prev.filter((_, i) => i !== index);
2753
+ onFilesChange?.(updated);
2754
+ if (updated.length === 0) setErrorMessage(null);
2755
+ return updated;
2756
+ });
2757
+ },
2758
+ [onFilesChange]
2759
+ );
2760
+ const openFileDialog = React.useCallback(() => {
2761
+ if (!disabled) {
2762
+ setErrorMessage(null);
2763
+ inputRef.current?.click();
2764
+ }
2765
+ }, [disabled]);
2766
+ return {
2767
+ files,
2768
+ dragActive,
2769
+ errorMessage,
2770
+ inputRef,
2771
+ handleFiles,
2772
+ handleDrag,
2773
+ handleDrop,
2774
+ handleChange,
2775
+ removeFile,
2776
+ openFileDialog
2777
+ };
2778
+ }
2779
+
2780
+ const FileUpload = React__namespace.forwardRef(
2781
+ ({
2782
+ className,
2783
+ onFilesChange,
2784
+ maxFiles = 1,
2785
+ maxSize = 5 * 1024 * 1024,
2786
+ // 5MB default
2787
+ showPreview = true,
2788
+ onError,
2789
+ accept,
2790
+ disabled,
2791
+ ...props
2792
+ }, ref) => {
2793
+ const {
2794
+ files,
2795
+ dragActive,
2796
+ errorMessage,
2797
+ inputRef,
2798
+ handleDrag,
2799
+ handleDrop,
2800
+ handleChange,
2801
+ removeFile,
2802
+ openFileDialog
2803
+ } = useFileUpload({ maxFiles, maxSize, onFilesChange, onError, disabled });
2804
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: button.cn("w-full", className), children: [
2805
+ /* @__PURE__ */ jsxRuntime.jsxs(
2806
+ "div",
2807
+ {
2808
+ onDragEnter: handleDrag,
2809
+ onDragLeave: handleDrag,
2810
+ onDragOver: handleDrag,
2811
+ onDrop: handleDrop,
2812
+ onClick: openFileDialog,
2813
+ className: button.cn(
2814
+ "relative flex cursor-pointer flex-col items-center justify-center rounded-[var(--radius)] border-2 border-dashed border-border bg-background p-8 transition-colors hover:bg-muted/50",
2815
+ dragActive && "border-primary bg-primary/5",
2816
+ errorMessage && "border-destructive/50",
2817
+ disabled && "cursor-not-allowed opacity-50"
2818
+ ),
2819
+ children: [
2820
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "mb-4 h-10 w-10 text-muted-foreground" }),
2821
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-2 text-foreground", children: [
2822
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "Click to upload" }),
2823
+ " or drag and drop"
2824
+ ] }),
2825
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
2826
+ maxFiles > 1 ? `Up to ${maxFiles} files` : "1 file",
2827
+ " • Max",
2828
+ " ",
2829
+ (maxSize / 1024 / 1024).toFixed(0),
2830
+ "MB"
2831
+ ] }),
2832
+ /* @__PURE__ */ jsxRuntime.jsx(
2833
+ "input",
2834
+ {
2835
+ ...props,
2836
+ ref: inputRef,
2837
+ type: "file",
2838
+ className: "hidden",
2839
+ onChange: handleChange,
2840
+ multiple: maxFiles > 1,
2841
+ accept,
2842
+ disabled
2843
+ }
2844
+ )
2845
+ ]
2846
+ }
2847
+ ),
2848
+ errorMessage && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex items-center gap-2 rounded-[var(--radius)] border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive", children: [
2849
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-4 w-4 shrink-0" }),
2850
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: errorMessage })
2851
+ ] }),
2852
+ showPreview && files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 space-y-2", children: files.map((file, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2853
+ "div",
2854
+ {
2855
+ className: "flex items-center justify-between rounded-[var(--radius)] border border-border bg-card p-3",
2856
+ children: [
2857
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
2858
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileIcon, { className: "h-5 w-5 text-muted-foreground" }),
2859
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2860
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground", children: file.name }),
2861
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
2862
+ (file.size / 1024).toFixed(2),
2863
+ " KB"
2864
+ ] })
2865
+ ] })
2866
+ ] }),
2867
+ /* @__PURE__ */ jsxRuntime.jsx(
2868
+ button.Button,
2869
+ {
2870
+ type: "button",
2871
+ variant: "ghost",
2872
+ size: "sm",
2873
+ onClick: (e) => {
2874
+ e.stopPropagation();
2875
+ removeFile(index);
2876
+ },
2877
+ disabled,
2878
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
2879
+ }
2880
+ )
2881
+ ]
2882
+ },
2883
+ index
2884
+ )) })
2885
+ ] });
2886
+ }
2887
+ );
2888
+ FileUpload.displayName = "FileUpload";
2889
+
2890
+ const Rating = React__namespace.forwardRef(
2891
+ ({
2892
+ className,
2893
+ value = 0,
2894
+ onChange,
2895
+ max = 5,
2896
+ readonly = false,
2897
+ disabled = false,
2898
+ size = "md",
2899
+ showValue = false,
2900
+ allowHalf = false,
2901
+ getAriaLabel,
2902
+ ...props
2903
+ }, ref) => {
2904
+ const [hoverValue, setHoverValue] = React__namespace.useState(null);
2905
+ const isInteractive = !readonly && !disabled;
2906
+ const sizeStyles = {
2907
+ sm: "h-4 w-4",
2908
+ md: "h-5 w-5",
2909
+ lg: "h-6 w-6"
2910
+ };
2911
+ const handleClick = (rating) => {
2912
+ if (isInteractive) onChange?.(rating);
2913
+ };
2914
+ const handleMouseMove = (e, rating) => {
2915
+ if (!isInteractive) return;
2916
+ if (allowHalf) {
2917
+ const rect = e.currentTarget.getBoundingClientRect();
2918
+ setHoverValue(e.clientX - rect.left < rect.width / 2 ? rating - 0.5 : rating);
2919
+ } else {
2920
+ setHoverValue(rating);
2921
+ }
2922
+ };
2923
+ const handleMouseLeave = () => {
2924
+ if (isInteractive) setHoverValue(null);
2925
+ };
2926
+ const handleClickWithHalf = (e, rating) => {
2927
+ if (!isInteractive) return;
2928
+ if (allowHalf) {
2929
+ const rect = e.currentTarget.getBoundingClientRect();
2930
+ const half = e.clientX - rect.left < rect.width / 2 ? rating - 0.5 : rating;
2931
+ onChange?.(half);
2932
+ } else {
2933
+ handleClick(rating);
2934
+ }
2935
+ };
2936
+ const displayValue = hoverValue ?? value;
2937
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2938
+ "div",
2939
+ {
2940
+ ref,
2941
+ className: button.cn("flex items-center gap-1", disabled && "opacity-50", className),
2942
+ ...props,
2943
+ children: [
2944
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5", role: "group", "aria-label": "Rating", children: Array.from({ length: max }, (_, index) => {
2945
+ const rating = index + 1;
2946
+ const isFull = rating <= displayValue;
2947
+ const isHalf = allowHalf && !isFull && rating - 0.5 <= displayValue;
2948
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2949
+ "button",
2950
+ {
2951
+ type: "button",
2952
+ onClick: (e) => handleClickWithHalf(e, rating),
2953
+ onMouseMove: (e) => handleMouseMove(e, rating),
2954
+ onMouseLeave: handleMouseLeave,
2955
+ disabled: readonly || disabled,
2956
+ "aria-label": getAriaLabel ? getAriaLabel(rating, max) : `${rating} / ${max}`,
2957
+ className: button.cn(
2958
+ "relative transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2959
+ isInteractive && "cursor-pointer hover:scale-110",
2960
+ !isInteractive && "cursor-default"
2961
+ ),
2962
+ children: [
2963
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Star, { className: button.cn(sizeStyles[size], "fill-none text-muted-foreground") }),
2964
+ (isFull || isHalf) && /* @__PURE__ */ jsxRuntime.jsx(
2965
+ "span",
2966
+ {
2967
+ className: button.cn("absolute inset-0 overflow-hidden", isHalf ? "w-1/2" : "w-full"),
2968
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Star, { className: button.cn(sizeStyles[size], "fill-warning text-warning") })
2969
+ }
2970
+ )
2971
+ ]
2972
+ },
2973
+ index
2974
+ );
2975
+ }) }),
2976
+ showValue && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-sm text-muted-foreground", children: value % 1 === 0 ? value.toFixed(0) : value.toFixed(1) })
2977
+ ]
2978
+ }
2979
+ );
2980
+ }
2981
+ );
2982
+ Rating.displayName = "Rating";
2983
+
2984
+ const Search = React__namespace.forwardRef(
2985
+ ({
2986
+ className,
2987
+ containerClassName,
2988
+ onSearch,
2989
+ onClear,
2990
+ onChange,
2991
+ size = "md",
2992
+ searchLabel = "Search",
2993
+ clearLabel = "Clear search",
2994
+ value: controlledValue,
2995
+ defaultValue,
2996
+ ...props
2997
+ }, ref) => {
2998
+ const isControlled = controlledValue !== void 0;
2999
+ const [internalValue, setInternalValue] = React__namespace.useState(
3000
+ isControlled ? "" : defaultValue ?? ""
3001
+ );
3002
+ const displayValue = isControlled ? controlledValue : internalValue;
3003
+ const sizeClasses = {
3004
+ sm: "h-8 px-8 py-1 text-sm",
3005
+ md: "h-10 px-10 py-2 text-base",
3006
+ lg: "h-12 px-12 py-3 text-base"
3007
+ };
3008
+ const iconSizeClasses = {
3009
+ sm: "left-2 h-3.5 w-3.5",
3010
+ md: "left-3 h-4 w-4",
3011
+ lg: "left-4 h-5 w-5"
3012
+ };
3013
+ const clearSizeClasses = {
3014
+ sm: "right-2",
3015
+ md: "right-3",
3016
+ lg: "right-4"
3017
+ };
3018
+ const handleChange = (e) => {
3019
+ const newValue = e.target.value;
3020
+ if (!isControlled) setInternalValue(newValue);
3021
+ onChange?.(e);
3022
+ onSearch?.(newValue);
3023
+ };
3024
+ const handleClear = () => {
3025
+ if (!isControlled) setInternalValue("");
3026
+ onClear?.();
3027
+ onSearch?.("");
3028
+ };
3029
+ const handleKeyDown = (e) => {
3030
+ if (e.key === "Escape") {
3031
+ handleClear();
3032
+ }
3033
+ props.onKeyDown?.(e);
3034
+ };
3035
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("relative w-full", containerClassName), children: [
3036
+ /* @__PURE__ */ jsxRuntime.jsx(
3037
+ lucideReact.Search,
3038
+ {
3039
+ "aria-hidden": "true",
3040
+ className: button.cn(
3041
+ "absolute top-1/2 -translate-y-1/2 text-muted-foreground",
3042
+ iconSizeClasses[size]
3043
+ )
3044
+ }
3045
+ ),
3046
+ /* @__PURE__ */ jsxRuntime.jsx(
3047
+ "input",
3048
+ {
3049
+ ref,
3050
+ type: "text",
3051
+ value: displayValue,
3052
+ onChange: handleChange,
3053
+ onKeyDown: handleKeyDown,
3054
+ className: button.cn(
3055
+ "flex w-full rounded-[var(--radius)] border border-border bg-background text-foreground transition-colors outline-none",
3056
+ "placeholder:text-muted-foreground",
3057
+ "focus:ring-2 focus:ring-primary focus:border-transparent",
3058
+ "disabled:cursor-not-allowed disabled:opacity-50",
3059
+ sizeClasses[size],
3060
+ className
3061
+ ),
3062
+ "aria-label": props.placeholder || searchLabel,
3063
+ ...props
3064
+ }
3065
+ ),
3066
+ displayValue && /* @__PURE__ */ jsxRuntime.jsx(
3067
+ "button",
3068
+ {
3069
+ type: "button",
3070
+ onClick: handleClear,
3071
+ "aria-label": clearLabel,
3072
+ className: button.cn(
3073
+ "absolute top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
3074
+ clearSizeClasses[size]
3075
+ ),
3076
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
3077
+ }
3078
+ )
3079
+ ] });
3080
+ }
3081
+ );
3082
+ Search.displayName = "Search";
3083
+
3084
+ const __vite_import_meta_env__ = {"BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_GEMINI_API_KEY": "AIzaSyBnoWKe4LjQzlIklON_dVXMXNUl2gvfH6U", "VITE_GOOGLE_MAPS_API_KEY": "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo"};
3085
+ const RouteMapContent = React.forwardRef(
3086
+ ({ apiKey, ...props }, ref) => {
3087
+ const { isLoaded, loadError, load } = googleMapsLoader.useGoogleMapsLoader();
3088
+ const {
3089
+ origin,
3090
+ destination,
3091
+ waypoints = [],
3092
+ travelMode = "DRIVING",
3093
+ height = "450px",
3094
+ mapContainerClassName,
3095
+ disableDefaultUI = false,
3096
+ zoomControl = true,
3097
+ streetViewControl = false,
3098
+ mapTypeControl = false,
3099
+ fullscreenControl = true,
3100
+ onRouteCalculated,
3101
+ className,
3102
+ ...divProps
3103
+ } = props;
3104
+ const mapRef = React.useRef(null);
3105
+ const gmpMapRef = React.useRef(null);
3106
+ const directionsRendererRef = React.useRef(null);
3107
+ React.useRef(false);
3108
+ const isCalculatingRef = React.useRef(false);
3109
+ React.useEffect(() => {
3110
+ if (!isLoaded && apiKey && !loadError && load) {
3111
+ load(apiKey).catch(console.error);
3112
+ }
3113
+ }, [isLoaded, apiKey, loadError, load]);
3114
+ React.useEffect(() => {
3115
+ if (!isLoaded || !gmpMapRef.current) return;
3116
+ const setupMap = (map) => {
3117
+ mapRef.current = map;
3118
+ const computedStyle = getComputedStyle(document.documentElement);
3119
+ const primaryColor = computedStyle.getPropertyValue("--primary").trim() || "#4F46E5";
3120
+ if (!directionsRendererRef.current) {
3121
+ directionsRendererRef.current = new google.maps.DirectionsRenderer({
3122
+ map,
3123
+ suppressMarkers: false,
3124
+ polylineOptions: {
3125
+ strokeColor: primaryColor,
3126
+ strokeWeight: 5,
3127
+ strokeOpacity: 0.8
3128
+ }
3129
+ });
3130
+ } else {
3131
+ directionsRendererRef.current.setMap(map);
3132
+ }
3133
+ };
3134
+ const gmpMap = gmpMapRef.current;
3135
+ if (gmpMap.innerMap) {
3136
+ setupMap(gmpMap.innerMap);
3137
+ } else {
3138
+ const interval = setInterval(() => {
3139
+ if (gmpMap.innerMap) {
3140
+ setupMap(gmpMap.innerMap);
3141
+ clearInterval(interval);
3142
+ }
3143
+ }, 100);
3144
+ return () => clearInterval(interval);
3145
+ }
3146
+ return () => {
3147
+ if (directionsRendererRef.current) {
3148
+ directionsRendererRef.current.setMap(null);
3149
+ }
3150
+ mapRef.current = null;
3151
+ };
3152
+ }, [isLoaded]);
3153
+ React.useEffect(() => {
3154
+ if (gmpMapRef.current && origin) {
3155
+ gmpMapRef.current.center = origin;
3156
+ }
3157
+ }, [origin.lat, origin.lng]);
3158
+ React.useEffect(() => {
3159
+ if (gmpMapRef.current) {
3160
+ gmpMapRef.current.zoom = 13;
3161
+ }
3162
+ }, []);
3163
+ React.useEffect(() => {
3164
+ const map = mapRef.current;
3165
+ const renderer = directionsRendererRef.current;
3166
+ if (!map || !renderer || !isLoaded || isCalculatingRef.current) return;
3167
+ if (!origin || !destination) return;
3168
+ isCalculatingRef.current = true;
3169
+ const directionsService = new google.maps.DirectionsService();
3170
+ const request = {
3171
+ origin,
3172
+ destination,
3173
+ waypoints: waypoints.map((wp) => ({
3174
+ location: wp,
3175
+ stopover: true
3176
+ })),
3177
+ travelMode: google.maps.TravelMode[travelMode]
3178
+ };
3179
+ directionsService.route(request, (result, status) => {
3180
+ isCalculatingRef.current = false;
3181
+ if (status === "OK" && result) {
3182
+ renderer.setDirections(result);
3183
+ const route = result.routes[0];
3184
+ if (route?.legs?.length > 0 && onRouteCalculated) {
3185
+ let totalDistance = 0;
3186
+ let totalDuration = 0;
3187
+ route.legs.forEach((leg) => {
3188
+ if (leg.distance) totalDistance += leg.distance.value;
3189
+ if (leg.duration) totalDuration += leg.duration.value;
3190
+ });
3191
+ const distanceKm = (totalDistance / 1e3).toFixed(1);
3192
+ const distanceText = `${distanceKm} km`;
3193
+ const hours = Math.floor(totalDuration / 3600);
3194
+ const minutes = Math.floor(totalDuration % 3600 / 60);
3195
+ const durationText = hours > 0 ? `${hours}h ${minutes}min` : `${minutes} min`;
3196
+ onRouteCalculated(distanceText, durationText);
3197
+ }
3198
+ }
3199
+ });
3200
+ }, [
3201
+ isLoaded,
3202
+ origin.lat,
3203
+ origin.lng,
3204
+ destination.lat,
3205
+ destination.lng,
3206
+ travelMode,
3207
+ mapRef.current
3208
+ ]);
3209
+ if (loadError) {
3210
+ return /* @__PURE__ */ jsxRuntime.jsx(
3211
+ "div",
3212
+ {
3213
+ ref,
3214
+ className: button.cn(
3215
+ "relative rounded-[var(--radius-card)] border border-destructive/50 overflow-hidden bg-destructive/5",
3216
+ className
3217
+ ),
3218
+ style: { height },
3219
+ ...divProps,
3220
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-2 p-6", children: [
3221
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive", children: /* @__PURE__ */ jsxRuntime.jsx(
3222
+ "svg",
3223
+ {
3224
+ className: "w-12 h-12 mx-auto",
3225
+ fill: "none",
3226
+ stroke: "currentColor",
3227
+ viewBox: "0 0 24 24",
3228
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3229
+ "path",
3230
+ {
3231
+ strokeLinecap: "round",
3232
+ strokeLinejoin: "round",
3233
+ strokeWidth: 2,
3234
+ d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
3235
+ }
3236
+ )
3237
+ }
3238
+ ) }),
3239
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: "Failed to load Google Maps" }),
3240
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Check API key in Settings" })
3241
+ ] }) })
3242
+ }
3243
+ );
3244
+ }
3245
+ if (!isLoaded) {
3246
+ return /* @__PURE__ */ jsxRuntime.jsx(
3247
+ "div",
3248
+ {
3249
+ ref,
3250
+ className: button.cn(
3251
+ "relative rounded-[var(--radius-card)] border border-border overflow-hidden bg-muted animate-pulse",
3252
+ className
3253
+ ),
3254
+ style: { height },
3255
+ ...divProps
3256
+ }
3257
+ );
3258
+ }
3259
+ return /* @__PURE__ */ jsxRuntime.jsx(
3260
+ "div",
3261
+ {
3262
+ ref,
3263
+ className: button.cn(
3264
+ "relative rounded-[var(--radius-card)] border border-border overflow-hidden",
3265
+ className
3266
+ ),
3267
+ style: { height },
3268
+ ...divProps,
3269
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3270
+ "gmp-map",
3271
+ {
3272
+ ref: gmpMapRef,
3273
+ style: { height: "100%", width: "100%", display: "block" },
3274
+ "map-id": props.mapId || "xertica-route-map"
3275
+ }
3276
+ )
3277
+ }
3278
+ );
3279
+ }
3280
+ );
3281
+ RouteMapContent.displayName = "RouteMapContent";
3282
+ const RouteMap = React.forwardRef((props, ref) => {
3283
+ const { isLoaded, loadError } = googleMapsLoader.useGoogleMapsLoader();
3284
+ const effectiveApiKey = props.apiKey || typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('AssistantChart-BW9JK6jw.cjs', document.baseURI).href)) }) !== "undefined" && __vite_import_meta_env__ && "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" || "";
3285
+ const isValidKey = effectiveApiKey && effectiveApiKey !== "YOUR_GOOGLE_MAPS_API_KEY_HERE" && effectiveApiKey.startsWith("AIza");
3286
+ if (isLoaded || isValidKey || loadError) {
3287
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
3288
+ }
3289
+ const isScriptInjected = typeof document !== "undefined" && !!document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]');
3290
+ if (isScriptInjected) {
3291
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
3292
+ }
3293
+ const {
3294
+ origin,
3295
+ destination,
3296
+ waypoints,
3297
+ travelMode,
3298
+ height,
3299
+ apiKey,
3300
+ mapContainerClassName,
3301
+ disableDefaultUI,
3302
+ zoomControl,
3303
+ streetViewControl,
3304
+ mapTypeControl,
3305
+ fullscreenControl,
3306
+ onRouteCalculated,
3307
+ ...divProps
3308
+ } = props;
3309
+ return /* @__PURE__ */ jsxRuntime.jsx(
3310
+ "div",
3311
+ {
3312
+ ref,
3313
+ className: button.cn(
3314
+ "relative rounded-[var(--radius-card)] border border-border overflow-hidden bg-muted",
3315
+ props.className
3316
+ ),
3317
+ style: { height: props.height || "450px" },
3318
+ ...divProps,
3319
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gradient-to-br from-muted/50 to-muted", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-3 p-6", children: [
3320
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-16 h-16 mx-auto bg-primary/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
3321
+ "svg",
3322
+ {
3323
+ className: "w-8 h-8 text-primary",
3324
+ fill: "none",
3325
+ stroke: "currentColor",
3326
+ viewBox: "0 0 24 24",
3327
+ children: [
3328
+ /* @__PURE__ */ jsxRuntime.jsx(
3329
+ "path",
3330
+ {
3331
+ strokeLinecap: "round",
3332
+ strokeLinejoin: "round",
3333
+ strokeWidth: 2,
3334
+ d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
3335
+ }
3336
+ ),
3337
+ /* @__PURE__ */ jsxRuntime.jsx(
3338
+ "path",
3339
+ {
3340
+ strokeLinecap: "round",
3341
+ strokeLinejoin: "round",
3342
+ strokeWidth: 2,
3343
+ d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
3344
+ }
3345
+ )
3346
+ ]
3347
+ }
3348
+ ) }),
3349
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Configure Google Maps API Key in Settings" })
3350
+ ] }) })
3351
+ }
3352
+ );
3353
+ });
3354
+ RouteMap.displayName = "RouteMap";
3355
+
3356
+ const SimpleMap = React.forwardRef(
3357
+ ({
3358
+ center,
3359
+ address,
3360
+ markerTitle,
3361
+ markerInfo,
3362
+ showMarker = true,
3363
+ zoom = 15,
3364
+ height = "350px",
3365
+ ...props
3366
+ }, ref) => {
3367
+ const markers = showMarker && center ? [
3368
+ {
3369
+ position: center,
3370
+ title: markerTitle || address || "Location",
3371
+ info: markerInfo || address
3372
+ }
3373
+ ] : [];
3374
+ return /* @__PURE__ */ jsxRuntime.jsx(alertDialog.Map, { ref, center, zoom, height, markers, ...props });
3375
+ }
3376
+ );
3377
+ SimpleMap.displayName = "SimpleMap";
3378
+
3379
+ function AssistantChart({
3380
+ data,
3381
+ config,
3382
+ categoryKey = "month",
3383
+ bars,
3384
+ xAxisFormatter,
3385
+ className
3386
+ }) {
3387
+ const resolvedBars = bars ?? Object.keys(config).map((key) => ({ dataKey: key }));
3388
+ const formatTick = xAxisFormatter ?? ((value) => value.slice(0, 3));
3389
+ return /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartContainer, { config, className: button.cn("min-h-[200px] w-full", className), children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.BarChart, { accessibilityLayer: true, data, children: [
3390
+ /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.CartesianGrid, { vertical: false }),
3391
+ /* @__PURE__ */ jsxRuntime.jsx(
3392
+ RechartsPrimitive.XAxis,
3393
+ {
3394
+ dataKey: categoryKey,
3395
+ tickLine: false,
3396
+ tickMargin: 10,
3397
+ axisLine: false,
3398
+ tickFormatter: formatTick
3399
+ }
3400
+ ),
3401
+ /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartTooltip, { cursor: false, content: /* @__PURE__ */ jsxRuntime.jsx(richTextEditor.ChartTooltipContent, { indicator: "dashed" }) }),
3402
+ resolvedBars.map((bar) => /* @__PURE__ */ jsxRuntime.jsx(
3403
+ RechartsPrimitive.Bar,
3404
+ {
3405
+ dataKey: bar.dataKey,
3406
+ fill: bar.fill ?? `var(--color-${bar.dataKey})`,
3407
+ radius: bar.radius ?? 4
3408
+ },
3409
+ bar.dataKey
3410
+ ))
3411
+ ] }) });
3412
+ }
3413
+
3414
+ exports.Accordion = Accordion;
3415
+ exports.AccordionContent = AccordionContent;
3416
+ exports.AccordionItem = AccordionItem;
3417
+ exports.AccordionTrigger = AccordionTrigger;
3418
+ exports.AspectRatio = AspectRatio;
3419
+ exports.AssistantChart = AssistantChart;
3420
+ exports.Calendar = Calendar;
3421
+ exports.CalendarDayButton = CalendarDayButton;
3422
+ exports.Carousel = Carousel;
3423
+ exports.CarouselContent = CarouselContent;
3424
+ exports.CarouselItem = CarouselItem;
3425
+ exports.CarouselNext = CarouselNext;
3426
+ exports.CarouselPrevious = CarouselPrevious;
3427
+ exports.Collapsible = Collapsible;
3428
+ exports.CollapsibleContent = CollapsibleContent;
3429
+ exports.CollapsibleTrigger = CollapsibleTrigger;
3430
+ exports.Command = Command;
3431
+ exports.CommandDialog = CommandDialog;
3432
+ exports.CommandEmpty = CommandEmpty;
3433
+ exports.CommandGroup = CommandGroup;
3434
+ exports.CommandInput = CommandInput;
3435
+ exports.CommandItem = CommandItem;
3436
+ exports.CommandList = CommandList;
3437
+ exports.CommandSeparator = CommandSeparator;
3438
+ exports.CommandShortcut = CommandShortcut;
3439
+ exports.ContextMenu = ContextMenu;
3440
+ exports.ContextMenuCheckboxItem = ContextMenuCheckboxItem;
3441
+ exports.ContextMenuContent = ContextMenuContent;
3442
+ exports.ContextMenuGroup = ContextMenuGroup;
3443
+ exports.ContextMenuItem = ContextMenuItem;
3444
+ exports.ContextMenuLabel = ContextMenuLabel;
3445
+ exports.ContextMenuPortal = ContextMenuPortal;
3446
+ exports.ContextMenuRadioGroup = ContextMenuRadioGroup;
3447
+ exports.ContextMenuRadioItem = ContextMenuRadioItem;
3448
+ exports.ContextMenuSeparator = ContextMenuSeparator;
3449
+ exports.ContextMenuShortcut = ContextMenuShortcut;
3450
+ exports.ContextMenuSub = ContextMenuSub;
3451
+ exports.ContextMenuSubContent = ContextMenuSubContent;
3452
+ exports.ContextMenuSubTrigger = ContextMenuSubTrigger;
3453
+ exports.ContextMenuTrigger = ContextMenuTrigger;
3454
+ exports.Drawer = Drawer;
3455
+ exports.DrawerClose = DrawerClose;
3456
+ exports.DrawerContent = DrawerContent;
3457
+ exports.DrawerDescription = DrawerDescription;
3458
+ exports.DrawerFooter = DrawerFooter;
3459
+ exports.DrawerHandle = DrawerHandle;
3460
+ exports.DrawerHeader = DrawerHeader;
3461
+ exports.DrawerOverlay = DrawerOverlay;
3462
+ exports.DrawerPortal = DrawerPortal;
3463
+ exports.DrawerTitle = DrawerTitle;
3464
+ exports.DrawerTrigger = DrawerTrigger;
3465
+ exports.FileUpload = FileUpload;
3466
+ exports.Form = Form;
3467
+ exports.FormControl = FormControl;
3468
+ exports.FormDescription = FormDescription;
3469
+ exports.FormField = FormField;
3470
+ exports.FormItem = FormItem;
3471
+ exports.FormLabel = FormLabel;
3472
+ exports.FormMessage = FormMessage;
3473
+ exports.HoverCard = HoverCard;
3474
+ exports.HoverCardContent = HoverCardContent;
3475
+ exports.HoverCardTrigger = HoverCardTrigger;
3476
+ exports.InputOTP = InputOTP;
3477
+ exports.InputOTPGroup = InputOTPGroup;
3478
+ exports.InputOTPSeparator = InputOTPSeparator;
3479
+ exports.InputOTPSlot = InputOTPSlot;
3480
+ exports.Menubar = Menubar;
3481
+ exports.MenubarCheckboxItem = MenubarCheckboxItem;
3482
+ exports.MenubarContent = MenubarContent;
3483
+ exports.MenubarGroup = MenubarGroup;
3484
+ exports.MenubarItem = MenubarItem;
3485
+ exports.MenubarLabel = MenubarLabel;
3486
+ exports.MenubarMenu = MenubarMenu;
3487
+ exports.MenubarPortal = MenubarPortal;
3488
+ exports.MenubarRadioGroup = MenubarRadioGroup;
3489
+ exports.MenubarRadioItem = MenubarRadioItem;
3490
+ exports.MenubarSeparator = MenubarSeparator;
3491
+ exports.MenubarShortcut = MenubarShortcut;
3492
+ exports.MenubarSub = MenubarSub;
3493
+ exports.MenubarSubContent = MenubarSubContent;
3494
+ exports.MenubarSubTrigger = MenubarSubTrigger;
3495
+ exports.MenubarTrigger = MenubarTrigger;
3496
+ exports.NavigationMenu = NavigationMenu;
3497
+ exports.NavigationMenuContent = NavigationMenuContent;
3498
+ exports.NavigationMenuIndicator = NavigationMenuIndicator;
3499
+ exports.NavigationMenuItem = NavigationMenuItem;
3500
+ exports.NavigationMenuLink = NavigationMenuLink;
3501
+ exports.NavigationMenuList = NavigationMenuList;
3502
+ exports.NavigationMenuTrigger = NavigationMenuTrigger;
3503
+ exports.NavigationMenuViewport = NavigationMenuViewport;
3504
+ exports.NotificationBadge = NotificationBadge;
3505
+ exports.Pagination = Pagination;
3506
+ exports.PaginationContent = PaginationContent;
3507
+ exports.PaginationEllipsis = PaginationEllipsis;
3508
+ exports.PaginationItem = PaginationItem;
3509
+ exports.PaginationLink = PaginationLink;
3510
+ exports.PaginationNext = PaginationNext;
3511
+ exports.PaginationPrevious = PaginationPrevious;
3512
+ exports.Rating = Rating;
3513
+ exports.ResizableHandle = ResizableHandle;
3514
+ exports.ResizablePanel = ResizablePanel;
3515
+ exports.ResizablePanelGroup = ResizablePanelGroup;
3516
+ exports.RouteMap = RouteMap;
3517
+ exports.Search = Search;
3518
+ exports.Sheet = Sheet;
3519
+ exports.SheetBody = SheetBody;
3520
+ exports.SheetClose = SheetClose;
3521
+ exports.SheetContent = SheetContent;
3522
+ exports.SheetDescription = SheetDescription;
3523
+ exports.SheetFooter = SheetFooter;
3524
+ exports.SheetHeader = SheetHeader;
3525
+ exports.SheetPortal = SheetPortal;
3526
+ exports.SheetTitle = SheetTitle;
3527
+ exports.SheetTrigger = SheetTrigger;
3528
+ exports.SimpleMap = SimpleMap;
3529
+ exports.StatsCard = StatsCard;
3530
+ exports.StatsCardSkeleton = StatsCardSkeleton;
3531
+ exports.Step = Step;
3532
+ exports.Stepper = Stepper;
3533
+ exports.Timeline = Timeline;
3534
+ exports.TimelineContent = TimelineContent;
3535
+ exports.TimelineDescription = TimelineDescription;
3536
+ exports.TimelineDot = TimelineDot;
3537
+ exports.TimelineHeading = TimelineHeading;
3538
+ exports.TimelineItem = TimelineItem;
3539
+ exports.TimelineTime = TimelineTime;
3540
+ exports.Toggle = Toggle;
3541
+ exports.ToggleGroup = ToggleGroup;
3542
+ exports.ToggleGroupItem = ToggleGroupItem;
3543
+ exports.TreeView = TreeView;
3544
+ exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
3545
+ exports.toggleVariants = toggleVariants;
3546
+ exports.useFileUpload = useFileUpload;
3547
+ exports.useFormField = useFormField;
3548
+ exports.usePagination = usePagination;
3549
+ exports.useStepper = useStepper;
3550
+ exports.useStepperContext = useStepperContext;
3551
+ exports.useTreeView = useTreeView;