@mlw-packages/react-components 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -522,6 +522,7 @@ __export(index_exports, {
522
522
  CarouselNextBase: () => CarouselNextBase,
523
523
  CarouselPrevious: () => CarouselPrevious,
524
524
  CheckboxBase: () => CheckboxBase,
525
+ CloseAllButton: () => CloseAllButton_default,
525
526
  CollapsibleBase: () => CollapsibleBase,
526
527
  CollapsibleContentBase: () => CollapsibleContentBase,
527
528
  CollapsibleTriggerBase: () => CollapsibleTriggerBase,
@@ -562,6 +563,7 @@ __export(index_exports, {
562
563
  DialogPortalBase: () => DialogPortalBase,
563
564
  DialogTitleBase: () => DialogTitleBase,
564
565
  DialogTriggerBase: () => DialogTriggerBase,
566
+ DraggableTooltip: () => DraggableTooltip_default,
565
567
  DrawerBase: () => DrawerBase,
566
568
  DrawerCloseBase: () => DrawerCloseBase,
567
569
  DrawerContentBase: () => DrawerContentBase,
@@ -587,6 +589,7 @@ __export(index_exports, {
587
589
  DropDownMenuSubContentBase: () => DropDownMenuSubContentBase,
588
590
  DropDownMenuSubTriggerBase: () => DropDownMenuSubTriggerBase,
589
591
  DropDownMenuTriggerBase: () => DropDownMenuTriggerBase,
592
+ Highlights: () => Highlights_default,
590
593
  HoverCardBase: () => HoverCardBase,
591
594
  HoverCardContentBase: () => HoverCardContentBase,
592
595
  HoverCardTriggerBase: () => HoverCardTriggerBase,
@@ -596,6 +599,7 @@ __export(index_exports, {
596
599
  InputOTPSeparatorBase: () => InputOTPSeparatorBase,
597
600
  InputOTPSlotBase: () => InputOTPSlotBase,
598
601
  LabelBase: () => LabelBase_default,
602
+ LoadingBase: () => LoadingBase,
599
603
  ModeToggleBase: () => ModeToggleBase,
600
604
  MultiCombobox: () => MultiCombobox,
601
605
  NavigationMenuBase: () => NavigationMenuBase,
@@ -606,6 +610,7 @@ __export(index_exports, {
606
610
  NavigationMenuListBase: () => NavigationMenuListBase,
607
611
  NavigationMenuTriggerBase: () => NavigationMenuTriggerBase,
608
612
  NavigationMenuViewportBase: () => NavigationMenuViewportBase,
613
+ PeriodsDropdown: () => PeriodsDropdown_default,
609
614
  PopoverAnchorBase: () => PopoverAnchorBase,
610
615
  PopoverBase: () => PopoverBase,
611
616
  PopoverContentBase: () => PopoverContentBase,
@@ -638,6 +643,7 @@ __export(index_exports, {
638
643
  SheetPortalBase: () => SheetPortalBase,
639
644
  SheetTitleBase: () => SheetTitleBase,
640
645
  SheetTriggerBase: () => SheetTriggerBase,
646
+ ShowOnly: () => ShowOnly_default,
641
647
  SidebarBase: () => SidebarBase,
642
648
  SidebarContentBase: () => SidebarContentBase,
643
649
  SidebarFooterBase: () => SidebarFooterBase,
@@ -684,11 +690,23 @@ __export(index_exports, {
684
690
  TooltipBase: () => TooltipBase,
685
691
  TooltipContentBase: () => TooltipContentBase,
686
692
  TooltipProviderBase: () => TooltipProviderBase,
693
+ TooltipSimple: () => TooltipSimple_default,
687
694
  TooltipTriggerBase: () => TooltipTriggerBase,
695
+ TooltipWithTotal: () => TooltipWithTotal_default,
688
696
  UseSideBarBase: () => UseSideBarBase,
689
697
  badgeVariants: () => badgeVariants,
690
698
  buttonVariantsBase: () => buttonVariantsBase,
699
+ compactTick: () => compactTick,
700
+ detectDataFields: () => detectDataFields,
701
+ detectXAxis: () => detectXAxis,
702
+ formatFieldName: () => formatFieldName,
703
+ generateAdditionalColors: () => generateAdditionalColors,
704
+ niceCeil: () => niceCeil,
705
+ renderPillLabel: () => pillLabelRenderer_default,
706
+ resolveChartMargins: () => resolveChartMargins,
707
+ resolveContainerPaddingLeft: () => resolveContainerPaddingLeft,
691
708
  toast: () => toast,
709
+ useDrag: () => useDrag,
692
710
  useIsMobile: () => useIsMobile,
693
711
  useTheme: () => useTheme
694
712
  });
@@ -717,13 +735,13 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
717
735
  variant: {
718
736
  default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
719
737
  destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
720
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
738
+ outline: "bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
721
739
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
722
740
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
723
741
  link: "text-primary underline-offset-4 hover:underline"
724
742
  },
725
743
  size: {
726
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
744
+ default: " px-4 py-2 has-[>svg]:px-3",
727
745
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
728
746
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
729
747
  icon: "size-9"
@@ -769,7 +787,7 @@ var ButtonGroupBase = React.forwardRef(
769
787
  return React.cloneElement(typedChild, {
770
788
  className: cn(
771
789
  typedChild.props.className,
772
- "rounded-none border-0",
790
+ "rounded-none",
773
791
  index === 0 && orientation === "horizontal" && "rounded-l-md",
774
792
  index === 0 && orientation === "vertical" && "rounded-t-md",
775
793
  index === React.Children.count(children) - 1 && orientation === "horizontal" && "rounded-r-md",
@@ -1637,34 +1655,39 @@ var DialogOverlayBase = React8.forwardRef(({ className, testid: dataTestId = "di
1637
1655
  }
1638
1656
  ));
1639
1657
  DialogOverlayBase.displayName = DialogPrimitive.Overlay.displayName;
1640
- var DialogContentBase = React8.forwardRef(({ className, children, testid: dataTestId = "dialog-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPortalBase, { children: [
1641
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogOverlayBase, {}),
1642
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1643
- DialogPrimitive.Content,
1644
- {
1645
- ref,
1646
- className: cn(
1647
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
1648
- className
1649
- ),
1650
- "data-testid": dataTestId,
1651
- ...props,
1652
- children: [
1653
- children,
1654
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1655
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react6.XIcon, { className: "h-4 w-4" }),
1656
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Close" })
1657
- ] })
1658
- ]
1659
- }
1660
- )
1661
- ] }));
1658
+ var DialogContentBase = React8.forwardRef(
1659
+ ({ className, children, testid: dataTestId = "dialog-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPortalBase, { children: [
1660
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogOverlayBase, {}),
1661
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1662
+ DialogPrimitive.Content,
1663
+ {
1664
+ ref,
1665
+ className: cn(
1666
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-hidden",
1667
+ className
1668
+ ),
1669
+ "data-testid": dataTestId,
1670
+ ...props,
1671
+ children: [
1672
+ children,
1673
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPrimitive.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10 touch-manipulation", children: [
1674
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react6.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4" }),
1675
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Close" })
1676
+ ] })
1677
+ ]
1678
+ }
1679
+ )
1680
+ ] })
1681
+ );
1662
1682
  DialogContentBase.displayName = DialogPrimitive.Content.displayName;
1663
1683
  var DialogHeaderBase = React8.forwardRef(({ className, testid: dataTestId = "dialog-header", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1664
1684
  "div",
1665
1685
  {
1666
1686
  ref,
1667
- className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className),
1687
+ className: cn(
1688
+ "flex flex-col space-y-1.5 text-center sm:text-left",
1689
+ className
1690
+ ),
1668
1691
  "data-testid": dataTestId,
1669
1692
  ...props
1670
1693
  }
@@ -1674,7 +1697,10 @@ var DialogFooterBase = React8.forwardRef(({ className, testid: dataTestId = "dia
1674
1697
  "div",
1675
1698
  {
1676
1699
  ref,
1677
- className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
1700
+ className: cn(
1701
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1702
+ className
1703
+ ),
1678
1704
  "data-testid": dataTestId,
1679
1705
  ...props
1680
1706
  }
@@ -1684,7 +1710,10 @@ var DialogTitleBase = React8.forwardRef(({ className, testid: dataTestId = "dial
1684
1710
  DialogPrimitive.Title,
1685
1711
  {
1686
1712
  ref,
1687
- className: cn("text-lg font-semibold leading-none tracking-tight", className),
1713
+ className: cn(
1714
+ "text-lg font-semibold leading-none tracking-tight",
1715
+ className
1716
+ ),
1688
1717
  "data-testid": dataTestId,
1689
1718
  ...props
1690
1719
  }
@@ -2348,7 +2377,7 @@ var InputBase = React12.forwardRef(
2348
2377
  {
2349
2378
  type,
2350
2379
  className: cn(
2351
- "w-full flex-1 text-sm py-1.5 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
2380
+ "w-full flex-1 text-sm py-2 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
2352
2381
  className
2353
2382
  ),
2354
2383
  ref,
@@ -2423,7 +2452,7 @@ function ComboboxBase({
2423
2452
  role: "combobox",
2424
2453
  "aria-expanded": open,
2425
2454
  className: cn(
2426
- "flex items-start gap-2 justify-between h-full",
2455
+ "flex items-start gap-2 justify-between h-full border border-input",
2427
2456
  errorMessage && "border-red-500"
2428
2457
  ),
2429
2458
  "data-testid": testIds.trigger ?? "combobox-trigger",
@@ -2772,17 +2801,188 @@ function InputOTPSeparatorBase({ ...props }) {
2772
2801
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react17.MinusIcon, {}) });
2773
2802
  }
2774
2803
 
2804
+ // src/components/ui/LoadingBase.tsx
2805
+ var React16 = __toESM(require("react"));
2806
+ var import_class_variance_authority3 = require("class-variance-authority");
2807
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2808
+ var loadingVariants = (0, import_class_variance_authority3.cva)(
2809
+ "rounded-full border-2 animate-spin border-muted border-t-primary",
2810
+ {
2811
+ variants: {
2812
+ size: {
2813
+ sm: "h-4 w-4",
2814
+ md: "h-6 w-6",
2815
+ lg: "h-8 w-8",
2816
+ xl: "h-12 w-12 border-[3px]"
2817
+ }
2818
+ },
2819
+ defaultVariants: {
2820
+ size: "md"
2821
+ }
2822
+ }
2823
+ );
2824
+ var dotsVariants = (0, import_class_variance_authority3.cva)(
2825
+ "flex items-center justify-center",
2826
+ {
2827
+ variants: {
2828
+ size: {
2829
+ sm: "gap-1",
2830
+ md: "gap-1.5",
2831
+ lg: "gap-2",
2832
+ xl: "gap-2.5"
2833
+ }
2834
+ },
2835
+ defaultVariants: {
2836
+ size: "md"
2837
+ }
2838
+ }
2839
+ );
2840
+ var dotVariants = (0, import_class_variance_authority3.cva)(
2841
+ "rounded-full bg-gradient-to-r from-primary to-primary/70 shadow-sm",
2842
+ {
2843
+ variants: {
2844
+ size: {
2845
+ sm: "h-1.5 w-2",
2846
+ md: "h-2.5 w-2.5",
2847
+ lg: "h-2.5 w-3",
2848
+ xl: "h-3.5 w-4"
2849
+ }
2850
+ },
2851
+ defaultVariants: {
2852
+ size: "md"
2853
+ }
2854
+ }
2855
+ );
2856
+ var LoadingBase = React16.forwardRef(
2857
+ ({ className, size, message, overlay = false, variant = "spinner", ...props }, ref) => {
2858
+ React16.useEffect(() => {
2859
+ const style = document.createElement("style");
2860
+ style.textContent = `
2861
+ @keyframes dotBounce {
2862
+ 0%, 80%, 100% {
2863
+ transform: translateY(0);
2864
+ opacity: 0.8;
2865
+ }
2866
+ 40% {
2867
+ transform: translateY(-8px);
2868
+ opacity: 1;
2869
+ }
2870
+ }
2871
+ `;
2872
+ document.head.appendChild(style);
2873
+ return () => {
2874
+ if (document.head.contains(style)) {
2875
+ document.head.removeChild(style);
2876
+ }
2877
+ };
2878
+ }, []);
2879
+ const renderSpinner = () => {
2880
+ if (variant === "dots") {
2881
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: cn(dotsVariants({ size })), "aria-hidden": "true", children: [
2882
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2883
+ "div",
2884
+ {
2885
+ className: cn(dotVariants({ size })),
2886
+ style: {
2887
+ animation: "dotBounce 1.4s ease-in-out infinite",
2888
+ animationDelay: "0ms",
2889
+ transform: "translateY(0px)"
2890
+ }
2891
+ }
2892
+ ),
2893
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2894
+ "div",
2895
+ {
2896
+ className: cn(dotVariants({ size })),
2897
+ style: {
2898
+ animation: "dotBounce 1.4s ease-in-out infinite",
2899
+ animationDelay: "0.16s",
2900
+ transform: "translateY(0px)"
2901
+ }
2902
+ }
2903
+ ),
2904
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2905
+ "div",
2906
+ {
2907
+ className: cn(dotVariants({ size })),
2908
+ style: {
2909
+ animation: "dotBounce 1.4s ease-in-out infinite",
2910
+ animationDelay: "0.32s",
2911
+ transform: "translateY(0px)"
2912
+ }
2913
+ }
2914
+ )
2915
+ ] });
2916
+ }
2917
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2918
+ "div",
2919
+ {
2920
+ className: cn(loadingVariants({ size })),
2921
+ style: {
2922
+ animation: "spin 1s linear infinite"
2923
+ },
2924
+ "aria-hidden": "true"
2925
+ }
2926
+ );
2927
+ };
2928
+ const loadingContent = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
2929
+ renderSpinner(),
2930
+ message && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-medium text-muted-foreground animate-pulse", children: message })
2931
+ ] });
2932
+ if (overlay) {
2933
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2934
+ "div",
2935
+ {
2936
+ ref,
2937
+ className: cn(
2938
+ "fixed inset-0 z-50 flex items-center justify-center",
2939
+ "bg-background/80 dark:bg-background/60",
2940
+ "backdrop-blur-md backdrop-saturate-150",
2941
+ "transition-all duration-300 ease-in-out",
2942
+ "animate-in fade-in-0",
2943
+ className
2944
+ ),
2945
+ role: "status",
2946
+ "aria-label": message || "Carregando",
2947
+ ...props,
2948
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn(
2949
+ "relative p-8 rounded-2xl",
2950
+ "bg-card/90 dark:bg-card/95",
2951
+ "border border-border/50",
2952
+ "shadow-2xl shadow-black/10 dark:shadow-black/30",
2953
+ "backdrop-blur-xl backdrop-saturate-150",
2954
+ "animate-in zoom-in-95 fade-in-0 duration-300",
2955
+ "text-center space-y-4"
2956
+ ), children: loadingContent })
2957
+ }
2958
+ );
2959
+ }
2960
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2961
+ "div",
2962
+ {
2963
+ ref,
2964
+ className: cn("flex items-center justify-center", className),
2965
+ role: "status",
2966
+ "aria-label": message || "Carregando",
2967
+ ...props,
2968
+ children: loadingContent
2969
+ }
2970
+ );
2971
+ }
2972
+ );
2973
+ LoadingBase.displayName = "LoadingBase";
2974
+
2775
2975
  // src/components/ui/NavigationMenuBase.tsx
2776
2976
  var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
2777
2977
  var import_react18 = require("@phosphor-icons/react");
2778
- var import_jsx_runtime26 = require("react/jsx-runtime");
2978
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2779
2979
  function NavigationMenuBase({
2780
2980
  className,
2781
2981
  children,
2782
2982
  viewport = true,
2783
2983
  ...props
2784
2984
  }) {
2785
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2985
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2786
2986
  NavigationMenuPrimitive.Root,
2787
2987
  {
2788
2988
  "data-slot": "navigation-menu",
@@ -2794,7 +2994,7 @@ function NavigationMenuBase({
2794
2994
  ...props,
2795
2995
  children: [
2796
2996
  children,
2797
- viewport && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NavigationMenuViewportBase, {})
2997
+ viewport && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(NavigationMenuViewportBase, {})
2798
2998
  ]
2799
2999
  }
2800
3000
  );
@@ -2803,7 +3003,7 @@ function NavigationMenuListBase({
2803
3003
  className,
2804
3004
  ...props
2805
3005
  }) {
2806
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3006
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2807
3007
  NavigationMenuPrimitive.List,
2808
3008
  {
2809
3009
  "data-slot": "navigation-menu-list",
@@ -2819,7 +3019,7 @@ function NavigationMenuItemBase({
2819
3019
  className,
2820
3020
  ...props
2821
3021
  }) {
2822
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3022
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2823
3023
  NavigationMenuPrimitive.Item,
2824
3024
  {
2825
3025
  "data-slot": "navigation-menu-item",
@@ -2833,7 +3033,7 @@ function NavigationMenuTriggerBase({
2833
3033
  children,
2834
3034
  ...props
2835
3035
  }) {
2836
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3036
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2837
3037
  NavigationMenuPrimitive.Trigger,
2838
3038
  {
2839
3039
  "data-slot": "navigation-menu-trigger",
@@ -2841,7 +3041,7 @@ function NavigationMenuTriggerBase({
2841
3041
  ...props,
2842
3042
  children: [
2843
3043
  children,
2844
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3044
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2845
3045
  import_react18.CaretDownIcon,
2846
3046
  {
2847
3047
  className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
@@ -2856,7 +3056,7 @@ function NavigationMenuContentBase({
2856
3056
  className,
2857
3057
  ...props
2858
3058
  }) {
2859
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3059
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2860
3060
  NavigationMenuPrimitive.Content,
2861
3061
  {
2862
3062
  "data-slot": "navigation-menu-content",
@@ -2873,7 +3073,7 @@ function NavigationMenuViewportBase({
2873
3073
  className,
2874
3074
  ...props
2875
3075
  }) {
2876
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("absolute top-full left-0 isolate z-50 flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3076
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: cn("absolute top-full left-0 isolate z-50 flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2877
3077
  NavigationMenuPrimitive.Viewport,
2878
3078
  {
2879
3079
  "data-slot": "navigation-menu-viewport",
@@ -2889,7 +3089,7 @@ function NavigationMenuLinkBase({
2889
3089
  className,
2890
3090
  ...props
2891
3091
  }) {
2892
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3092
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2893
3093
  NavigationMenuPrimitive.Link,
2894
3094
  {
2895
3095
  "data-slot": "navigation-menu-link",
@@ -2905,7 +3105,7 @@ function NavigationMenuIndicatorBase({
2905
3105
  className,
2906
3106
  ...props
2907
3107
  }) {
2908
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3108
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2909
3109
  NavigationMenuPrimitive.Indicator,
2910
3110
  {
2911
3111
  "data-slot": "navigation-menu-indicator",
@@ -2914,21 +3114,21 @@ function NavigationMenuIndicatorBase({
2914
3114
  className
2915
3115
  ),
2916
3116
  ...props,
2917
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
3117
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
2918
3118
  }
2919
3119
  );
2920
3120
  }
2921
3121
 
2922
3122
  // src/components/ui/ProgressBase.tsx
2923
- var React16 = __toESM(require("react"));
3123
+ var React17 = __toESM(require("react"));
2924
3124
  var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
2925
- var import_jsx_runtime27 = require("react/jsx-runtime");
2926
- var ProgressBase = React16.forwardRef(({ className, value, label, leftIcon, rightIcon, ...props }, ref) => {
2927
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
2928
- label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LabelBase_default, { className: "py-2", children: label }),
2929
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
2930
- leftIcon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
2931
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3125
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3126
+ var ProgressBase = React17.forwardRef(({ className, value, label, leftIcon, rightIcon, ...props }, ref) => {
3127
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
3128
+ label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelBase_default, { className: "py-2", children: label }),
3129
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
3130
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
3131
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2932
3132
  ProgressPrimitive.Root,
2933
3133
  {
2934
3134
  ref,
@@ -2938,7 +3138,7 @@ var ProgressBase = React16.forwardRef(({ className, value, label, leftIcon, righ
2938
3138
  ),
2939
3139
  value,
2940
3140
  ...props,
2941
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3141
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2942
3142
  ProgressPrimitive.Indicator,
2943
3143
  {
2944
3144
  className: "h-full w-full flex-1 bg-primary transition-all duration-500 ease-in-out",
@@ -2947,7 +3147,7 @@ var ProgressBase = React16.forwardRef(({ className, value, label, leftIcon, righ
2947
3147
  )
2948
3148
  }
2949
3149
  ),
2950
- rightIcon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
3150
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
2951
3151
  ] })
2952
3152
  ] });
2953
3153
  });
@@ -2958,9 +3158,9 @@ var ProgressSegmentsBase = ({
2958
3158
  value
2959
3159
  }) => {
2960
3160
  const filled = Math.round(value / 100 * segments);
2961
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
2962
- label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LabelBase_default, { className: "py-2", children: label }),
2963
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex gap-1 w-full", children: Array.from({ length: segments }).map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3161
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
3162
+ label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelBase_default, { className: "py-2", children: label }),
3163
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex gap-1 w-full", children: Array.from({ length: segments }).map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2964
3164
  "div",
2965
3165
  {
2966
3166
  className: cn(
@@ -2972,7 +3172,7 @@ var ProgressSegmentsBase = ({
2972
3172
  )) })
2973
3173
  ] });
2974
3174
  };
2975
- var ArrowRightIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3175
+ var ArrowRightIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2976
3176
  "svg",
2977
3177
  {
2978
3178
  className: "w-6 h-6 text-zinc-400 transition-transform duration-300 group-hover:translate-x-1",
@@ -2981,7 +3181,7 @@ var ArrowRightIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2981
3181
  strokeWidth: 2,
2982
3182
  viewBox: "0 0 24 24",
2983
3183
  xmlns: "http://www.w3.org/2000/svg",
2984
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
3184
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
2985
3185
  }
2986
3186
  );
2987
3187
  var ProgressPanelsBase = ({
@@ -2989,13 +3189,13 @@ var ProgressPanelsBase = ({
2989
3189
  steps,
2990
3190
  currentStep
2991
3191
  }) => {
2992
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1 w-full", children: [
2993
- label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LabelBase_default, { className: "py-2", children: label }),
2994
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex w-full gap-1 rounded-lg overflow-hidden", children: steps.map((step, idx) => {
3192
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 w-full", children: [
3193
+ label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelBase_default, { className: "py-2", children: label }),
3194
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex w-full gap-1 rounded-lg overflow-hidden", children: steps.map((step, idx) => {
2995
3195
  const isActive = idx === currentStep;
2996
3196
  const isLast = idx === steps.length - 1;
2997
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(React16.Fragment, { children: [
2998
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3197
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(React17.Fragment, { children: [
3198
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2999
3199
  "div",
3000
3200
  {
3001
3201
  className: cn(
@@ -3006,12 +3206,12 @@ var ProgressPanelsBase = ({
3006
3206
  ),
3007
3207
  style: { flex: "1 1 0" },
3008
3208
  children: [
3009
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate", children: step }),
3010
- isActive && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute bottom-0 left-0 h-1 w-full animate-pulse rounded-b-lg" })
3209
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "truncate", children: step }),
3210
+ isActive && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute bottom-0 left-0 h-1 w-full animate-pulse rounded-b-lg" })
3011
3211
  ]
3012
3212
  }
3013
3213
  ),
3014
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center px-2 group", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArrowRightIcon2, {}) })
3214
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center px-2 group", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArrowRightIcon2, {}) })
3015
3215
  ] }, idx);
3016
3216
  }) })
3017
3217
  ] });
@@ -3021,11 +3221,11 @@ var ProgressCirclesBase = ({
3021
3221
  steps,
3022
3222
  currentStep
3023
3223
  }) => {
3024
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
3025
- label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("label", { className: "py-2 text-base font-semibold text-gray-700 dark:text-gray-300", children: label }),
3026
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative flex items-center justify-between w-full", children: [
3027
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute top-5 left-0 w-full h-1 bg-zinc-200 dark:bg-zinc-700" }),
3028
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3224
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
3225
+ label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("label", { className: "py-2 text-base font-semibold text-gray-700 dark:text-gray-300", children: label }),
3226
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative flex items-center justify-between w-full", children: [
3227
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute top-5 left-0 w-full h-1 bg-zinc-200 dark:bg-zinc-700" }),
3228
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3029
3229
  "div",
3030
3230
  {
3031
3231
  className: "absolute top-5 left-0 h-1 bg-primary transition-all duration-300",
@@ -3036,13 +3236,13 @@ var ProgressCirclesBase = ({
3036
3236
  ),
3037
3237
  steps.map((step, idx) => {
3038
3238
  const isActive = idx <= currentStep;
3039
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3239
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3040
3240
  "div",
3041
3241
  {
3042
3242
  className: "relative flex flex-col items-center w-10",
3043
3243
  style: { zIndex: isActive ? 10 : 1 },
3044
3244
  children: [
3045
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3245
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3046
3246
  "div",
3047
3247
  {
3048
3248
  className: cn(
@@ -3052,7 +3252,7 @@ var ProgressCirclesBase = ({
3052
3252
  children: idx + 1
3053
3253
  }
3054
3254
  ),
3055
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-xs text-center font-medium mt-1 max-w-[80px] break-words", children: step })
3255
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs text-center font-medium mt-1 max-w-[80px] break-words", children: step })
3056
3256
  ]
3057
3257
  },
3058
3258
  idx
@@ -3063,24 +3263,24 @@ var ProgressCirclesBase = ({
3063
3263
  };
3064
3264
 
3065
3265
  // src/components/ui/ScrollareaBase.tsx
3066
- var React17 = __toESM(require("react"));
3266
+ var React18 = __toESM(require("react"));
3067
3267
  var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
3068
- var import_jsx_runtime28 = require("react/jsx-runtime");
3069
- var ScrollAreaBase = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3268
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3269
+ var ScrollAreaBase = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3070
3270
  ScrollAreaPrimitive.Root,
3071
3271
  {
3072
3272
  ref,
3073
3273
  className: cn("relative overflow-hidden", className),
3074
3274
  ...props,
3075
3275
  children: [
3076
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
3077
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScrollBarBase, {}),
3078
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScrollAreaPrimitive.Corner, {})
3276
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
3277
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollBarBase, {}),
3278
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollAreaPrimitive.Corner, {})
3079
3279
  ]
3080
3280
  }
3081
3281
  ));
3082
3282
  ScrollAreaBase.displayName = ScrollAreaPrimitive.Root.displayName;
3083
- var ScrollBarBase = React17.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3283
+ var ScrollBarBase = React18.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3084
3284
  ScrollAreaPrimitive.ScrollAreaScrollbar,
3085
3285
  {
3086
3286
  ref,
@@ -3092,21 +3292,21 @@ var ScrollBarBase = React17.forwardRef(({ className, orientation = "vertical", .
3092
3292
  className
3093
3293
  ),
3094
3294
  ...props,
3095
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
3295
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
3096
3296
  }
3097
3297
  ));
3098
3298
  ScrollBarBase.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
3099
3299
 
3100
3300
  // src/components/ui/SelectBase.tsx
3101
- var React18 = __toESM(require("react"));
3301
+ var React19 = __toESM(require("react"));
3102
3302
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
3103
3303
  var import_react19 = require("@phosphor-icons/react");
3104
3304
  var import_framer_motion4 = require("framer-motion");
3105
- var import_jsx_runtime29 = require("react/jsx-runtime");
3305
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3106
3306
  var SelectBase = SelectPrimitive.Root;
3107
3307
  var SelectGroupBase = SelectPrimitive.Group;
3108
3308
  var SelectValueBase = SelectPrimitive.Value;
3109
- var SelectTriggerBase = React18.forwardRef(({ className, children, open, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3309
+ var SelectTriggerBase = React19.forwardRef(({ className, children, open, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3110
3310
  SelectPrimitive.Trigger,
3111
3311
  {
3112
3312
  ref,
@@ -3117,20 +3317,20 @@ var SelectTriggerBase = React18.forwardRef(({ className, children, open, ...prop
3117
3317
  ...props,
3118
3318
  children: [
3119
3319
  children,
3120
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3320
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3121
3321
  import_framer_motion4.motion.span,
3122
3322
  {
3123
3323
  animate: { rotate: open ? 180 : 0 },
3124
3324
  transition: { duration: 0.3 },
3125
3325
  className: "flex items-center",
3126
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.CaretDownIcon, { className: "h-4 w-4 opacity-50" })
3326
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CaretDownIcon, { className: "h-4 w-4 opacity-50" })
3127
3327
  }
3128
3328
  )
3129
3329
  ]
3130
3330
  }
3131
3331
  ));
3132
3332
  SelectTriggerBase.displayName = SelectPrimitive.Trigger.displayName;
3133
- var SelectScrollUpButtonBase = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3333
+ var SelectScrollUpButtonBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3134
3334
  SelectPrimitive.ScrollUpButton,
3135
3335
  {
3136
3336
  ref,
@@ -3139,11 +3339,11 @@ var SelectScrollUpButtonBase = React18.forwardRef(({ className, ...props }, ref)
3139
3339
  className
3140
3340
  ),
3141
3341
  ...props,
3142
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.CaretUpIcon, { className: "h-4 w-4" })
3342
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CaretUpIcon, { className: "h-4 w-4" })
3143
3343
  }
3144
3344
  ));
3145
3345
  SelectScrollUpButtonBase.displayName = SelectPrimitive.ScrollUpButton.displayName;
3146
- var SelectScrollDownButtonBase = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3346
+ var SelectScrollDownButtonBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3147
3347
  SelectPrimitive.ScrollDownButton,
3148
3348
  {
3149
3349
  ref,
@@ -3152,11 +3352,11 @@ var SelectScrollDownButtonBase = React18.forwardRef(({ className, ...props }, re
3152
3352
  className
3153
3353
  ),
3154
3354
  ...props,
3155
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.CaretDownIcon, { className: "h-4 w-4" })
3355
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CaretDownIcon, { className: "h-4 w-4" })
3156
3356
  }
3157
3357
  ));
3158
3358
  SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
3159
- var SelectContentBase = React18.forwardRef(({ className, children, position = "popper", testid: dataTestId = "select-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_framer_motion4.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3359
+ var SelectContentBase = React19.forwardRef(({ className, children, position = "popper", testid: dataTestId = "select-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_framer_motion4.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3160
3360
  SelectPrimitive.Content,
3161
3361
  {
3162
3362
  ref,
@@ -3168,16 +3368,16 @@ var SelectContentBase = React18.forwardRef(({ className, children, position = "p
3168
3368
  "data-testid": dataTestId,
3169
3369
  ...props,
3170
3370
  asChild: true,
3171
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3371
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3172
3372
  import_framer_motion4.motion.div,
3173
3373
  {
3174
3374
  initial: { opacity: 0, scale: 0.95 },
3175
3375
  animate: { opacity: 1, scale: 1 },
3176
3376
  exit: { opacity: 0, scale: 0.95 },
3177
3377
  transition: { duration: 0.2 },
3178
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
3179
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectScrollUpButtonBase, {}),
3180
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3378
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3379
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollUpButtonBase, {}),
3380
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3181
3381
  SelectPrimitive.Viewport,
3182
3382
  {
3183
3383
  className: cn(
@@ -3187,14 +3387,14 @@ var SelectContentBase = React18.forwardRef(({ className, children, position = "p
3187
3387
  children
3188
3388
  }
3189
3389
  ),
3190
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectScrollDownButtonBase, {})
3390
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollDownButtonBase, {})
3191
3391
  ] })
3192
3392
  }
3193
3393
  )
3194
3394
  }
3195
3395
  ) }) }));
3196
3396
  SelectContentBase.displayName = SelectPrimitive.Content.displayName;
3197
- var SelectLabelBase = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3397
+ var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3198
3398
  SelectPrimitive.Label,
3199
3399
  {
3200
3400
  ref,
@@ -3203,7 +3403,7 @@ var SelectLabelBase = React18.forwardRef(({ className, ...props }, ref) => /* @_
3203
3403
  }
3204
3404
  ));
3205
3405
  SelectLabelBase.displayName = SelectPrimitive.Label.displayName;
3206
- var SelectItemBase = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3406
+ var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3207
3407
  SelectPrimitive.Item,
3208
3408
  {
3209
3409
  ref,
@@ -3213,13 +3413,13 @@ var SelectItemBase = React18.forwardRef(({ className, children, ...props }, ref)
3213
3413
  ),
3214
3414
  ...props,
3215
3415
  children: [
3216
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react19.CheckIcon, { className: "h-4 w-4" }) }) }),
3217
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectPrimitive.ItemText, { children })
3416
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CheckIcon, { className: "h-4 w-4" }) }) }),
3417
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemText, { children })
3218
3418
  ]
3219
3419
  }
3220
3420
  ));
3221
3421
  SelectItemBase.displayName = SelectPrimitive.Item.displayName;
3222
- var SelectSeparatorBase = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3422
+ var SelectSeparatorBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3223
3423
  SelectPrimitive.Separator,
3224
3424
  {
3225
3425
  ref,
@@ -3230,14 +3430,14 @@ var SelectSeparatorBase = React18.forwardRef(({ className, ...props }, ref) => /
3230
3430
  SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
3231
3431
 
3232
3432
  // src/components/ui/SeparatorBase.tsx
3233
- var React19 = __toESM(require("react"));
3433
+ var React20 = __toESM(require("react"));
3234
3434
  var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
3235
3435
  var import_framer_motion5 = require("framer-motion");
3236
- var import_jsx_runtime30 = require("react/jsx-runtime");
3237
- var SeparatorBase = React19.forwardRef(
3436
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3437
+ var SeparatorBase = React20.forwardRef(
3238
3438
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
3239
3439
  const isHorizontal = orientation === "horizontal";
3240
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3440
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3241
3441
  SeparatorPrimitive.Root,
3242
3442
  {
3243
3443
  ref,
@@ -3245,7 +3445,7 @@ var SeparatorBase = React19.forwardRef(
3245
3445
  orientation,
3246
3446
  asChild: true,
3247
3447
  ...props,
3248
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3448
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3249
3449
  import_framer_motion5.motion.div,
3250
3450
  {
3251
3451
  className: cn(
@@ -3265,16 +3465,16 @@ var SeparatorBase = React19.forwardRef(
3265
3465
  SeparatorBase.displayName = SeparatorPrimitive.Root.displayName;
3266
3466
 
3267
3467
  // src/components/ui/SheetBase.tsx
3268
- var React20 = __toESM(require("react"));
3468
+ var React21 = __toESM(require("react"));
3269
3469
  var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
3270
- var import_class_variance_authority3 = require("class-variance-authority");
3470
+ var import_class_variance_authority4 = require("class-variance-authority");
3271
3471
  var import_react20 = require("@phosphor-icons/react");
3272
- var import_jsx_runtime31 = require("react/jsx-runtime");
3472
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3273
3473
  var SheetBase = SheetPrimitive.Root;
3274
3474
  var SheetTriggerBase = SheetPrimitive.Trigger;
3275
3475
  var SheetCloseBase = SheetPrimitive.Close;
3276
3476
  var SheetPortalBase = SheetPrimitive.Portal;
3277
- var SheetOverlayBase = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3477
+ var SheetOverlayBase = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3278
3478
  SheetPrimitive.Overlay,
3279
3479
  {
3280
3480
  className: cn(
@@ -3286,7 +3486,7 @@ var SheetOverlayBase = React20.forwardRef(({ className, ...props }, ref) => /* @
3286
3486
  }
3287
3487
  ));
3288
3488
  SheetOverlayBase.displayName = SheetPrimitive.Overlay.displayName;
3289
- var sheetVariants = (0, import_class_variance_authority3.cva)(
3489
+ var sheetVariants = (0, import_class_variance_authority4.cva)(
3290
3490
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
3291
3491
  {
3292
3492
  variants: {
@@ -3302,18 +3502,18 @@ var sheetVariants = (0, import_class_variance_authority3.cva)(
3302
3502
  }
3303
3503
  }
3304
3504
  );
3305
- var SheetContentBase = React20.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(SheetPortalBase, { children: [
3306
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SheetOverlayBase, {}),
3307
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3505
+ var SheetContentBase = React21.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(SheetPortalBase, { children: [
3506
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SheetOverlayBase, {}),
3507
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3308
3508
  SheetPrimitive.Content,
3309
3509
  {
3310
3510
  ref,
3311
3511
  className: cn(sheetVariants({ side }), className),
3312
3512
  ...props,
3313
3513
  children: [
3314
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
3315
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react20.XIcon, { className: "h-4 w-4" }),
3316
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "Close" })
3514
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
3515
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react20.XIcon, { className: "h-4 w-4" }),
3516
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: "Close" })
3317
3517
  ] }),
3318
3518
  children
3319
3519
  ]
@@ -3324,7 +3524,7 @@ SheetContentBase.displayName = SheetPrimitive.Content.displayName;
3324
3524
  var SheetHeaderBase = ({
3325
3525
  className,
3326
3526
  ...props
3327
- }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3527
+ }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3328
3528
  "div",
3329
3529
  {
3330
3530
  className: cn(
@@ -3338,7 +3538,7 @@ SheetHeaderBase.displayName = "SheetHeaderBase";
3338
3538
  var SheetFooterBase = ({
3339
3539
  className,
3340
3540
  ...props
3341
- }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3541
+ }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3342
3542
  "div",
3343
3543
  {
3344
3544
  className: cn(
@@ -3349,7 +3549,7 @@ var SheetFooterBase = ({
3349
3549
  }
3350
3550
  );
3351
3551
  SheetFooterBase.displayName = "SheetFooterBase";
3352
- var SheetTitleBase = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3552
+ var SheetTitleBase = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3353
3553
  SheetPrimitive.Title,
3354
3554
  {
3355
3555
  ref,
@@ -3358,7 +3558,7 @@ var SheetTitleBase = React20.forwardRef(({ className, ...props }, ref) => /* @__
3358
3558
  }
3359
3559
  ));
3360
3560
  SheetTitleBase.displayName = SheetPrimitive.Title.displayName;
3361
- var SheetDescriptionBase = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3561
+ var SheetDescriptionBase = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3362
3562
  SheetPrimitive.Description,
3363
3563
  {
3364
3564
  ref,
@@ -3369,16 +3569,16 @@ var SheetDescriptionBase = React20.forwardRef(({ className, ...props }, ref) =>
3369
3569
  SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
3370
3570
 
3371
3571
  // src/components/ui/SidebarBase.tsx
3372
- var React22 = __toESM(require("react"));
3572
+ var React23 = __toESM(require("react"));
3373
3573
  var import_react_slot5 = require("@radix-ui/react-slot");
3374
- var import_class_variance_authority4 = require("class-variance-authority");
3574
+ var import_class_variance_authority5 = require("class-variance-authority");
3375
3575
 
3376
3576
  // src/hooks/use-mobile.tsx
3377
- var React21 = __toESM(require("react"));
3577
+ var React22 = __toESM(require("react"));
3378
3578
  var MOBILE_BREAKPOINT = 768;
3379
3579
  function useIsMobile() {
3380
- const [isMobile, setIsMobile] = React21.useState(void 0);
3381
- React21.useEffect(() => {
3580
+ const [isMobile, setIsMobile] = React22.useState(void 0);
3581
+ React22.useEffect(() => {
3382
3582
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
3383
3583
  const onChange = () => {
3384
3584
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -3391,12 +3591,12 @@ function useIsMobile() {
3391
3591
  }
3392
3592
 
3393
3593
  // src/components/ui/SkeletonBase.tsx
3394
- var import_jsx_runtime32 = require("react/jsx-runtime");
3594
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3395
3595
  function SkeletonBase({
3396
3596
  className,
3397
3597
  ...props
3398
3598
  }) {
3399
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3599
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3400
3600
  "div",
3401
3601
  {
3402
3602
  className: cn("animate-pulse bg-primary/10", className),
@@ -3407,16 +3607,16 @@ function SkeletonBase({
3407
3607
 
3408
3608
  // src/components/ui/SidebarBase.tsx
3409
3609
  var import_react21 = require("@phosphor-icons/react");
3410
- var import_jsx_runtime33 = require("react/jsx-runtime");
3610
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3411
3611
  var SIDEBAR_COOKIE_NAME = "sidebar:state";
3412
3612
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
3413
3613
  var SIDEBAR_WIDTH = "16rem";
3414
3614
  var SIDEBAR_WIDTH_MOBILE = "18rem";
3415
3615
  var SIDEBAR_WIDTH_ICON = "3rem";
3416
3616
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
3417
- var SidebarContext = React22.createContext(null);
3617
+ var SidebarContext = React23.createContext(null);
3418
3618
  function UseSideBarBase() {
3419
- const context = React22.useContext(SidebarContext);
3619
+ const context = React23.useContext(SidebarContext);
3420
3620
  if (!context) {
3421
3621
  throw new Error(
3422
3622
  "UseSideBarBase must be used within a SidebarProviderBase."
@@ -3424,7 +3624,7 @@ function UseSideBarBase() {
3424
3624
  }
3425
3625
  return context;
3426
3626
  }
3427
- var SidebarProviderBase = React22.forwardRef(
3627
+ var SidebarProviderBase = React23.forwardRef(
3428
3628
  ({
3429
3629
  defaultOpen = true,
3430
3630
  open: openProp,
@@ -3435,10 +3635,10 @@ var SidebarProviderBase = React22.forwardRef(
3435
3635
  ...props
3436
3636
  }, ref) => {
3437
3637
  const isMobile = useIsMobile();
3438
- const [openMobile, setOpenMobile] = React22.useState(false);
3439
- const [_open, _setOpen] = React22.useState(defaultOpen);
3638
+ const [openMobile, setOpenMobile] = React23.useState(false);
3639
+ const [_open, _setOpen] = React23.useState(defaultOpen);
3440
3640
  const open = openProp ?? _open;
3441
- const setOpen = React22.useCallback(
3641
+ const setOpen = React23.useCallback(
3442
3642
  (value) => {
3443
3643
  const openState = typeof value === "function" ? value(open) : value;
3444
3644
  if (setOpenProp) {
@@ -3450,10 +3650,10 @@ var SidebarProviderBase = React22.forwardRef(
3450
3650
  },
3451
3651
  [setOpenProp, open]
3452
3652
  );
3453
- const toggleSidebar = React22.useCallback(() => {
3653
+ const toggleSidebar = React23.useCallback(() => {
3454
3654
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
3455
3655
  }, [isMobile, setOpen, setOpenMobile]);
3456
- React22.useEffect(() => {
3656
+ React23.useEffect(() => {
3457
3657
  const handleKeyDown = (event) => {
3458
3658
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
3459
3659
  event.preventDefault();
@@ -3464,7 +3664,7 @@ var SidebarProviderBase = React22.forwardRef(
3464
3664
  return () => window.removeEventListener("keydown", handleKeyDown);
3465
3665
  }, [toggleSidebar]);
3466
3666
  const state = open ? "expanded" : "collapsed";
3467
- const contextValue = React22.useMemo(
3667
+ const contextValue = React23.useMemo(
3468
3668
  () => ({
3469
3669
  state,
3470
3670
  open,
@@ -3476,7 +3676,7 @@ var SidebarProviderBase = React22.forwardRef(
3476
3676
  }),
3477
3677
  [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
3478
3678
  );
3479
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipProviderBase, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3679
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipProviderBase, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3480
3680
  "div",
3481
3681
  {
3482
3682
  style: {
@@ -3496,7 +3696,7 @@ var SidebarProviderBase = React22.forwardRef(
3496
3696
  }
3497
3697
  );
3498
3698
  SidebarProviderBase.displayName = "SidebarProviderBase";
3499
- var SidebarBase = React22.forwardRef(
3699
+ var SidebarBase = React23.forwardRef(
3500
3700
  ({
3501
3701
  side = "left",
3502
3702
  variant = "sidebar",
@@ -3507,7 +3707,7 @@ var SidebarBase = React22.forwardRef(
3507
3707
  }, ref) => {
3508
3708
  const { isMobile, state, openMobile, setOpenMobile } = UseSideBarBase();
3509
3709
  if (collapsible === "none") {
3510
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3710
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3511
3711
  "div",
3512
3712
  {
3513
3713
  className: cn(
@@ -3521,7 +3721,7 @@ var SidebarBase = React22.forwardRef(
3521
3721
  );
3522
3722
  }
3523
3723
  if (isMobile) {
3524
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SheetBase, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3724
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SheetBase, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3525
3725
  SheetContentBase,
3526
3726
  {
3527
3727
  "data-sidebar": "sidebar",
@@ -3531,11 +3731,11 @@ var SidebarBase = React22.forwardRef(
3531
3731
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
3532
3732
  },
3533
3733
  side,
3534
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex h-full w-full flex-col", children })
3734
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex h-full w-full flex-col", children })
3535
3735
  }
3536
3736
  ) });
3537
3737
  }
3538
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3738
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3539
3739
  "div",
3540
3740
  {
3541
3741
  ref,
@@ -3545,7 +3745,7 @@ var SidebarBase = React22.forwardRef(
3545
3745
  "data-variant": variant,
3546
3746
  "data-side": side,
3547
3747
  children: [
3548
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3748
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3549
3749
  "div",
3550
3750
  {
3551
3751
  className: cn(
@@ -3556,7 +3756,7 @@ var SidebarBase = React22.forwardRef(
3556
3756
  )
3557
3757
  }
3558
3758
  ),
3559
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3759
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3560
3760
  "div",
3561
3761
  {
3562
3762
  className: cn(
@@ -3567,7 +3767,7 @@ var SidebarBase = React22.forwardRef(
3567
3767
  className
3568
3768
  ),
3569
3769
  ...props,
3570
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3770
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3571
3771
  "div",
3572
3772
  {
3573
3773
  "data-sidebar": "sidebar",
@@ -3583,9 +3783,9 @@ var SidebarBase = React22.forwardRef(
3583
3783
  }
3584
3784
  );
3585
3785
  SidebarBase.displayName = "SidebarBase";
3586
- var SidebarTriggerBase = React22.forwardRef(({ className, onClick, ...props }, ref) => {
3786
+ var SidebarTriggerBase = React23.forwardRef(({ className, onClick, ...props }, ref) => {
3587
3787
  const { toggleSidebar } = UseSideBarBase();
3588
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3788
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3589
3789
  ButtonBase,
3590
3790
  {
3591
3791
  ref,
@@ -3599,16 +3799,16 @@ var SidebarTriggerBase = React22.forwardRef(({ className, onClick, ...props }, r
3599
3799
  },
3600
3800
  ...props,
3601
3801
  children: [
3602
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
3603
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react21.SidebarSimpleIcon, {})
3802
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
3803
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react21.SidebarSimpleIcon, {})
3604
3804
  ]
3605
3805
  }
3606
3806
  ) });
3607
3807
  });
3608
3808
  SidebarTriggerBase.displayName = "SidebarTriggerBase";
3609
- var SidebarRailBase = React22.forwardRef(({ className, ...props }, ref) => {
3809
+ var SidebarRailBase = React23.forwardRef(({ className, ...props }, ref) => {
3610
3810
  const { toggleSidebar } = UseSideBarBase();
3611
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3811
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3612
3812
  "button",
3613
3813
  {
3614
3814
  ref,
@@ -3631,8 +3831,8 @@ var SidebarRailBase = React22.forwardRef(({ className, ...props }, ref) => {
3631
3831
  );
3632
3832
  });
3633
3833
  SidebarRailBase.displayName = "SidebarRailBase";
3634
- var SidebarInsetBase = React22.forwardRef(({ className, ...props }, ref) => {
3635
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3834
+ var SidebarInsetBase = React23.forwardRef(({ className, ...props }, ref) => {
3835
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3636
3836
  "main",
3637
3837
  {
3638
3838
  ref,
@@ -3646,8 +3846,8 @@ var SidebarInsetBase = React22.forwardRef(({ className, ...props }, ref) => {
3646
3846
  );
3647
3847
  });
3648
3848
  SidebarInsetBase.displayName = "SidebarInsetBase";
3649
- var SidebarInputBase = React22.forwardRef(({ className, ...props }, ref) => {
3650
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3849
+ var SidebarInputBase = React23.forwardRef(({ className, ...props }, ref) => {
3850
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3651
3851
  InputBase,
3652
3852
  {
3653
3853
  ref,
@@ -3661,8 +3861,8 @@ var SidebarInputBase = React22.forwardRef(({ className, ...props }, ref) => {
3661
3861
  );
3662
3862
  });
3663
3863
  SidebarInputBase.displayName = "SidebarInputBase";
3664
- var SidebarHeaderBase = React22.forwardRef(({ className, ...props }, ref) => {
3665
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3864
+ var SidebarHeaderBase = React23.forwardRef(({ className, ...props }, ref) => {
3865
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3666
3866
  "div",
3667
3867
  {
3668
3868
  ref,
@@ -3673,8 +3873,8 @@ var SidebarHeaderBase = React22.forwardRef(({ className, ...props }, ref) => {
3673
3873
  );
3674
3874
  });
3675
3875
  SidebarHeaderBase.displayName = "SidebarHeaderBase";
3676
- var SidebarFooterBase = React22.forwardRef(({ className, ...props }, ref) => {
3677
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3876
+ var SidebarFooterBase = React23.forwardRef(({ className, ...props }, ref) => {
3877
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3678
3878
  "div",
3679
3879
  {
3680
3880
  ref,
@@ -3685,8 +3885,8 @@ var SidebarFooterBase = React22.forwardRef(({ className, ...props }, ref) => {
3685
3885
  );
3686
3886
  });
3687
3887
  SidebarFooterBase.displayName = "SidebarFooterBase";
3688
- var SidebarSeparatorBase = React22.forwardRef(({ className, ...props }, ref) => {
3689
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3888
+ var SidebarSeparatorBase = React23.forwardRef(({ className, ...props }, ref) => {
3889
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3690
3890
  SeparatorBase,
3691
3891
  {
3692
3892
  ref,
@@ -3697,8 +3897,8 @@ var SidebarSeparatorBase = React22.forwardRef(({ className, ...props }, ref) =>
3697
3897
  );
3698
3898
  });
3699
3899
  SidebarSeparatorBase.displayName = "SidebarSeparatorBase";
3700
- var SidebarContentBase = React22.forwardRef(({ className, ...props }, ref) => {
3701
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3900
+ var SidebarContentBase = React23.forwardRef(({ className, ...props }, ref) => {
3901
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3702
3902
  "div",
3703
3903
  {
3704
3904
  ref,
@@ -3712,8 +3912,8 @@ var SidebarContentBase = React22.forwardRef(({ className, ...props }, ref) => {
3712
3912
  );
3713
3913
  });
3714
3914
  SidebarContentBase.displayName = "SidebarContentBase";
3715
- var SidebarGroupBase = React22.forwardRef(({ className, ...props }, ref) => {
3716
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3915
+ var SidebarGroupBase = React23.forwardRef(({ className, ...props }, ref) => {
3916
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3717
3917
  "div",
3718
3918
  {
3719
3919
  ref,
@@ -3724,9 +3924,9 @@ var SidebarGroupBase = React22.forwardRef(({ className, ...props }, ref) => {
3724
3924
  );
3725
3925
  });
3726
3926
  SidebarGroupBase.displayName = "SidebarGroupBase";
3727
- var SidebarGroupLabelBase = React22.forwardRef(({ className, asChild = false, ...props }, ref) => {
3927
+ var SidebarGroupLabelBase = React23.forwardRef(({ className, asChild = false, ...props }, ref) => {
3728
3928
  const Comp = asChild ? import_react_slot5.Slot : "div";
3729
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3929
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3730
3930
  Comp,
3731
3931
  {
3732
3932
  ref,
@@ -3741,9 +3941,9 @@ var SidebarGroupLabelBase = React22.forwardRef(({ className, asChild = false, ..
3741
3941
  );
3742
3942
  });
3743
3943
  SidebarGroupLabelBase.displayName = "SidebarGroupLabelBase";
3744
- var SidebarGroupActionBase = React22.forwardRef(({ className, asChild = false, ...props }, ref) => {
3944
+ var SidebarGroupActionBase = React23.forwardRef(({ className, asChild = false, ...props }, ref) => {
3745
3945
  const Comp = asChild ? import_react_slot5.Slot : "button";
3746
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3946
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3747
3947
  Comp,
3748
3948
  {
3749
3949
  ref,
@@ -3760,7 +3960,7 @@ var SidebarGroupActionBase = React22.forwardRef(({ className, asChild = false, .
3760
3960
  );
3761
3961
  });
3762
3962
  SidebarGroupActionBase.displayName = "SidebarGroupActionBase";
3763
- var SidebarGroupContentBase = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3963
+ var SidebarGroupContentBase = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3764
3964
  "div",
3765
3965
  {
3766
3966
  ref,
@@ -3770,7 +3970,7 @@ var SidebarGroupContentBase = React22.forwardRef(({ className, ...props }, ref)
3770
3970
  }
3771
3971
  ));
3772
3972
  SidebarGroupContentBase.displayName = "SidebarGroupContentBase";
3773
- var SidebarMenuBase = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3973
+ var SidebarMenuBase = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3774
3974
  "ul",
3775
3975
  {
3776
3976
  ref,
@@ -3780,7 +3980,7 @@ var SidebarMenuBase = React22.forwardRef(({ className, ...props }, ref) => /* @_
3780
3980
  }
3781
3981
  ));
3782
3982
  SidebarMenuBase.displayName = "SidebarMenuBase";
3783
- var SidebarMenuItemBase = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3983
+ var SidebarMenuItemBase = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3784
3984
  "li",
3785
3985
  {
3786
3986
  ref,
@@ -3790,7 +3990,7 @@ var SidebarMenuItemBase = React22.forwardRef(({ className, ...props }, ref) => /
3790
3990
  }
3791
3991
  ));
3792
3992
  SidebarMenuItemBase.displayName = "SidebarMenuItemBase";
3793
- var sidebarMenuButtonVariants = (0, import_class_variance_authority4.cva)(
3993
+ var sidebarMenuButtonVariants = (0, import_class_variance_authority5.cva)(
3794
3994
  "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
3795
3995
  {
3796
3996
  variants: {
@@ -3810,7 +4010,7 @@ var sidebarMenuButtonVariants = (0, import_class_variance_authority4.cva)(
3810
4010
  }
3811
4011
  }
3812
4012
  );
3813
- var SidebarMenuButtonBase = React22.forwardRef(
4013
+ var SidebarMenuButtonBase = React23.forwardRef(
3814
4014
  ({
3815
4015
  asChild = false,
3816
4016
  isActive = false,
@@ -3822,7 +4022,7 @@ var SidebarMenuButtonBase = React22.forwardRef(
3822
4022
  }, ref) => {
3823
4023
  const Comp = asChild ? import_react_slot5.Slot : "button";
3824
4024
  const { isMobile, state } = UseSideBarBase();
3825
- const button = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4025
+ const button = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3826
4026
  Comp,
3827
4027
  {
3828
4028
  ref,
@@ -3841,9 +4041,9 @@ var SidebarMenuButtonBase = React22.forwardRef(
3841
4041
  children: tooltip
3842
4042
  };
3843
4043
  }
3844
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(TooltipBase, { children: [
3845
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipTriggerBase, { asChild: true, children: button }),
3846
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4044
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(TooltipBase, { children: [
4045
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipTriggerBase, { asChild: true, children: button }),
4046
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3847
4047
  TooltipContentBase,
3848
4048
  {
3849
4049
  side: "right",
@@ -3856,9 +4056,9 @@ var SidebarMenuButtonBase = React22.forwardRef(
3856
4056
  }
3857
4057
  );
3858
4058
  SidebarMenuButtonBase.displayName = "SidebarMenuButtonBase";
3859
- var SidebarMenuActionBase = React22.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
4059
+ var SidebarMenuActionBase = React23.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
3860
4060
  const Comp = asChild ? import_react_slot5.Slot : "button";
3861
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4061
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3862
4062
  Comp,
3863
4063
  {
3864
4064
  ref,
@@ -3879,7 +4079,7 @@ var SidebarMenuActionBase = React22.forwardRef(({ className, asChild = false, sh
3879
4079
  );
3880
4080
  });
3881
4081
  SidebarMenuActionBase.displayName = "SidebarMenuActionBase";
3882
- var SidebarMenuBadgeBase = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4082
+ var SidebarMenuBadgeBase = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3883
4083
  "div",
3884
4084
  {
3885
4085
  ref,
@@ -3897,11 +4097,11 @@ var SidebarMenuBadgeBase = React22.forwardRef(({ className, ...props }, ref) =>
3897
4097
  }
3898
4098
  ));
3899
4099
  SidebarMenuBadgeBase.displayName = "SidebarMenuBadgeBase";
3900
- var SidebarMenuSkeletonBase = React22.forwardRef(({ className, showIcon = false, ...props }, ref) => {
3901
- const width = React22.useMemo(() => {
4100
+ var SidebarMenuSkeletonBase = React23.forwardRef(({ className, showIcon = false, ...props }, ref) => {
4101
+ const width = React23.useMemo(() => {
3902
4102
  return `${Math.floor(Math.random() * 40) + 50}%`;
3903
4103
  }, []);
3904
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4104
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3905
4105
  "div",
3906
4106
  {
3907
4107
  ref,
@@ -3909,14 +4109,14 @@ var SidebarMenuSkeletonBase = React22.forwardRef(({ className, showIcon = false,
3909
4109
  className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
3910
4110
  ...props,
3911
4111
  children: [
3912
- showIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4112
+ showIcon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3913
4113
  SkeletonBase,
3914
4114
  {
3915
4115
  className: "size-4 rounded-md",
3916
4116
  "data-sidebar": "menu-skeleton-icon"
3917
4117
  }
3918
4118
  ),
3919
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4119
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3920
4120
  SkeletonBase,
3921
4121
  {
3922
4122
  className: "h-4 max-w-[--skeleton-width] flex-1",
@@ -3931,7 +4131,7 @@ var SidebarMenuSkeletonBase = React22.forwardRef(({ className, showIcon = false,
3931
4131
  );
3932
4132
  });
3933
4133
  SidebarMenuSkeletonBase.displayName = "SidebarMenuSkeletonBase";
3934
- var SidebarMenuSubBase = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4134
+ var SidebarMenuSubBase = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3935
4135
  "ul",
3936
4136
  {
3937
4137
  ref,
@@ -3945,11 +4145,11 @@ var SidebarMenuSubBase = React22.forwardRef(({ className, ...props }, ref) => /*
3945
4145
  }
3946
4146
  ));
3947
4147
  SidebarMenuSubBase.displayName = "SidebarMenuSubBase";
3948
- var SidebarMenuSubItemBase = React22.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { ref, ...props }));
4148
+ var SidebarMenuSubItemBase = React23.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { ref, ...props }));
3949
4149
  SidebarMenuSubItemBase.displayName = "SidebarMenuSubItemBase";
3950
- var SidebarMenuSubButtonBase = React22.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
4150
+ var SidebarMenuSubButtonBase = React23.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
3951
4151
  const Comp = asChild ? import_react_slot5.Slot : "a";
3952
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4152
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3953
4153
  Comp,
3954
4154
  {
3955
4155
  ref,
@@ -3971,10 +4171,10 @@ var SidebarMenuSubButtonBase = React22.forwardRef(({ asChild = false, size = "md
3971
4171
  SidebarMenuSubButtonBase.displayName = "SidebarMenuSubButtonBase";
3972
4172
 
3973
4173
  // src/components/ui/SliderBase.tsx
3974
- var React23 = __toESM(require("react"));
4174
+ var React24 = __toESM(require("react"));
3975
4175
  var SliderPrimitive = __toESM(require("@radix-ui/react-slider"));
3976
- var import_jsx_runtime34 = require("react/jsx-runtime");
3977
- var SlideBase = React23.forwardRef(
4176
+ var import_jsx_runtime35 = require("react/jsx-runtime");
4177
+ var SlideBase = React24.forwardRef(
3978
4178
  ({
3979
4179
  className,
3980
4180
  orientation = "horizontal",
@@ -3984,7 +4184,7 @@ var SlideBase = React23.forwardRef(
3984
4184
  ...props
3985
4185
  }, ref) => {
3986
4186
  const isVertical = orientation === "vertical";
3987
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4187
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3988
4188
  "div",
3989
4189
  {
3990
4190
  className: cn(
@@ -3992,8 +4192,8 @@ var SlideBase = React23.forwardRef(
3992
4192
  isVertical ? "h-full " : "w-full"
3993
4193
  ),
3994
4194
  children: [
3995
- label && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LabelBase_default, { className: "py-2", children: label }),
3996
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4195
+ label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LabelBase_default, { className: "py-2", children: label }),
4196
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3997
4197
  "div",
3998
4198
  {
3999
4199
  className: cn(
@@ -4001,8 +4201,8 @@ var SlideBase = React23.forwardRef(
4001
4201
  isVertical ? "flex-col h-full" : "flex-row items-center w-full"
4002
4202
  ),
4003
4203
  children: [
4004
- leftIcon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
4005
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4204
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
4205
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
4006
4206
  SliderPrimitive.Root,
4007
4207
  {
4008
4208
  ref,
@@ -4014,14 +4214,14 @@ var SlideBase = React23.forwardRef(
4014
4214
  ),
4015
4215
  ...props,
4016
4216
  children: [
4017
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4217
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4018
4218
  SliderPrimitive.Track,
4019
4219
  {
4020
4220
  className: cn(
4021
4221
  "relative overflow-hidden bg-primary/20 rounded-full",
4022
4222
  isVertical ? "w-1.5 h-full" : "h-1.5 w-full"
4023
4223
  ),
4024
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4224
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4025
4225
  SliderPrimitive.Range,
4026
4226
  {
4027
4227
  className: cn(
@@ -4032,7 +4232,7 @@ var SlideBase = React23.forwardRef(
4032
4232
  )
4033
4233
  }
4034
4234
  ),
4035
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4235
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4036
4236
  SliderPrimitive.Thumb,
4037
4237
  {
4038
4238
  className: cn(
@@ -4045,7 +4245,7 @@ var SlideBase = React23.forwardRef(
4045
4245
  ]
4046
4246
  }
4047
4247
  ),
4048
- rightIcon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
4248
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
4049
4249
  ]
4050
4250
  }
4051
4251
  )
@@ -4059,10 +4259,10 @@ SlideBase.displayName = "SlideBase";
4059
4259
  // src/components/ui/SonnerBase.tsx
4060
4260
  var import_react22 = require("@phosphor-icons/react");
4061
4261
  var import_sonner = require("sonner");
4062
- var import_jsx_runtime35 = require("react/jsx-runtime");
4262
+ var import_jsx_runtime36 = require("react/jsx-runtime");
4063
4263
  var iconBaseClass = "w-5 h-auto";
4064
4264
  var Toaster = ({ testId, ...props }) => {
4065
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4265
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4066
4266
  import_sonner.Toaster,
4067
4267
  {
4068
4268
  className: "toaster group",
@@ -4109,33 +4309,33 @@ var Toaster = ({ testId, ...props }) => {
4109
4309
  };
4110
4310
  var toast = {
4111
4311
  success: (message) => import_sonner.toast.success(message, {
4112
- icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react22.CheckCircleIcon, { className: `${iconBaseClass} text-green-600`, weight: "fill" }),
4312
+ icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react22.CheckCircleIcon, { className: `${iconBaseClass} text-green-600`, weight: "fill" }),
4113
4313
  className: "sonner-success"
4114
4314
  }),
4115
4315
  error: (message) => import_sonner.toast.error(message, {
4116
- icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react22.XCircleIcon, { className: `${iconBaseClass} text-red-600`, weight: "fill" }),
4316
+ icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react22.XCircleIcon, { className: `${iconBaseClass} text-red-600`, weight: "fill" }),
4117
4317
  className: "sonner-error"
4118
4318
  }),
4119
4319
  warning: (message) => import_sonner.toast.warning(message, {
4120
- icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react22.WarningIcon, { className: `${iconBaseClass} text-yellow-600`, weight: "fill" }),
4320
+ icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react22.WarningIcon, { className: `${iconBaseClass} text-yellow-600`, weight: "fill" }),
4121
4321
  className: "sonner-WarningIcon"
4122
4322
  }),
4123
4323
  info: (message) => import_sonner.toast.info(message, {
4124
- icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react22.InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
4324
+ icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react22.InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
4125
4325
  className: "sonner-InfoIcon"
4126
4326
  }),
4127
4327
  loading: (message) => (0, import_sonner.toast)(message, {
4128
- icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react22.SpinnerIcon, { className: `${iconBaseClass} animate-spin text-neutral-500`, weight: "fill" }),
4328
+ icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react22.SpinnerIcon, { className: `${iconBaseClass} animate-spin text-neutral-500`, weight: "fill" }),
4129
4329
  className: "sonner-loading"
4130
4330
  })
4131
4331
  };
4132
4332
 
4133
4333
  // src/components/ui/SwitchBase.tsx
4134
- var React24 = __toESM(require("react"));
4334
+ var React25 = __toESM(require("react"));
4135
4335
  var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"));
4136
- var import_jsx_runtime36 = require("react/jsx-runtime");
4137
- var SwitchBase = React24.forwardRef(({ className, testid: dataTestId = "switch-base", ...props }, ref) => {
4138
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4336
+ var import_jsx_runtime37 = require("react/jsx-runtime");
4337
+ var SwitchBase = React25.forwardRef(({ className, testid: dataTestId = "switch-base", ...props }, ref) => {
4338
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4139
4339
  SwitchPrimitives.Root,
4140
4340
  {
4141
4341
  ...props,
@@ -4145,7 +4345,7 @@ var SwitchBase = React24.forwardRef(({ className, testid: dataTestId = "switch-b
4145
4345
  className
4146
4346
  ),
4147
4347
  "data-testid": dataTestId,
4148
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4348
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4149
4349
  SwitchPrimitives.Thumb,
4150
4350
  {
4151
4351
  className: cn(
@@ -4163,9 +4363,9 @@ var SwitchBase = React24.forwardRef(({ className, testid: dataTestId = "switch-b
4163
4363
  SwitchBase.displayName = SwitchPrimitives.Root.displayName;
4164
4364
 
4165
4365
  // src/components/ui/TableBase.tsx
4166
- var React25 = __toESM(require("react"));
4167
- var import_jsx_runtime37 = require("react/jsx-runtime");
4168
- var TableBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4366
+ var React26 = __toESM(require("react"));
4367
+ var import_jsx_runtime38 = require("react/jsx-runtime");
4368
+ var TableBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4169
4369
  "table",
4170
4370
  {
4171
4371
  ref,
@@ -4174,9 +4374,9 @@ var TableBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE_
4174
4374
  }
4175
4375
  ) }));
4176
4376
  TableBase.displayName = "TableBase";
4177
- var TableHeaderBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
4377
+ var TableHeaderBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
4178
4378
  TableHeaderBase.displayName = "TableHeaderBase";
4179
- var TableBodyBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4379
+ var TableBodyBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4180
4380
  "tbody",
4181
4381
  {
4182
4382
  ref,
@@ -4185,7 +4385,7 @@ var TableBodyBase = React25.forwardRef(({ className, ...props }, ref) => /* @__P
4185
4385
  }
4186
4386
  ));
4187
4387
  TableBodyBase.displayName = "TableBodyBase";
4188
- var TableFooterBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4388
+ var TableFooterBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4189
4389
  "tfoot",
4190
4390
  {
4191
4391
  ref,
@@ -4197,7 +4397,7 @@ var TableFooterBase = React25.forwardRef(({ className, ...props }, ref) => /* @_
4197
4397
  }
4198
4398
  ));
4199
4399
  TableFooterBase.displayName = "TableFooterBase";
4200
- var TableRowBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4400
+ var TableRowBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4201
4401
  "tr",
4202
4402
  {
4203
4403
  ref,
@@ -4209,7 +4409,7 @@ var TableRowBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PU
4209
4409
  }
4210
4410
  ));
4211
4411
  TableRowBase.displayName = "TableRowBase";
4212
- var TableHeadBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4412
+ var TableHeadBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4213
4413
  "th",
4214
4414
  {
4215
4415
  ref,
@@ -4221,7 +4421,7 @@ var TableHeadBase = React25.forwardRef(({ className, ...props }, ref) => /* @__P
4221
4421
  }
4222
4422
  ));
4223
4423
  TableHeadBase.displayName = "TableHeadBase";
4224
- var TableCellBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4424
+ var TableCellBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4225
4425
  "td",
4226
4426
  {
4227
4427
  ref,
@@ -4233,7 +4433,7 @@ var TableCellBase = React25.forwardRef(({ className, ...props }, ref) => /* @__P
4233
4433
  }
4234
4434
  ));
4235
4435
  TableCellBase.displayName = "TableCellBase";
4236
- var TableCaptionBase = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4436
+ var TableCaptionBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4237
4437
  "caption",
4238
4438
  {
4239
4439
  ref,
@@ -4244,11 +4444,11 @@ var TableCaptionBase = React25.forwardRef(({ className, ...props }, ref) => /* @
4244
4444
  TableCaptionBase.displayName = "TableCaptionBase";
4245
4445
 
4246
4446
  // src/components/ui/TabsBase.tsx
4247
- var React26 = __toESM(require("react"));
4447
+ var React27 = __toESM(require("react"));
4248
4448
  var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
4249
- var import_jsx_runtime38 = require("react/jsx-runtime");
4449
+ var import_jsx_runtime39 = require("react/jsx-runtime");
4250
4450
  var TabsBase = TabsPrimitive.Root;
4251
- var TabsListBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4451
+ var TabsListBase = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4252
4452
  TabsPrimitive.List,
4253
4453
  {
4254
4454
  ref,
@@ -4260,7 +4460,7 @@ var TabsListBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PU
4260
4460
  }
4261
4461
  ));
4262
4462
  TabsListBase.displayName = TabsPrimitive.List.displayName;
4263
- var TabsTriggerBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4463
+ var TabsTriggerBase = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4264
4464
  TabsPrimitive.Trigger,
4265
4465
  {
4266
4466
  ref,
@@ -4278,7 +4478,7 @@ var TabsTriggerBase = React26.forwardRef(({ className, ...props }, ref) => /* @_
4278
4478
  ...props
4279
4479
  }
4280
4480
  ));
4281
- var TabsContentBase = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4481
+ var TabsContentBase = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4282
4482
  TabsPrimitive.Content,
4283
4483
  {
4284
4484
  ref,
@@ -4293,10 +4493,10 @@ var TabsContentBase = React26.forwardRef(({ className, ...props }, ref) => /* @_
4293
4493
  TabsContentBase.displayName = TabsPrimitive.Content.displayName;
4294
4494
 
4295
4495
  // src/components/ui/TextAreaBase.tsx
4296
- var React27 = __toESM(require("react"));
4297
- var import_jsx_runtime39 = require("react/jsx-runtime");
4298
- var TextAreaBase = React27.forwardRef(({ className, ...props }, ref) => {
4299
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4496
+ var React28 = __toESM(require("react"));
4497
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4498
+ var TextAreaBase = React28.forwardRef(({ className, ...props }, ref) => {
4499
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4300
4500
  "textarea",
4301
4501
  {
4302
4502
  className: cn(
@@ -4315,7 +4515,7 @@ var import_react24 = require("@phosphor-icons/react");
4315
4515
 
4316
4516
  // src/components/theme-provider.tsx
4317
4517
  var import_react23 = require("react");
4318
- var import_jsx_runtime40 = require("react/jsx-runtime");
4518
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4319
4519
  var initialState = {
4320
4520
  theme: "system",
4321
4521
  setTheme: () => null
@@ -4365,7 +4565,7 @@ function ThemeProviderBase({
4365
4565
  setThemeState(newTheme);
4366
4566
  };
4367
4567
  const value = { theme, setTheme };
4368
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
4568
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
4369
4569
  }
4370
4570
  var useTheme = () => {
4371
4571
  const context = (0, import_react23.useContext)(ThemeProviderContext);
@@ -4375,7 +4575,7 @@ var useTheme = () => {
4375
4575
  };
4376
4576
 
4377
4577
  // src/components/mode-toggle.tsx
4378
- var import_jsx_runtime41 = require("react/jsx-runtime");
4578
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4379
4579
  var themeLabels = {
4380
4580
  light: "Light",
4381
4581
  dark: "Dark",
@@ -4392,30 +4592,30 @@ function ModeToggleBase({
4392
4592
  }) {
4393
4593
  const { setTheme, theme: currentTheme } = useTheme();
4394
4594
  const isDark = currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches;
4395
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(DropDownMenuBase, { children: [
4396
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
4595
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DropDownMenuBase, { children: [
4596
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4397
4597
  ButtonBase,
4398
4598
  {
4399
4599
  variant: "ghost",
4400
4600
  size: "icon",
4401
4601
  className: "relative overflow-hidden border-transparent",
4402
4602
  children: [
4403
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4404
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react24.SunIcon, { className: `h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-90 scale-0" : "rotate-0 scale-100"}` }),
4405
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react24.MoonIcon, { className: `absolute h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-0 scale-100" : "rotate-90 scale-0"}` })
4603
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
4604
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react24.SunIcon, { className: `h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-90 scale-0" : "rotate-0 scale-100"}` }),
4605
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react24.MoonIcon, { className: `absolute h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-0 scale-100" : "rotate-90 scale-0"}` })
4406
4606
  ] }),
4407
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "sr-only", children: "Toggle theme" })
4607
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "sr-only", children: "Toggle theme" })
4408
4608
  ]
4409
4609
  }
4410
4610
  ) }),
4411
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DropDownMenuContentBase, { align: "end", className: "border-border bg-popover text-popover-foreground", children: themes.map((theme) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
4611
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DropDownMenuContentBase, { align: "end", className: "border-border bg-popover text-popover-foreground", children: themes.map((theme) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4412
4612
  DropDownMenuItemBase,
4413
4613
  {
4414
4614
  onClick: () => setTheme(theme),
4415
4615
  className: "flex items-center justify-between hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
4416
4616
  children: [
4417
4617
  themeLabels[theme],
4418
- currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react24.CheckIcon, { className: "h-4 w-4 opacity-100" })
4618
+ currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react24.CheckIcon, { className: "h-4 w-4 opacity-100" })
4419
4619
  ]
4420
4620
  },
4421
4621
  theme
@@ -4427,114 +4627,96 @@ function ModeToggleBase({
4427
4627
  var import_date_fns = require("date-fns");
4428
4628
 
4429
4629
  // src/components/date-time-picker/calendar.tsx
4430
- var React28 = __toESM(require("react"));
4630
+ var React29 = __toESM(require("react"));
4431
4631
  var import_react_day_picker2 = require("react-day-picker");
4432
4632
  var import_react25 = require("@phosphor-icons/react");
4433
4633
  var import_framer_motion6 = require("framer-motion");
4434
- var import_jsx_runtime42 = require("react/jsx-runtime");
4435
- var variants = {
4436
- enter: (direction) => ({
4437
- opacity: 0,
4438
- x: direction > 0 ? 30 : -30
4439
- }),
4440
- center: {
4441
- opacity: 1,
4442
- x: 0
4443
- },
4444
- exit: (direction) => ({
4445
- opacity: 0,
4446
- x: direction > 0 ? -30 : 30
4447
- })
4448
- };
4634
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4449
4635
  function CalendarBase2({
4450
4636
  className,
4451
4637
  classNames,
4452
4638
  showOutsideDays = true,
4453
4639
  ...props
4454
4640
  }) {
4455
- const [month, setMonth] = React28.useState(
4641
+ const [month, setMonth] = React29.useState(
4456
4642
  props.month || props.defaultMonth || /* @__PURE__ */ new Date()
4457
4643
  );
4458
- const [direction, setDirection] = React28.useState(1);
4644
+ const [direction, setDirection] = React29.useState(1);
4459
4645
  const handleMonthChange = (newMonth) => {
4460
4646
  const isNext = newMonth > month ? 1 : -1;
4461
4647
  setDirection(isNext);
4462
4648
  setMonth(newMonth);
4463
4649
  props.onMonthChange?.(newMonth);
4464
4650
  };
4465
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4651
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4466
4652
  "div",
4467
4653
  {
4468
4654
  className: cn(
4469
- "rounded-xl border bg-background p-3 shadow-sm overflow-hidden",
4655
+ "rounded-2xl border bg-background p-4 shadow-lg overflow-hidden w-full h-full flex flex-col",
4470
4656
  className
4471
4657
  ),
4472
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4473
- import_framer_motion6.motion.div,
4658
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_framer_motion6.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4659
+ "div",
4474
4660
  {
4475
- variants,
4476
- initial: "enter",
4477
- animate: "center",
4478
- exit: "exit",
4479
- custom: direction,
4480
- transition: { duration: 0.3, ease: "easeInOut" },
4481
- style: { position: "relative" },
4482
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4661
+ className: "w-full h-full flex flex-col",
4662
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4483
4663
  import_react_day_picker2.DayPicker,
4484
4664
  {
4485
4665
  showOutsideDays,
4486
4666
  month,
4487
4667
  onMonthChange: handleMonthChange,
4488
- className: "w-full",
4668
+ className: "w-full h-full min-w-0 flex flex-col",
4489
4669
  classNames: {
4490
- months: "flex items-center flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
4491
- month: "space-y-4",
4492
- caption: "flex justify-center pt-1 relative items-center",
4493
- caption_label: "text-sm font-medium",
4670
+ months: "flex items-center flex-col sm:flex-row space-y-2 sm:space-x-2 sm:space-y-0 flex-1",
4671
+ month: "space-y-2 min-w-0 flex-1 flex flex-col",
4672
+ caption: "flex justify-center pt-1 relative items-center h-[10%] min-h-[2rem] mb-2",
4673
+ caption_label: "text-[clamp(0.875rem,2.5vw,1.25rem)] font-semibold truncate px-10 tracking-tight",
4494
4674
  nav: "space-x-1 flex items-center",
4495
4675
  nav_button: cn(
4496
4676
  buttonVariantsBase({ variant: "outline" }),
4497
- "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
4677
+ "h-8 w-8 bg-background p-0 opacity-60 hover:opacity-100 hover:bg-muted flex-shrink-0 touch-manipulation transition-all duration-200 ease-out hover:scale-105 active:scale-95",
4678
+ "[@media(min-width:400px)]:h-9 [@media(min-width:400px)]:w-9"
4498
4679
  ),
4499
- nav_button_previous: "absolute left-1",
4500
- nav_button_next: "absolute right-1",
4501
- table: "w-full border-collapse space-y-1",
4502
- head_row: "flex",
4503
- head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4504
- row: "flex w-full mt-2",
4680
+ nav_button_previous: "absolute left-0",
4681
+ nav_button_next: "absolute right-0",
4682
+ table: "w-full border-collapse min-w-0 flex-1 flex flex-col",
4683
+ head_row: "flex w-full gap-1 mb-1",
4684
+ head_cell: "text-muted-foreground rounded-md flex-1 min-w-0 font-semibold text-[clamp(0.625rem,1.5vw,0.75rem)] text-center pb-1 uppercase tracking-wider",
4685
+ row: "flex w-full flex-1 gap-1",
4505
4686
  cell: cn(
4506
- "h-9 w-9 text-center text-sm p-0 relative",
4507
- "[&:has([aria-selected].day-range-end)]:rounded-r-md",
4508
- "[&:has([aria-selected].day-range-start)]:rounded-l-md",
4687
+ "flex-1 min-w-0 aspect-square text-center p-0 relative",
4688
+ "[&:has([aria-selected].day-range-end)]:rounded-r-lg",
4689
+ "[&:has([aria-selected].day-range-start)]:rounded-l-lg",
4509
4690
  "[&:has([aria-selected].day-outside)]:bg-muted/50",
4510
4691
  "[&:has([aria-selected])]:bg-muted",
4511
- "first:[&:has([aria-selected])]:rounded-l-md",
4512
- "last:[&:has([aria-selected])]:rounded-r-md",
4692
+ "first:[&:has([aria-selected])]:rounded-l-lg",
4693
+ "last:[&:has([aria-selected])]:rounded-r-lg",
4513
4694
  "focus-within:relative focus-within:z-20"
4514
4695
  ),
4515
4696
  day: cn(
4516
4697
  buttonVariantsBase({ variant: "ghost" }),
4517
- "h-9 w-9 p-0 font-normal rounded-md",
4518
- "aria-selected:opacity-100 hover:bg-muted"
4698
+ "w-full h-full p-0 rounded-lg",
4699
+ "aria-selected:opacity-100 hover:bg-muted text-[clamp(0.75rem,2vw,1rem)] flex items-center justify-center",
4700
+ "touch-manipulation transition-all duration-200 ease-out hover:scale-105 active:scale-95"
4519
4701
  ),
4520
- day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90",
4521
- day_today: "bg-muted text-foreground dark:bg-muted dark:text-foreground",
4522
- day_outside: "day-outside text-gray-500 opacity-50 aria-selected:bg-muted/50 aria-selected:text-black",
4523
- day_disabled: "text-gray-500",
4702
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold",
4703
+ day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset",
4704
+ day_outside: "day-outside text-muted-foreground/40 opacity-40 aria-selected:bg-muted/50 aria-selected:text-foreground",
4705
+ day_disabled: "text-muted-foreground/30 opacity-40 cursor-not-allowed",
4524
4706
  day_range_middle: "aria-selected:bg-muted aria-selected:text-foreground",
4525
4707
  day_hidden: "invisible",
4526
4708
  ...classNames
4527
4709
  },
4528
4710
  components: {
4529
- IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react25.CaretLeftIcon, { className: "h-4 w-4" }),
4530
- IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react25.CaretRightIcon, { className: "h-4 w-4" })
4711
+ IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react25.CaretLeftIcon, { className: "h-4 w-4" }),
4712
+ IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react25.CaretRightIcon, { className: "h-4 w-4" })
4531
4713
  },
4532
4714
  ...props
4533
4715
  }
4534
4716
  )
4535
4717
  },
4536
4718
  month.toISOString()
4537
- )
4719
+ ) }) })
4538
4720
  }
4539
4721
  );
4540
4722
  }
@@ -4545,11 +4727,12 @@ var import_locale = require("date-fns/locale");
4545
4727
  var import_react28 = require("react");
4546
4728
 
4547
4729
  // src/components/date-time-picker/TimePicker.tsx
4548
- var import_react27 = require("@phosphor-icons/react");
4549
- var React30 = __toESM(require("react"));
4730
+ var import_framer_motion7 = require("framer-motion");
4731
+ var React31 = __toESM(require("react"));
4550
4732
 
4551
4733
  // src/components/date-time-picker/TimePickerInput.tsx
4552
- var import_react26 = __toESM(require("react"));
4734
+ var import_react26 = require("@phosphor-icons/react");
4735
+ var import_react27 = __toESM(require("react"));
4553
4736
 
4554
4737
  // src/components/date-time-picker/time-picker-utils.ts
4555
4738
  function isValidHour(value) {
@@ -4691,8 +4874,8 @@ function display12HourValue(hours) {
4691
4874
  }
4692
4875
 
4693
4876
  // src/components/date-time-picker/TimePickerInput.tsx
4694
- var import_jsx_runtime43 = require("react/jsx-runtime");
4695
- var TimePickerInput = import_react26.default.forwardRef(
4877
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4878
+ var TimePickerInput = import_react27.default.forwardRef(
4696
4879
  ({
4697
4880
  className,
4698
4881
  type = "tel",
@@ -4707,11 +4890,14 @@ var TimePickerInput = import_react26.default.forwardRef(
4707
4890
  period,
4708
4891
  onLeftFocus,
4709
4892
  onRightFocus,
4893
+ showArrows = true,
4894
+ label,
4710
4895
  ...props
4711
4896
  }, ref) => {
4712
- const [flag, setFlag] = import_react26.default.useState(false);
4713
- const [prevIntKey, setPrevIntKey] = import_react26.default.useState("0");
4714
- import_react26.default.useEffect(() => {
4897
+ const [flag, setFlag] = import_react27.default.useState(false);
4898
+ const [prevIntKey, setPrevIntKey] = import_react27.default.useState("0");
4899
+ const [isFocused, setIsFocused] = import_react27.default.useState(false);
4900
+ import_react27.default.useEffect(() => {
4715
4901
  if (flag) {
4716
4902
  const timer = setTimeout(() => {
4717
4903
  setFlag(false);
@@ -4719,7 +4905,7 @@ var TimePickerInput = import_react26.default.forwardRef(
4719
4905
  return () => clearTimeout(timer);
4720
4906
  }
4721
4907
  }, [flag]);
4722
- const calculatedValue = import_react26.default.useMemo(() => {
4908
+ const calculatedValue = import_react27.default.useMemo(() => {
4723
4909
  return getDateByType(date, picker);
4724
4910
  }, [date, picker]);
4725
4911
  const calculateNewValue = (key) => {
@@ -4729,6 +4915,13 @@ var TimePickerInput = import_react26.default.forwardRef(
4729
4915
  }
4730
4916
  return !flag ? "0" + key : calculatedValue.slice(1, 2) + key;
4731
4917
  };
4918
+ const handleArrowClick = (direction) => {
4919
+ const step = direction === "up" ? 1 : -1;
4920
+ const newValue = getArrowByType(calculatedValue, step, picker);
4921
+ if (flag) setFlag(false);
4922
+ const tempDate = new Date(date);
4923
+ setDate(setDateByType(tempDate, newValue, picker, period));
4924
+ };
4732
4925
  const handleKeyDown = (e) => {
4733
4926
  if (e.key === "Tab") return;
4734
4927
  e.preventDefault();
@@ -4750,173 +4943,399 @@ var TimePickerInput = import_react26.default.forwardRef(
4750
4943
  setDate(setDateByType(tempDate, newValue, picker, period));
4751
4944
  }
4752
4945
  };
4753
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4754
- InputBase,
4755
- {
4756
- ref,
4757
- id: id || picker,
4758
- name: name || picker,
4759
- className: cn(
4760
- "focus:bg-accent focus:text-accent-foreground w-[48px] text-center font-mono text-base tabular-nums caret-transparent [&::-webkit-inner-spin-button]:appearance-none",
4761
- className
4762
- ),
4763
- value: value || calculatedValue,
4764
- onChange: (e) => {
4765
- e.preventDefault();
4766
- onChange?.(e);
4767
- },
4768
- type,
4769
- inputMode: "decimal",
4770
- onKeyDown: (e) => {
4771
- onKeyDown?.(e);
4772
- handleKeyDown(e);
4773
- },
4774
- ...props
4946
+ const getPickerLabel = () => {
4947
+ if (label) return label;
4948
+ switch (picker) {
4949
+ case "hours":
4950
+ case "12hours":
4951
+ return "Horas";
4952
+ case "minutes":
4953
+ return "Minutos";
4954
+ case "seconds":
4955
+ return "Segundos";
4956
+ default:
4957
+ return "";
4775
4958
  }
4776
- );
4777
- }
4778
- );
4779
- TimePickerInput.displayName = "TimePickerInput";
4780
-
4781
- // src/components/date-time-picker/TimePicker.tsx
4782
- var import_jsx_runtime44 = require("react/jsx-runtime");
4783
- function TimePicker({ date, setDate, hideSeconds }) {
4784
- const minuteRef = React30.useRef(null);
4785
- const hourRef = React30.useRef(null);
4786
- const secondRef = React30.useRef(null);
4787
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-end gap-2", children: [
4788
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid gap-1 text-center", children: [
4789
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LabelBase_default, { htmlFor: "hours", className: "text-xs", children: "Horas" }),
4790
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4791
- TimePickerInput,
4959
+ };
4960
+ const getAriaLabel = () => {
4961
+ const baseLabel = getPickerLabel();
4962
+ return `${baseLabel}, valor atual: ${calculatedValue}.`;
4963
+ };
4964
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative group flex flex-col items-center", children: [
4965
+ getPickerLabel() && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4966
+ "label",
4792
4967
  {
4793
- picker: "hours",
4794
- date,
4795
- setDate,
4796
- ref: hourRef,
4797
- onRightFocus: () => minuteRef.current?.focus()
4968
+ htmlFor: id || picker,
4969
+ className: "text-xs sm:text-sm font-medium text-muted-foreground mb-1 sm:mb-2 select-none",
4970
+ children: getPickerLabel()
4798
4971
  }
4799
- )
4800
- ] }),
4801
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid gap-1 text-center", children: [
4802
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LabelBase_default, { htmlFor: "minutes", className: "text-xs", children: "Minutos" }),
4803
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4804
- TimePickerInput,
4972
+ ),
4973
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4974
+ "div",
4805
4975
  {
4806
- picker: "minutes",
4807
- date,
4808
- setDate,
4809
- ref: minuteRef,
4810
- onLeftFocus: () => hourRef.current?.focus(),
4811
- onRightFocus: () => secondRef.current?.focus()
4976
+ className: cn(
4977
+ "relative flex flex-col items-center",
4978
+ "transition-all duration-200"
4979
+ ),
4980
+ children: [
4981
+ showArrows && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4982
+ "button",
4983
+ {
4984
+ type: "button",
4985
+ onClick: () => handleArrowClick("up"),
4986
+ className: cn(
4987
+ "flex items-center justify-center w-10 sm:w-12 h-5 sm:h-6 mb-1",
4988
+ "rounded-t",
4989
+ "bg-background hover:bg-accent active:bg-accent/80 transition-colors",
4990
+ "text-muted-foreground hover:text-foreground",
4991
+ "focus:outline-none focus:ring-1 focus:ring-ring",
4992
+ "touch-manipulation",
4993
+ isFocused && "border-ring"
4994
+ ),
4995
+ tabIndex: -1,
4996
+ "aria-label": `Incrementar ${getPickerLabel().toLowerCase()}`,
4997
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react26.CaretUpIcon, { size: 14, className: "sm:w-4 sm:h-4" })
4998
+ }
4999
+ ),
5000
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative", children: [
5001
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5002
+ "input",
5003
+ {
5004
+ ref,
5005
+ id: id || picker,
5006
+ name: name || picker,
5007
+ className: cn(
5008
+ "w-16 sm:w-20 h-10 sm:h-12 text-center font-mono text-lg sm:text-xl font-semibold",
5009
+ "border-2 rounded-lg",
5010
+ "bg-background text-foreground",
5011
+ "transition-all duration-200",
5012
+ "focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring",
5013
+ "selection:bg-primary selection:text-primary-foreground",
5014
+ "touch-manipulation",
5015
+ showArrows && "rounded-lg",
5016
+ isFocused && "ring-2 ring-ring border-ring shadow-md",
5017
+ className
5018
+ ),
5019
+ value: value || calculatedValue,
5020
+ onChange: (e) => {
5021
+ e.preventDefault();
5022
+ onChange?.(e);
5023
+ },
5024
+ onFocus: (e) => {
5025
+ setIsFocused(true);
5026
+ props.onFocus?.(e);
5027
+ e.target.select();
5028
+ },
5029
+ onBlur: (e) => {
5030
+ setIsFocused(false);
5031
+ props.onBlur?.(e);
5032
+ },
5033
+ type,
5034
+ inputMode: "decimal",
5035
+ onKeyDown: (e) => {
5036
+ onKeyDown?.(e);
5037
+ handleKeyDown(e);
5038
+ },
5039
+ "aria-label": getAriaLabel(),
5040
+ "aria-describedby": `${id || picker}-help`,
5041
+ autoComplete: "off",
5042
+ spellCheck: false,
5043
+ ...props
5044
+ }
5045
+ ),
5046
+ isFocused && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "absolute inset-0 rounded-lg ring-2 ring-primary/20 pointer-events-none animate-pulse" })
5047
+ ] }),
5048
+ showArrows && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5049
+ "button",
5050
+ {
5051
+ type: "button",
5052
+ onClick: () => handleArrowClick("down"),
5053
+ className: cn(
5054
+ "flex items-center justify-center w-10 sm:w-12 h-5 sm:h-6 mt-1",
5055
+ "rounded-b",
5056
+ "bg-background hover:bg-accent active:bg-accent/80 transition-colors",
5057
+ "text-muted-foreground hover:text-foreground",
5058
+ "focus:outline-none focus:ring-1 focus:ring-ring",
5059
+ "touch-manipulation",
5060
+ isFocused && "border-ring"
5061
+ ),
5062
+ tabIndex: -1,
5063
+ "aria-label": `Decrementar ${getPickerLabel().toLowerCase()}`,
5064
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react26.CaretDownIcon, { size: 14, className: "sm:w-4 sm:h-4" })
5065
+ }
5066
+ )
5067
+ ]
4812
5068
  }
4813
5069
  )
4814
- ] }),
4815
- !hideSeconds && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid gap-1 text-center", children: [
4816
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LabelBase_default, { htmlFor: "seconds", className: "text-xs", children: "Segundos" }),
4817
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4818
- TimePickerInput,
4819
- {
4820
- picker: "seconds",
4821
- date,
4822
- setDate,
4823
- ref: secondRef,
4824
- onLeftFocus: () => minuteRef.current?.focus()
4825
- }
4826
- )
4827
- ] }),
4828
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex h-10 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react27.ClockIcon, { className: "ml-2 h-4 w-4" }) })
4829
- ] });
5070
+ ] });
5071
+ }
5072
+ );
5073
+ TimePickerInput.displayName = "TimePickerInput";
5074
+
5075
+ // src/components/date-time-picker/TimePicker.tsx
5076
+ var import_jsx_runtime45 = require("react/jsx-runtime");
5077
+ function TimePicker({
5078
+ date,
5079
+ setDate,
5080
+ hideSeconds,
5081
+ enableButton
5082
+ }) {
5083
+ const minuteRef = React31.useRef(null);
5084
+ const hourRef = React31.useRef(null);
5085
+ const secondRef = React31.useRef(null);
5086
+ const containerVariants = {
5087
+ hidden: { opacity: 0, y: 10 },
5088
+ visible: {
5089
+ opacity: 1,
5090
+ y: 0,
5091
+ transition: {
5092
+ duration: 0.3,
5093
+ staggerChildren: 0.1
5094
+ }
5095
+ }
5096
+ };
5097
+ const itemVariants2 = {
5098
+ hidden: { opacity: 0, y: 10 },
5099
+ visible: { opacity: 1, y: 0 }
5100
+ };
5101
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
5102
+ import_framer_motion7.motion.div,
5103
+ {
5104
+ variants: containerVariants,
5105
+ initial: "hidden",
5106
+ animate: "visible",
5107
+ className: "flex items-end justify-center gap-2 sm:gap-3 p-2 sm:p-3 md:p-4 rounded-lg bg-muted/20 border border-border/50 w-full max-w-full overflow-hidden",
5108
+ children: [
5109
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5110
+ import_framer_motion7.motion.div,
5111
+ {
5112
+ variants: itemVariants2,
5113
+ className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
5114
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5115
+ TimePickerInput,
5116
+ {
5117
+ picker: "hours",
5118
+ date,
5119
+ setDate,
5120
+ ref: hourRef,
5121
+ onRightFocus: () => minuteRef.current?.focus(),
5122
+ enableButton
5123
+ }
5124
+ )
5125
+ }
5126
+ ),
5127
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5128
+ import_framer_motion7.motion.div,
5129
+ {
5130
+ variants: itemVariants2,
5131
+ className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
5132
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5133
+ TimePickerInput,
5134
+ {
5135
+ picker: "minutes",
5136
+ date,
5137
+ setDate,
5138
+ ref: minuteRef,
5139
+ onLeftFocus: () => hourRef.current?.focus(),
5140
+ onRightFocus: () => secondRef.current?.focus(),
5141
+ enableButton
5142
+ }
5143
+ )
5144
+ }
5145
+ ),
5146
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_framer_motion7.AnimatePresence, { children: !hideSeconds && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5147
+ import_framer_motion7.motion.div,
5148
+ {
5149
+ variants: itemVariants2,
5150
+ initial: "hidden",
5151
+ animate: "visible",
5152
+ exit: "hidden",
5153
+ className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
5154
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5155
+ TimePickerInput,
5156
+ {
5157
+ picker: "seconds",
5158
+ date,
5159
+ setDate,
5160
+ ref: secondRef,
5161
+ onLeftFocus: () => minuteRef.current?.focus(),
5162
+ enableButton
5163
+ }
5164
+ )
5165
+ }
5166
+ ) }) })
5167
+ ]
5168
+ }
5169
+ );
4830
5170
  }
4831
5171
 
4832
5172
  // src/components/date-time-picker/DateTimePicker.tsx
4833
5173
  var import_react29 = require("@phosphor-icons/react");
4834
- var import_jsx_runtime45 = require("react/jsx-runtime");
5174
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4835
5175
  function DateTimePicker({
4836
5176
  label,
4837
5177
  date,
4838
5178
  onChange,
4839
5179
  hideSeconds,
5180
+ hideHour,
5181
+ hideMinute,
4840
5182
  fromDate,
4841
5183
  toDate,
4842
5184
  disabled,
4843
- dialogTitle
5185
+ className
4844
5186
  }) {
4845
5187
  const [internalDate, setInternalDate] = (0, import_react28.useState)(date);
5188
+ const [open, setOpen] = (0, import_react28.useState)(false);
5189
+ const [timePickerOpen, setTimePickerOpen] = (0, import_react28.useState)(false);
4846
5190
  const handleSelect = (newDay) => {
4847
5191
  if (!newDay) return;
4848
5192
  if (!internalDate) {
4849
5193
  setInternalDate(newDay);
5194
+ onChange(newDay);
4850
5195
  return;
4851
5196
  }
4852
5197
  const diff = newDay.getTime() - internalDate.getTime();
4853
5198
  const diffInDays = diff / (1e3 * 60 * 60 * 24);
4854
5199
  const newDateFull = (0, import_date_fns.add)(internalDate, { days: Math.ceil(diffInDays) });
4855
5200
  setInternalDate(newDateFull);
5201
+ onChange(newDateFull);
5202
+ };
5203
+ const handleTimeChange = (newDate) => {
5204
+ setInternalDate(newDate);
5205
+ onChange(newDate);
5206
+ };
5207
+ const getTimeFormat = () => {
5208
+ if (hideHour && hideMinute) return "";
5209
+ if (hideHour) return hideSeconds ? "mm" : "mm:ss";
5210
+ if (hideMinute) return hideSeconds ? "HH" : "HH':00'";
5211
+ return hideSeconds ? "HH:mm" : "HH:mm:ss";
5212
+ };
5213
+ const getDisplayFormat = () => {
5214
+ const timeFormat = getTimeFormat();
5215
+ if (!timeFormat) return "PPP";
5216
+ return `PPP - ${timeFormat}`;
4856
5217
  };
4857
- const [open, setOpen] = (0, import_react28.useState)(false);
4858
5218
  (0, import_react28.useEffect)(() => {
4859
5219
  if (date) {
4860
5220
  setInternalDate(date);
4861
5221
  }
4862
5222
  }, [date, open]);
4863
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
4864
- label && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LabelBase_default, { className: "mb-[-1rem] pl-2", children: label }),
4865
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogBase, { open, onOpenChange: setOpen, children: [
4866
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogTriggerBase, { disabled, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
5223
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("space-y-2 w-full sm:w-auto", className), children: [
5224
+ label && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LabelBase_default, { children: label }),
5225
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(PopoverBase, { open, onOpenChange: setOpen, children: [
5226
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PopoverTriggerBase, { disabled, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4867
5227
  ButtonBase,
4868
5228
  {
4869
- variant: "default",
5229
+ variant: "outline",
4870
5230
  size: "lg",
4871
5231
  className: cn(
4872
- "w-full justify-start text-left font-normal text-zinc-950",
5232
+ "w-full justify-start text-left min-w-0 overflow-hidden",
5233
+ "min-h-[44px] sm:min-h-[48px] px-3 sm:px-4",
5234
+ "text-sm sm:text-base",
4873
5235
  !date && "text-muted-foreground"
4874
5236
  ),
4875
5237
  children: [
4876
- date ? (0, import_date_fns.format)(date, "PPP - HH:mm", { locale: import_locale.ptBR }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-zinc-400", children: "Pick a date" }),
4877
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react29.CalendarIcon, { className: "ml-auto text-gray-500", size: 24 })
5238
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate flex-1", children: date ? (0, import_date_fns.format)(date, getDisplayFormat(), { locale: import_locale.ptBR }) : "Pick a date" }),
5239
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react29.CalendarBlankIcon, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
4878
5240
  ]
4879
5241
  }
4880
5242
  ) }),
4881
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogContentBase, { children: [
4882
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogHeaderBase, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogTitleBase, { className: "text-xl font-semibold", children: dialogTitle ?? "Selecione a data" }) }),
4883
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4884
- CalendarBase2,
4885
- {
4886
- mode: "single",
4887
- locale: import_locale.ptBR,
4888
- selected: internalDate,
4889
- onSelect: (d) => handleSelect(d),
4890
- initialFocus: true,
4891
- fromDate,
4892
- toDate
4893
- }
4894
- ),
4895
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "border-border flex justify-center border-t p-3", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4896
- TimePicker,
4897
- {
4898
- setDate: setInternalDate,
4899
- date: internalDate,
4900
- hideSeconds
4901
- }
4902
- ) }),
4903
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4904
- ButtonBase,
4905
- {
4906
- onClick: () => {
4907
- onChange(internalDate);
4908
- setOpen(false);
4909
- },
4910
- children: "Salvar"
4911
- }
4912
- )
4913
- ] })
5243
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5244
+ PopoverContentBase,
5245
+ {
5246
+ className: "w-full p-0",
5247
+ align: "center",
5248
+ sideOffset: 4,
5249
+ side: "bottom",
5250
+ avoidCollisions: true,
5251
+ collisionPadding: 8,
5252
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col space-y-2 sm:space-y-3 p-2 sm:p-3 md:p-4 max-h-[calc(100vh-4rem)] overflow-y-auto", children: [
5253
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5254
+ CalendarBase2,
5255
+ {
5256
+ mode: "single",
5257
+ locale: import_locale.ptBR,
5258
+ selected: internalDate,
5259
+ onSelect: (d) => handleSelect(d),
5260
+ initialFocus: true,
5261
+ fromDate,
5262
+ toDate,
5263
+ className: "w-full"
5264
+ }
5265
+ ),
5266
+ !(hideHour && hideMinute) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5267
+ PopoverBase,
5268
+ {
5269
+ open: timePickerOpen,
5270
+ onOpenChange: setTimePickerOpen,
5271
+ children: [
5272
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5273
+ ButtonBase,
5274
+ {
5275
+ variant: "outline",
5276
+ size: "default",
5277
+ className: cn(
5278
+ "flex items-center justify-center gap-1.5 sm:gap-2",
5279
+ "px-2 sm:px-3 py-1.5 sm:py-2",
5280
+ "text-sm sm:text-base font-semibold w-full max-w-xs",
5281
+ "border-2 border-primary/20 rounded-lg",
5282
+ "bg-primary/5 hover:bg-primary/10 hover:border-primary/30",
5283
+ "transition-all duration-200",
5284
+ "shadow-sm hover:shadow-md active:scale-[0.98]",
5285
+ "min-h-[36px] sm:min-h-[40px]"
5286
+ ),
5287
+ children: [
5288
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react29.ClockIcon, { className: "text-primary/70 flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
5289
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-foreground truncate", children: internalDate ? (0, import_date_fns.format)(internalDate, getTimeFormat() || "HH:mm", {
5290
+ locale: import_locale.ptBR
5291
+ }) : "00:00" })
5292
+ ]
5293
+ }
5294
+ ) }),
5295
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5296
+ PopoverContentBase,
5297
+ {
5298
+ className: "w-[calc(100vw-2rem)] max-w-sm p-3 sm:p-3 rounded-md",
5299
+ align: "center",
5300
+ side: "top",
5301
+ sideOffset: 8,
5302
+ avoidCollisions: true,
5303
+ collisionPadding: 8,
5304
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col items-center space-y-2 sm:space-y-3", children: [
5305
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h4", { className: "text-sm sm:text-base font-medium text-center", children: "Alterar Hor\xE1rio" }),
5306
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5307
+ TimePicker,
5308
+ {
5309
+ setDate: handleTimeChange,
5310
+ date: internalDate,
5311
+ hideSeconds
5312
+ }
5313
+ ),
5314
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5315
+ ButtonBase,
5316
+ {
5317
+ size: "sm",
5318
+ variant: "destructive",
5319
+ onClick: () => setTimePickerOpen(false),
5320
+ className: "w-full text-xs sm:text-sm min-h-[36px] sm:min-h-[40px]",
5321
+ children: "Fechar"
5322
+ }
5323
+ )
5324
+ ] })
5325
+ }
5326
+ )
5327
+ ]
5328
+ }
5329
+ ) })
5330
+ ] })
5331
+ }
5332
+ )
4914
5333
  ] })
4915
5334
  ] });
4916
5335
  }
4917
5336
 
4918
5337
  // src/components/selects/Select.tsx
4919
- var import_jsx_runtime46 = require("react/jsx-runtime");
5338
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4920
5339
  function Select({
4921
5340
  items,
4922
5341
  groupItems,
@@ -4925,9 +5344,9 @@ function Select({
4925
5344
  errorMessage,
4926
5345
  testIds = {}
4927
5346
  }) {
4928
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
4929
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(SelectBase, { onValueChange: onChange, "data-testid": testIds.base ?? "select-base", children: [
4930
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5347
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
5348
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(SelectBase, { onValueChange: onChange, "data-testid": testIds.base ?? "select-base", children: [
5349
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4931
5350
  SelectTriggerBase,
4932
5351
  {
4933
5352
  className: cn(
@@ -4935,7 +5354,7 @@ function Select({
4935
5354
  errorMessage && "border-red-500"
4936
5355
  ),
4937
5356
  "data-testid": testIds.trigger ?? "select-trigger",
4938
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5357
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4939
5358
  SelectValueBase,
4940
5359
  {
4941
5360
  placeholder,
@@ -4944,9 +5363,9 @@ function Select({
4944
5363
  )
4945
5364
  }
4946
5365
  ),
4947
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: [
4948
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectLabelBase, { "data-testid": testIds.label ?? "select-label", children: key }),
4949
- groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5366
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: [
5367
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectLabelBase, { "data-testid": testIds.label ?? "select-label", children: key }),
5368
+ groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4950
5369
  SelectItemBase,
4951
5370
  {
4952
5371
  value: item.value,
@@ -4955,7 +5374,7 @@ function Select({
4955
5374
  },
4956
5375
  item.value
4957
5376
  ))
4958
- ] }, key)) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5377
+ ] }, key)) }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4959
5378
  SelectItemBase,
4960
5379
  {
4961
5380
  value: item.value,
@@ -4965,7 +5384,7 @@ function Select({
4965
5384
  item.value
4966
5385
  )) }) }) })
4967
5386
  ] }),
4968
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5387
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4969
5388
  "p",
4970
5389
  {
4971
5390
  className: "text-sm text-red-500",
@@ -4977,9 +5396,9 @@ function Select({
4977
5396
  }
4978
5397
 
4979
5398
  // src/components/ui/DestructiveDialog.tsx
4980
- var React31 = __toESM(require("react"));
5399
+ var React32 = __toESM(require("react"));
4981
5400
  var import_react30 = require("@phosphor-icons/react");
4982
- var import_jsx_runtime47 = require("react/jsx-runtime");
5401
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4983
5402
  var DestructiveDialog = ({
4984
5403
  title,
4985
5404
  description,
@@ -4990,10 +5409,10 @@ var DestructiveDialog = ({
4990
5409
  }) => {
4991
5410
  const titleId = "destructive-dialog-title";
4992
5411
  const descriptionId = "destructive-dialog-description";
4993
- const triggerEl = React31.isValidElement(children) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AlertDialogTriggerBase, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
4994
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AlertDialogBase, { children: [
5412
+ const triggerEl = React32.isValidElement(children) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AlertDialogTriggerBase, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
5413
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(AlertDialogBase, { children: [
4995
5414
  triggerEl,
4996
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
5415
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
4997
5416
  AlertDialogContentBase,
4998
5417
  {
4999
5418
  role: "alertdialog",
@@ -5002,10 +5421,10 @@ var DestructiveDialog = ({
5002
5421
  "aria-describedby": descriptionId,
5003
5422
  className: cn("border border-destructive bg-background"),
5004
5423
  children: [
5005
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-start gap-4", children: [
5006
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react30.XCircleIcon, { className: "w-6 h-6 text-destructive" }) }),
5007
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex-1", children: [
5008
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5424
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-start gap-4", children: [
5425
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react30.XCircleIcon, { className: "w-6 h-6 text-destructive" }) }),
5426
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex-1", children: [
5427
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5009
5428
  AlertDialogTitleBase,
5010
5429
  {
5011
5430
  id: titleId,
@@ -5013,7 +5432,7 @@ var DestructiveDialog = ({
5013
5432
  children: title
5014
5433
  }
5015
5434
  ),
5016
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5435
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5017
5436
  AlertDialogDescriptionBase,
5018
5437
  {
5019
5438
  id: descriptionId,
@@ -5023,8 +5442,8 @@ var DestructiveDialog = ({
5023
5442
  )
5024
5443
  ] })
5025
5444
  ] }),
5026
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AlertDialogFooterBase, { className: "mt-2 flex justify-end gap-3", children: [
5027
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5445
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(AlertDialogFooterBase, { className: "mt-2 flex justify-end gap-3", children: [
5446
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5028
5447
  AlertDialogCancelBase,
5029
5448
  {
5030
5449
  onClick: onCancel,
@@ -5035,7 +5454,7 @@ var DestructiveDialog = ({
5035
5454
  children: "Cancelar"
5036
5455
  }
5037
5456
  ),
5038
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5457
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5039
5458
  AlertDialogActionBase,
5040
5459
  {
5041
5460
  onClick: onConfirm,
@@ -5051,3 +5470,1458 @@ var DestructiveDialog = ({
5051
5470
  )
5052
5471
  ] });
5053
5472
  };
5473
+
5474
+ // src/components/charts/components/controls/PeriodsDropdown.tsx
5475
+ var import_react31 = require("react");
5476
+ var import_framer_motion8 = require("framer-motion");
5477
+ var import_ssr = require("@phosphor-icons/react/dist/ssr");
5478
+ var import_ssr2 = require("@phosphor-icons/react/dist/ssr");
5479
+ var import_jsx_runtime49 = require("react/jsx-runtime");
5480
+ var menuVariants = {
5481
+ hidden: { opacity: 0, y: -6, scale: 0.98 },
5482
+ visible: { opacity: 1, y: 0, scale: 1 },
5483
+ exit: { opacity: 0, y: -6, scale: 0.98 }
5484
+ };
5485
+ var itemVariants = {
5486
+ hidden: { opacity: 0, x: -6 },
5487
+ visible: { opacity: 1, x: 0 }
5488
+ };
5489
+ function PeriodsDropdown({
5490
+ processedData,
5491
+ onOpenPeriod,
5492
+ rightOffset,
5493
+ topOffset,
5494
+ activePeriod,
5495
+ activePeriods
5496
+ }) {
5497
+ const periods = processedData.map((d) => String(d.name));
5498
+ const [open, setOpen] = (0, import_react31.useState)(false);
5499
+ const wrapperRef = (0, import_react31.useRef)(null);
5500
+ const firstItemRef = (0, import_react31.useRef)(null);
5501
+ const listRef = (0, import_react31.useRef)(null);
5502
+ (0, import_react31.useEffect)(() => {
5503
+ const handleClickOutside = (e) => {
5504
+ if (!wrapperRef.current) return;
5505
+ if (!wrapperRef.current.contains(e.target)) setOpen(false);
5506
+ };
5507
+ const handleEscape = (e) => {
5508
+ if (e.key === "Escape") setOpen(false);
5509
+ };
5510
+ document.addEventListener("mousedown", handleClickOutside);
5511
+ document.addEventListener("keydown", handleEscape);
5512
+ return () => {
5513
+ document.removeEventListener("mousedown", handleClickOutside);
5514
+ document.removeEventListener("keydown", handleEscape);
5515
+ };
5516
+ }, []);
5517
+ (0, import_react31.useEffect)(() => {
5518
+ if (open && firstItemRef.current) {
5519
+ firstItemRef.current.focus();
5520
+ }
5521
+ }, [open]);
5522
+ function handleSelect(p) {
5523
+ onOpenPeriod(p);
5524
+ setOpen(false);
5525
+ }
5526
+ const containerStyle = typeof rightOffset === "number" ? { position: "relative", zIndex: 30 } : { position: "relative", zIndex: 30 };
5527
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref: wrapperRef, style: containerStyle, className: "mr-4", children: [
5528
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5529
+ "button",
5530
+ {
5531
+ className: "relative p-2.5 rounded-md hover:bg-accent/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-accent/50 transition flex items-center justify-center",
5532
+ "aria-expanded": open,
5533
+ "aria-haspopup": "menu",
5534
+ "aria-controls": "periods-menu",
5535
+ onClick: () => setOpen((v) => !v),
5536
+ onKeyDown: (e) => {
5537
+ if (e.key === "ArrowDown") setOpen(true);
5538
+ if (e.key === "Enter" || e.key === " ") {
5539
+ e.preventDefault();
5540
+ setOpen((v) => !v);
5541
+ }
5542
+ },
5543
+ title: open ? "Fechar lista de per\xEDodos" : "Abrir lista de per\xEDodos",
5544
+ children: [
5545
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_ssr.DotsThreeIcon, { size: 18 }),
5546
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "sr-only", children: open ? "Fechar per\xEDodos" : "Abrir per\xEDodos" }),
5547
+ periods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "absolute -top-1 -right-1 bg-accent text-foreground text-xs rounded-full w-5 h-5 flex items-center justify-center ring-1 ring-border", children: periods.length })
5548
+ ]
5549
+ }
5550
+ ),
5551
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_framer_motion8.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5552
+ import_framer_motion8.motion.div,
5553
+ {
5554
+ initial: "hidden",
5555
+ animate: "visible",
5556
+ exit: "exit",
5557
+ variants: menuVariants,
5558
+ transition: { type: "spring", stiffness: 500, damping: 30 },
5559
+ className: "bg-card border border-border rounded-lg shadow-lg overflow-hidden ring-1 ring-black/5",
5560
+ style: {
5561
+ minWidth: 200,
5562
+ maxHeight: 260,
5563
+ overflow: "hidden",
5564
+ position: "absolute",
5565
+ top: typeof topOffset === "number" ? topOffset : "calc(100% + 6px)",
5566
+ right: typeof rightOffset === "number" ? rightOffset : 0
5567
+ },
5568
+ role: "menu",
5569
+ "aria-orientation": "vertical",
5570
+ id: "periods-menu",
5571
+ children: [
5572
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "px-3 py-2 text-sm font-medium text-muted-foreground", children: "Per\xEDodos" }),
5573
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "h-px bg-border" }),
5574
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5575
+ "div",
5576
+ {
5577
+ ref: listRef,
5578
+ className: "flex flex-col p-2 gap-1",
5579
+ style: { maxHeight: 200, overflowY: "auto" },
5580
+ children: periods.map((p, idx) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5581
+ import_framer_motion8.motion.button,
5582
+ {
5583
+ className: "flex items-center justify-between w-full text-left px-3 py-2.5 rounded focus:outline-none transition-colors " + (activePeriods && activePeriods.includes(p) || p === activePeriod ? "bg-accent/10 font-medium" : "hover:bg-accent/15 focus-visible:ring-2 focus-visible:ring-accent/30"),
5584
+ variants: itemVariants,
5585
+ initial: "hidden",
5586
+ animate: "visible",
5587
+ whileTap: { scale: 0.98 },
5588
+ onClick: () => handleSelect(p),
5589
+ ref: idx === 0 ? firstItemRef : void 0,
5590
+ role: "menuitem",
5591
+ "aria-checked": activePeriods && activePeriods.includes(p) || p === activePeriod,
5592
+ children: [
5593
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "truncate", children: p }),
5594
+ (activePeriods && activePeriods.includes(p) || p === activePeriod) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ml-2 text-primary flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_ssr2.Check, { size: 16, weight: "bold" }) })
5595
+ ]
5596
+ },
5597
+ p
5598
+ ))
5599
+ }
5600
+ )
5601
+ ]
5602
+ }
5603
+ ) })
5604
+ ] });
5605
+ }
5606
+ var PeriodsDropdown_default = PeriodsDropdown;
5607
+
5608
+ // src/components/charts/components/controls/ShowOnly.tsx
5609
+ var import_framer_motion9 = require("framer-motion");
5610
+ var import_react32 = require("@phosphor-icons/react");
5611
+ var import_jsx_runtime50 = require("react/jsx-runtime");
5612
+ var ShowOnly = ({
5613
+ showOnlyHighlighted,
5614
+ setShowOnlyHighlighted,
5615
+ highlightedSeriesSize
5616
+ }) => {
5617
+ const hasHighlights = highlightedSeriesSize > 0;
5618
+ if (!hasHighlights) return null;
5619
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ml-auto flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5620
+ import_framer_motion9.motion.div,
5621
+ {
5622
+ whileTap: { scale: hasHighlights ? 0.985 : 1 },
5623
+ whileHover: { y: hasHighlights ? -2 : 0 },
5624
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5625
+ ButtonBase,
5626
+ {
5627
+ variant: "secondary",
5628
+ onClick: () => hasHighlights && setShowOnlyHighlighted((v) => !v),
5629
+ "aria-pressed": showOnlyHighlighted,
5630
+ "aria-label": showOnlyHighlighted ? "Exibir todos" : "Mostrar somente destacados",
5631
+ title: showOnlyHighlighted ? "Exibir todos" : "Mostrar somente destacados",
5632
+ disabled: !hasHighlights,
5633
+ className: cn(
5634
+ "flex items-center justify-center gap-2 text-sm h-8 min-w-[2rem] px-2.5 rounded-md transition-shadow",
5635
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary/60",
5636
+ !hasHighlights ? "opacity-60 cursor-not-allowed pointer-events-none" : showOnlyHighlighted ? "bg-primary/10 text-primary shadow-sm border border-primary/20" : "bg-transparent text-muted-foreground border border-transparent hover:bg-muted/10 hover:text-foreground"
5637
+ ),
5638
+ children: showOnlyHighlighted ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
5639
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react32.EyeSlash, { size: 16, weight: "regular" }),
5640
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: "Exibir todos" })
5641
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
5642
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react32.Eye, { size: 16, weight: "bold" }),
5643
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: "Mostrar somente destacados" })
5644
+ ] })
5645
+ }
5646
+ )
5647
+ }
5648
+ ) });
5649
+ };
5650
+ var ShowOnly_default = ShowOnly;
5651
+
5652
+ // src/components/charts/components/controls/Highlights.tsx
5653
+ var import_framer_motion10 = require("framer-motion");
5654
+ var import_ssr3 = require("@phosphor-icons/react/dist/ssr");
5655
+ var import_jsx_runtime51 = require("react/jsx-runtime");
5656
+ var Highlights = ({
5657
+ allKeys,
5658
+ mapperConfig,
5659
+ finalColors,
5660
+ highlightedSeries,
5661
+ toggleHighlight,
5662
+ containerWidth
5663
+ }) => {
5664
+ const count = allKeys.length || 1;
5665
+ const available = containerWidth && containerWidth > 0 ? containerWidth : 600;
5666
+ const perPill = Math.floor(available / count);
5667
+ const showFullLabel = perPill >= 96;
5668
+ const showShortLabel = perPill >= 64;
5669
+ const containerVariants = {
5670
+ hidden: { opacity: 0 },
5671
+ visible: { opacity: 1, transition: { staggerChildren: 0.03 } }
5672
+ };
5673
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5674
+ import_framer_motion10.motion.div,
5675
+ {
5676
+ className: "flex-1 flex items-center gap-2 flex-wrap",
5677
+ initial: "hidden",
5678
+ animate: "visible",
5679
+ variants: containerVariants,
5680
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion10.AnimatePresence, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
5681
+ const isHighlighted = highlightedSeries.has(k);
5682
+ const label = mapperConfig[k]?.label ?? k;
5683
+ const color = finalColors[k];
5684
+ const pillClasses = cn(
5685
+ "inline-flex items-center gap-2 px-3 py-1 rounded-full text-sm border transition-all select-none relative overflow-hidden",
5686
+ isHighlighted ? "pr-8" : "",
5687
+ isHighlighted ? "bg-card/95 border-2 text-foreground shadow-[0_6px_18px_rgba(0,0,0,0.12)]" : "bg-muted/10 border-border text-muted-foreground hover:bg-muted/5"
5688
+ );
5689
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5690
+ import_framer_motion10.motion.div,
5691
+ {
5692
+ layout: true,
5693
+ initial: "hidden",
5694
+ animate: "visible",
5695
+ exit: "exit",
5696
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5697
+ ButtonBase,
5698
+ {
5699
+ asChild: true,
5700
+ variant: "ghost",
5701
+ onClick: () => toggleHighlight(k),
5702
+ title: isHighlighted ? `Desativar ${label}` : `Ativar ${label}`,
5703
+ className: pillClasses,
5704
+ style: { minWidth: showFullLabel ? void 0 : 36 },
5705
+ "aria-pressed": isHighlighted,
5706
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5707
+ import_framer_motion10.motion.button,
5708
+ {
5709
+ whileHover: { scale: isHighlighted ? 1.04 : 1.03 },
5710
+ whileTap: { scale: 0.96 },
5711
+ animate: isHighlighted ? { scale: 1.02 } : { scale: 1 },
5712
+ className: "flex items-center gap-2 min-w-0 pr-2",
5713
+ children: [
5714
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5715
+ import_framer_motion10.motion.span,
5716
+ {
5717
+ className: cn("w-3 h-3 rounded-sm flex-shrink-0 border"),
5718
+ style: {
5719
+ backgroundColor: color,
5720
+ borderColor: isHighlighted ? color : "transparent",
5721
+ boxShadow: isHighlighted ? `0 6px 20px ${color}33` : void 0
5722
+ },
5723
+ layout: true,
5724
+ initial: { scale: 0.8, opacity: 0.9 },
5725
+ animate: { scale: 1, opacity: 1 },
5726
+ transition: { type: "spring", stiffness: 400, damping: 30 }
5727
+ }
5728
+ ),
5729
+ showFullLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion10.motion.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5730
+ import_framer_motion10.motion.span,
5731
+ {
5732
+ className: "truncate max-w-[6rem] text-xs pr-2",
5733
+ layout: true,
5734
+ children: label
5735
+ }
5736
+ ) : null,
5737
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5738
+ import_framer_motion10.motion.span,
5739
+ {
5740
+ "aria-hidden": true,
5741
+ initial: { opacity: 0, scale: 0.6 },
5742
+ animate: isHighlighted ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0.6 },
5743
+ transition: { type: "spring", stiffness: 450, damping: 28 },
5744
+ className: cn(
5745
+ "pointer-events-none absolute right-2 -translate-y-1/2 text-xs text-foreground flex items-center justify-center",
5746
+ isHighlighted ? "" : "opacity-0 pointer-events-none"
5747
+ ),
5748
+ style: { width: 18, height: 18 },
5749
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ssr3.CheckIcon, {})
5750
+ }
5751
+ )
5752
+ ]
5753
+ }
5754
+ )
5755
+ }
5756
+ )
5757
+ },
5758
+ `pill-${k}`
5759
+ );
5760
+ }) })
5761
+ }
5762
+ );
5763
+ };
5764
+ var Highlights_default = Highlights;
5765
+
5766
+ // src/components/charts/components/controls/CloseAllButton.tsx
5767
+ var import_ssr4 = require("@phosphor-icons/react/dist/ssr");
5768
+ var import_jsx_runtime52 = require("react/jsx-runtime");
5769
+ var CloseAllButton = ({
5770
+ count,
5771
+ onCloseAll,
5772
+ position = "top-center",
5773
+ variant = "floating"
5774
+ }) => {
5775
+ if (count <= 1) return null;
5776
+ const getPositionClasses = () => {
5777
+ if (variant === "inline") return "";
5778
+ switch (position) {
5779
+ case "top-left":
5780
+ return "fixed top-6 left-6 z-50";
5781
+ case "top-right":
5782
+ return "fixed top-6 right-6 z-50";
5783
+ case "top-center":
5784
+ return "fixed top-6 left-1/2 transform -translate-x-1/2 z-50";
5785
+ default:
5786
+ return "fixed top-6 left-1/2 transform -translate-x-1/2 z-50";
5787
+ }
5788
+ };
5789
+ const getVariantClasses = () => {
5790
+ if (variant === "inline") {
5791
+ return "text-xs px-2 py-1 h-auto bg-card border border-border shadow-sm hover:bg-accent";
5792
+ }
5793
+ return `
5794
+ rounded-full px-4 py-2.5
5795
+ text-white font-semibold text-sm
5796
+ transition-all duration-200 ease-in-out
5797
+ hover:scale-105 active:scale-95 hover:shadow-2xl
5798
+ flex items-center gap-2.5
5799
+ group
5800
+ min-w-max
5801
+ `;
5802
+ };
5803
+ if (variant === "inline") {
5804
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "absolute top-4 right-4 z-30", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5805
+ ButtonBase,
5806
+ {
5807
+ variant: "ghost",
5808
+ size: "sm",
5809
+ onClick: onCloseAll,
5810
+ className: getVariantClasses(),
5811
+ children: [
5812
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_ssr4.XIcon, { size: 12, className: "mr-1" }),
5813
+ "Fechar Todos"
5814
+ ]
5815
+ }
5816
+ ) });
5817
+ }
5818
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5819
+ "div",
5820
+ {
5821
+ className: `${getPositionClasses()} animate-in fade-in slide-in-from-top-2 duration-300`,
5822
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5823
+ ButtonBase,
5824
+ {
5825
+ onClick: onCloseAll,
5826
+ size: "sm",
5827
+ className: `bg-red-600 hover:bg-red-700${getVariantClasses()}`,
5828
+ children: [
5829
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5830
+ import_ssr4.XIcon,
5831
+ {
5832
+ size: 18,
5833
+ className: "\n group-hover:rotate-90 transition-all duration-300 ease-out\n drop-shadow-sm\n "
5834
+ }
5835
+ ),
5836
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "min-w-0 tracking-wide", children: "Fechar Todos" }),
5837
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mb-1 mx-2", children: count })
5838
+ ]
5839
+ }
5840
+ ) })
5841
+ }
5842
+ );
5843
+ };
5844
+ var CloseAllButton_default = CloseAllButton;
5845
+
5846
+ // src/components/charts/components/tooltips/DraggableTooltip.tsx
5847
+ var import_react33 = __toESM(require("react"));
5848
+ var import_framer_motion11 = require("framer-motion");
5849
+ var import_react34 = require("@phosphor-icons/react");
5850
+ var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
5851
+ var import_jsx_runtime53 = require("react/jsx-runtime");
5852
+ var ALIGNMENT_THRESHOLD = 25;
5853
+ var GUIDE_THRESHOLD = 60;
5854
+ var STRONG_SNAP_THRESHOLD = 35;
5855
+ var PRECISION_SNAP_THRESHOLD = 8;
5856
+ var TOOLTIP_DIMENSIONS = { width: 224, height: 120 };
5857
+ var tooltipVariants = {
5858
+ hidden: {
5859
+ opacity: 0,
5860
+ scale: 0.96,
5861
+ transition: { type: "spring", stiffness: 400, damping: 28 }
5862
+ },
5863
+ visible: {
5864
+ opacity: 1,
5865
+ scale: 1,
5866
+ transition: { type: "spring", stiffness: 300, damping: 28 }
5867
+ },
5868
+ exit: {
5869
+ opacity: 0,
5870
+ scale: 0.96,
5871
+ transition: { type: "spring", stiffness: 400, damping: 28 }
5872
+ }
5873
+ };
5874
+ var guideVariants = {
5875
+ hidden: {
5876
+ opacity: 0,
5877
+ transition: { type: "spring", stiffness: 220, damping: 24 }
5878
+ },
5879
+ visible: {
5880
+ opacity: 0.95,
5881
+ transition: { type: "spring", stiffness: 220, damping: 24 }
5882
+ },
5883
+ exit: {
5884
+ opacity: 0,
5885
+ transition: { type: "spring", stiffness: 220, damping: 24 }
5886
+ }
5887
+ };
5888
+ var guideDotVariants = {
5889
+ hidden: {
5890
+ scale: 0.6,
5891
+ opacity: 0,
5892
+ transition: { type: "spring", stiffness: 400, damping: 24 }
5893
+ },
5894
+ visible: {
5895
+ scale: 1,
5896
+ opacity: 0.9,
5897
+ transition: { type: "spring", stiffness: 400, damping: 24 }
5898
+ },
5899
+ exit: {
5900
+ opacity: 0,
5901
+ scale: 0.6,
5902
+ transition: { type: "spring", stiffness: 400, damping: 24 }
5903
+ }
5904
+ };
5905
+ var DraggableTooltipComponent = ({
5906
+ id,
5907
+ data,
5908
+ position,
5909
+ title,
5910
+ dataKeys,
5911
+ finalColors,
5912
+ onMouseDown,
5913
+ onClose,
5914
+ periodLabel = "Per\xEDodo Selecionado",
5915
+ dataLabel = "Dados do Per\xEDodo",
5916
+ showCloseAllButton = false,
5917
+ globalTooltipCount,
5918
+ onCloseAll,
5919
+ closeAllButtonPosition = "top-center",
5920
+ closeAllButtonVariant = "floating",
5921
+ onPositionChange,
5922
+ highlightedSeries,
5923
+ toggleHighlight,
5924
+ showOnlyHighlighted
5925
+ }) => {
5926
+ const visibleKeys = (0, import_react33.useMemo)(
5927
+ () => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
5928
+ [showOnlyHighlighted, highlightedSeries, dataKeys]
5929
+ );
5930
+ const TotalDisplay = import_react33.default.memo(
5931
+ ({ data: data2, visibleKeys: visibleKeys2 }) => {
5932
+ const total = (0, import_react33.useMemo)(() => {
5933
+ const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
5934
+ return numeric.reduce((s, v) => s + (v || 0), 0);
5935
+ }, [data2, visibleKeys2]);
5936
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "text-sm", children: [
5937
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-sm text-muted-foreground", children: "Total" }),
5938
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5939
+ "div",
5940
+ {
5941
+ className: `text-base font-semibold ${total < 0 ? "text-destructive" : "text-foreground"}`,
5942
+ children: total.toLocaleString("pt-BR")
5943
+ }
5944
+ )
5945
+ ] });
5946
+ }
5947
+ );
5948
+ const [localPos, setLocalPos] = (0, import_react33.useState)(position);
5949
+ const [dragging, setDragging] = (0, import_react33.useState)(false);
5950
+ const offsetRef = (0, import_react33.useRef)({ x: 0, y: 0 });
5951
+ const lastMouse = (0, import_react33.useRef)({ x: 0, y: 0 });
5952
+ const [alignmentGuides, setAlignmentGuides] = (0, import_react33.useState)([]);
5953
+ const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0, import_react33.useState)(0);
5954
+ (0, import_react33.useEffect)(() => setLocalPos(position), [position]);
5955
+ const getAllTooltips = (0, import_react33.useCallback)(() => {
5956
+ const response = [];
5957
+ const ev = new CustomEvent("requestGlobalTooltips", {
5958
+ detail: { requesterId: id, response }
5959
+ });
5960
+ window.dispatchEvent(ev);
5961
+ return response;
5962
+ }, [id]);
5963
+ const updateAlignmentGuides = (0, import_react33.useCallback)(
5964
+ (currentPosition) => {
5965
+ const allTooltips = getAllTooltips();
5966
+ const otherTooltips = allTooltips.filter((t) => t.id !== id);
5967
+ const guides = [];
5968
+ otherTooltips.forEach((tooltip) => {
5969
+ const topDiff = Math.abs(currentPosition.top - tooltip.position.top);
5970
+ if (topDiff <= GUIDE_THRESHOLD) {
5971
+ guides.push({
5972
+ type: "horizontal",
5973
+ position: tooltip.position.top,
5974
+ sourceTooltip: {
5975
+ top: currentPosition.top,
5976
+ left: currentPosition.left,
5977
+ width: TOOLTIP_DIMENSIONS.width,
5978
+ height: TOOLTIP_DIMENSIONS.height
5979
+ },
5980
+ targetTooltip: {
5981
+ top: tooltip.position.top,
5982
+ left: tooltip.position.left,
5983
+ width: TOOLTIP_DIMENSIONS.width,
5984
+ height: TOOLTIP_DIMENSIONS.height
5985
+ }
5986
+ });
5987
+ }
5988
+ const leftDiff = Math.abs(currentPosition.left - tooltip.position.left);
5989
+ if (leftDiff <= GUIDE_THRESHOLD) {
5990
+ guides.push({
5991
+ type: "vertical",
5992
+ position: tooltip.position.left,
5993
+ sourceTooltip: {
5994
+ top: currentPosition.top,
5995
+ left: currentPosition.left,
5996
+ width: TOOLTIP_DIMENSIONS.width,
5997
+ height: TOOLTIP_DIMENSIONS.height
5998
+ },
5999
+ targetTooltip: {
6000
+ top: tooltip.position.top,
6001
+ left: tooltip.position.left,
6002
+ width: TOOLTIP_DIMENSIONS.width,
6003
+ height: TOOLTIP_DIMENSIONS.height
6004
+ }
6005
+ });
6006
+ }
6007
+ });
6008
+ setAlignmentGuides(guides);
6009
+ },
6010
+ [getAllTooltips, id]
6011
+ );
6012
+ const snapToGuides = (0, import_react33.useCallback)(
6013
+ (position2) => {
6014
+ const snappedPosition = { ...position2 };
6015
+ let hasSnapped = false;
6016
+ alignmentGuides.forEach((guide) => {
6017
+ if (guide.type === "horizontal") {
6018
+ const diff = Math.abs(position2.top - guide.position);
6019
+ if (diff <= PRECISION_SNAP_THRESHOLD) {
6020
+ snappedPosition.top = guide.position;
6021
+ hasSnapped = true;
6022
+ }
6023
+ } else {
6024
+ const diff = Math.abs(position2.left - guide.position);
6025
+ if (diff <= PRECISION_SNAP_THRESHOLD) {
6026
+ snappedPosition.left = guide.position;
6027
+ hasSnapped = true;
6028
+ }
6029
+ }
6030
+ });
6031
+ if (!hasSnapped) {
6032
+ alignmentGuides.forEach((guide) => {
6033
+ if (guide.type === "horizontal") {
6034
+ const diff = Math.abs(position2.top - guide.position);
6035
+ if (diff <= STRONG_SNAP_THRESHOLD)
6036
+ snappedPosition.top = guide.position;
6037
+ } else {
6038
+ const diff = Math.abs(position2.left - guide.position);
6039
+ if (diff <= STRONG_SNAP_THRESHOLD)
6040
+ snappedPosition.left = guide.position;
6041
+ }
6042
+ });
6043
+ }
6044
+ alignmentGuides.forEach((guide) => {
6045
+ if (guide.type === "horizontal") {
6046
+ const diff = Math.abs(position2.top - guide.position);
6047
+ if (diff <= ALIGNMENT_THRESHOLD && snappedPosition.top === position2.top)
6048
+ snappedPosition.top = guide.position;
6049
+ } else {
6050
+ const diff = Math.abs(position2.left - guide.position);
6051
+ if (diff <= ALIGNMENT_THRESHOLD && snappedPosition.left === position2.left)
6052
+ snappedPosition.left = guide.position;
6053
+ }
6054
+ });
6055
+ return snappedPosition;
6056
+ },
6057
+ [alignmentGuides]
6058
+ );
6059
+ (0, import_react33.useEffect)(() => {
6060
+ let rafId = null;
6061
+ const handleMouseMove = (e) => {
6062
+ if (!dragging) return;
6063
+ lastMouse.current = { x: e.clientX, y: e.clientY };
6064
+ if (rafId) cancelAnimationFrame(rafId);
6065
+ rafId = requestAnimationFrame(() => {
6066
+ const newLeft = lastMouse.current.x - offsetRef.current.x;
6067
+ const newTop = lastMouse.current.y - offsetRef.current.y;
6068
+ const rawPosition = {
6069
+ top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
6070
+ left: Math.max(0, Math.min(newLeft, window.innerWidth - 250))
6071
+ };
6072
+ updateAlignmentGuides(rawPosition);
6073
+ const snapped = snapToGuides(rawPosition);
6074
+ setLocalPos(snapped);
6075
+ if (onPositionChange) onPositionChange(id, snapped);
6076
+ });
6077
+ };
6078
+ const handleMouseUp = () => {
6079
+ if (dragging) {
6080
+ setDragging(false);
6081
+ setAlignmentGuides([]);
6082
+ if (rafId) cancelAnimationFrame(rafId);
6083
+ }
6084
+ };
6085
+ if (dragging) {
6086
+ document.addEventListener("mousemove", handleMouseMove, {
6087
+ passive: true
6088
+ });
6089
+ document.addEventListener("mouseup", handleMouseUp);
6090
+ document.body.style.cursor = "grabbing";
6091
+ document.body.style.userSelect = "none";
6092
+ }
6093
+ return () => {
6094
+ if (rafId) cancelAnimationFrame(rafId);
6095
+ document.removeEventListener("mousemove", handleMouseMove);
6096
+ document.removeEventListener("mouseup", handleMouseUp);
6097
+ document.body.style.cursor = "";
6098
+ document.body.style.userSelect = "";
6099
+ };
6100
+ }, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
6101
+ (0, import_react33.useEffect)(() => {
6102
+ const handleCloseAll = () => onClose(id);
6103
+ const handleRequestTooltipCount = () => {
6104
+ window.dispatchEvent(
6105
+ new CustomEvent("tooltipCountResponse", { detail: { count: 1 } })
6106
+ );
6107
+ };
6108
+ const handleRequestGlobalTooltips = (event) => {
6109
+ const customEvent = event;
6110
+ const detail = customEvent.detail;
6111
+ if (detail?.response && detail.requesterId && detail.requesterId !== id) {
6112
+ detail.response.push({ id, position: localPos });
6113
+ }
6114
+ };
6115
+ const events = [
6116
+ { name: "closeAllTooltips", handler: handleCloseAll },
6117
+ { name: "requestTooltipCount", handler: handleRequestTooltipCount },
6118
+ {
6119
+ name: "requestGlobalTooltips",
6120
+ handler: handleRequestGlobalTooltips
6121
+ }
6122
+ ];
6123
+ events.forEach(({ name, handler }) => {
6124
+ window.addEventListener(name, handler);
6125
+ });
6126
+ return () => {
6127
+ events.forEach(({ name, handler }) => {
6128
+ window.removeEventListener(name, handler);
6129
+ });
6130
+ };
6131
+ }, [id, localPos, onClose]);
6132
+ (0, import_react33.useEffect)(() => {
6133
+ if (dragging) return;
6134
+ let total = 0;
6135
+ const timeoutId = setTimeout(() => {
6136
+ const handleCountResponse = (event) => {
6137
+ const customEvent = event;
6138
+ total += customEvent.detail.count || 0;
6139
+ };
6140
+ window.addEventListener("tooltipCountResponse", handleCountResponse);
6141
+ window.dispatchEvent(new CustomEvent("requestTooltipCount"));
6142
+ const cleanupTimeout = setTimeout(() => {
6143
+ window.removeEventListener("tooltipCountResponse", handleCountResponse);
6144
+ setGlobalTooltipCountLocal(total);
6145
+ }, 50);
6146
+ return () => clearTimeout(cleanupTimeout);
6147
+ }, 0);
6148
+ return () => clearTimeout(timeoutId);
6149
+ }, [localPos, dragging]);
6150
+ (0, import_react33.useEffect)(() => {
6151
+ const recount = () => {
6152
+ if (dragging) return;
6153
+ let total = 0;
6154
+ const handleCountResponse = (event) => {
6155
+ const customEvent = event;
6156
+ total += customEvent.detail.count || 0;
6157
+ };
6158
+ window.addEventListener("tooltipCountResponse", handleCountResponse);
6159
+ window.dispatchEvent(new CustomEvent("requestTooltipCount"));
6160
+ setTimeout(() => {
6161
+ window.removeEventListener("tooltipCountResponse", handleCountResponse);
6162
+ setGlobalTooltipCountLocal(total);
6163
+ }, 50);
6164
+ };
6165
+ window.addEventListener("recountTooltips", recount);
6166
+ return () => window.removeEventListener("recountTooltips", recount);
6167
+ }, [dragging]);
6168
+ const handleMouseDownLocal = (0, import_react33.useCallback)(
6169
+ (e) => {
6170
+ e.preventDefault();
6171
+ e.stopPropagation();
6172
+ const rect = e.currentTarget.getBoundingClientRect();
6173
+ offsetRef.current = { x: e.clientX - rect.left, y: e.clientY - rect.top };
6174
+ setDragging(true);
6175
+ onMouseDown?.(id, e);
6176
+ },
6177
+ [id, onMouseDown]
6178
+ );
6179
+ const handleTouchStartLocal = (0, import_react33.useCallback)(
6180
+ (e) => {
6181
+ e.stopPropagation();
6182
+ const touch = e.touches[0];
6183
+ if (!touch) return;
6184
+ const rect = e.currentTarget.getBoundingClientRect();
6185
+ offsetRef.current = {
6186
+ x: touch.clientX - rect.left,
6187
+ y: touch.clientY - rect.top
6188
+ };
6189
+ setDragging(true);
6190
+ onMouseDown?.(id, e);
6191
+ },
6192
+ [id, onMouseDown]
6193
+ );
6194
+ const handleCloseClick = (0, import_react33.useCallback)(
6195
+ (e) => {
6196
+ e.stopPropagation();
6197
+ onClose(id);
6198
+ },
6199
+ [id, onClose]
6200
+ );
6201
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
6202
+ dragging && alignmentGuides.map((guide, index) => {
6203
+ const isHorizontal = guide.type === "horizontal";
6204
+ const color = isHorizontal ? "#3b82f6" : "#ef4444";
6205
+ const startX = isHorizontal ? Math.min(
6206
+ guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
6207
+ guide.targetTooltip.left + guide.targetTooltip.width / 2
6208
+ ) : guide.sourceTooltip.left + guide.sourceTooltip.width / 2;
6209
+ const endX = isHorizontal ? Math.max(
6210
+ guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
6211
+ guide.targetTooltip.left + guide.targetTooltip.width / 2
6212
+ ) : guide.targetTooltip.left + guide.targetTooltip.width / 2;
6213
+ const startY = isHorizontal ? guide.sourceTooltip.top + guide.sourceTooltip.height / 2 : Math.min(
6214
+ guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
6215
+ guide.targetTooltip.top + guide.targetTooltip.height / 2
6216
+ );
6217
+ const endY = isHorizontal ? guide.targetTooltip.top + guide.targetTooltip.height / 2 : Math.max(
6218
+ guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
6219
+ guide.targetTooltip.top + guide.targetTooltip.height / 2
6220
+ );
6221
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
6222
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6223
+ import_framer_motion11.motion.div,
6224
+ {
6225
+ className: "fixed pointer-events-none z-30",
6226
+ variants: guideVariants,
6227
+ initial: "hidden",
6228
+ animate: "visible",
6229
+ exit: "exit",
6230
+ style: {
6231
+ left: startX,
6232
+ top: startY,
6233
+ width: isHorizontal ? endX - startX : 2,
6234
+ height: isHorizontal ? 2 : endY - startY,
6235
+ backgroundColor: color,
6236
+ boxShadow: `0 0 8px ${color}60`,
6237
+ borderStyle: "dashed",
6238
+ borderWidth: "1px",
6239
+ borderColor: color,
6240
+ transform: "translateZ(0)"
6241
+ }
6242
+ }
6243
+ ),
6244
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6245
+ import_framer_motion11.motion.div,
6246
+ {
6247
+ className: "fixed pointer-events-none z-31",
6248
+ variants: guideDotVariants,
6249
+ initial: "hidden",
6250
+ animate: "visible",
6251
+ exit: "exit",
6252
+ style: {
6253
+ left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
6254
+ top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
6255
+ width: "8px",
6256
+ height: "8px",
6257
+ backgroundColor: color,
6258
+ borderRadius: "50%",
6259
+ boxShadow: `0 0 4px ${color}80`
6260
+ }
6261
+ }
6262
+ ),
6263
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6264
+ import_framer_motion11.motion.div,
6265
+ {
6266
+ className: "fixed pointer-events-none z-31",
6267
+ variants: guideDotVariants,
6268
+ initial: "hidden",
6269
+ animate: "visible",
6270
+ exit: "exit",
6271
+ style: {
6272
+ left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
6273
+ top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
6274
+ width: "8px",
6275
+ height: "8px",
6276
+ backgroundColor: color,
6277
+ borderRadius: "50%",
6278
+ boxShadow: `0 0 4px ${color}80`
6279
+ }
6280
+ }
6281
+ )
6282
+ ] }, index);
6283
+ }),
6284
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_framer_motion11.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6285
+ import_framer_motion11.motion.div,
6286
+ {
6287
+ className: "fixed bg-card border border-border rounded-lg shadow-lg z-50 min-w-80 select-none",
6288
+ variants: tooltipVariants,
6289
+ initial: "hidden",
6290
+ animate: "visible",
6291
+ exit: "exit",
6292
+ style: {
6293
+ top: localPos.top,
6294
+ left: localPos.left,
6295
+ cursor: dragging ? "grabbing" : "grab",
6296
+ transform: "translateZ(0)"
6297
+ },
6298
+ onClick: (e) => e.stopPropagation(),
6299
+ role: "dialog",
6300
+ "aria-label": title ? `Tooltip ${title}` : `Tooltip ${data.name}`,
6301
+ children: [
6302
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6303
+ "div",
6304
+ {
6305
+ className: "flex items-center justify-between p-3 pb-2 border-b bg-muted/20 rounded-t-lg",
6306
+ onMouseDown: handleMouseDownLocal,
6307
+ onTouchStart: handleTouchStartLocal,
6308
+ style: { touchAction: "none" },
6309
+ children: [
6310
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react34.DotsSixVerticalIcon, { size: 16 }),
6311
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-col gap-1", children: title && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex items-center gap-2 pb-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "font-bold text-foreground text-base", children: title }) }) }),
6312
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6313
+ "button",
6314
+ {
6315
+ onClick: handleCloseClick,
6316
+ className: "text-muted-foreground hover:text-destructive ml-2 text-sm hover:bg-destructive/10 rounded p-1",
6317
+ title: "Fechar este tooltip",
6318
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_ssr5.XIcon, { size: 14 })
6319
+ }
6320
+ )
6321
+ ]
6322
+ }
6323
+ ),
6324
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "px-3 py-2 bg-accent/5 border-l-4 border-primary", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
6325
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
6326
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: periodLabel }),
6327
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "font-bold text-lg text-foreground mt-1 truncate", children: data.name })
6328
+ ] }),
6329
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-right", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TotalDisplay, { data, visibleKeys }) })
6330
+ ] }) }),
6331
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "p-3 pt-2 space-y-2", children: [
6332
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
6333
+ (0, import_react33.useMemo)(
6334
+ () => visibleKeys.map((key) => {
6335
+ const value = data[key];
6336
+ if (value === void 0) return null;
6337
+ const numericKeys = dataKeys.filter(
6338
+ (k) => typeof data[k] === "number"
6339
+ );
6340
+ const absDenominator = numericKeys.reduce(
6341
+ (s, k) => s + Math.abs(Number(data[k]) || 0),
6342
+ 0
6343
+ );
6344
+ const val = typeof value === "number" ? value : Number(value) || 0;
6345
+ const pct = absDenominator > 0 ? Math.abs(val) / absDenominator * 100 : 0;
6346
+ const isDimmed = highlightedSeries && highlightedSeries.size > 0 && !highlightedSeries.has(key);
6347
+ const isHighlighted = highlightedSeries && highlightedSeries.has(key);
6348
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6349
+ "div",
6350
+ {
6351
+ role: "button",
6352
+ tabIndex: 0,
6353
+ onKeyDown: (e) => {
6354
+ if (e.key === "Enter" || e.key === " ") {
6355
+ e.preventDefault();
6356
+ toggleHighlight?.(key);
6357
+ }
6358
+ },
6359
+ onClick: () => toggleHighlight?.(key),
6360
+ className: `flex flex-col gap-1 text-sm mb-1 p-2 rounded transition-colors cursor-pointer bg-muted/20`,
6361
+ style: {
6362
+ boxShadow: isHighlighted ? `0 6px 18px ${finalColors[key] || "#666"}33` : void 0,
6363
+ border: isHighlighted ? `1px solid ${finalColors[key] || "#666"}22` : void 0
6364
+ },
6365
+ children: [
6366
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between", children: [
6367
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
6368
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6369
+ "div",
6370
+ {
6371
+ className: "w-3 h-3 rounded-sm shadow-sm",
6372
+ style: {
6373
+ backgroundColor: finalColors[key] || "#666"
6374
+ }
6375
+ }
6376
+ ),
6377
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6378
+ "span",
6379
+ {
6380
+ className: `font-medium text-foreground truncate`,
6381
+ children: key.charAt(0).toUpperCase() + key.slice(1)
6382
+ }
6383
+ )
6384
+ ] }),
6385
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-baseline gap-2", children: [
6386
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6387
+ "span",
6388
+ {
6389
+ className: `font-semibold tabular-nums ${val < 0 ? "text-destructive" : "text-foreground"}`,
6390
+ children: val.toLocaleString("pt-BR")
6391
+ }
6392
+ ),
6393
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.toFixed(1)}%` : "-" })
6394
+ ] })
6395
+ ] }),
6396
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "w-full bg-muted rounded-full h-1 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6397
+ "div",
6398
+ {
6399
+ className: "h-1 rounded-full",
6400
+ style: {
6401
+ width: `${Math.max(0, Math.min(100, pct))}%`,
6402
+ opacity: isDimmed ? 0.35 : 1,
6403
+ background: finalColors[key] || "#666",
6404
+ transition: "none"
6405
+ }
6406
+ }
6407
+ ) })
6408
+ ]
6409
+ },
6410
+ key
6411
+ );
6412
+ }),
6413
+ [
6414
+ visibleKeys,
6415
+ data,
6416
+ dataKeys,
6417
+ highlightedSeries,
6418
+ toggleHighlight,
6419
+ finalColors
6420
+ ]
6421
+ ),
6422
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
6423
+ "Clique no ",
6424
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_ssr5.XIcon, { size: 12 }),
6425
+ " para remover"
6426
+ ] }) })
6427
+ ] })
6428
+ ]
6429
+ },
6430
+ id
6431
+ ) }),
6432
+ showCloseAllButton && onCloseAll && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6433
+ CloseAllButton_default,
6434
+ {
6435
+ count: typeof globalTooltipCount === "number" ? globalTooltipCount : globalTooltipCountLocal,
6436
+ onCloseAll,
6437
+ position: closeAllButtonPosition,
6438
+ variant: closeAllButtonVariant
6439
+ }
6440
+ )
6441
+ ] });
6442
+ };
6443
+ var DraggableTooltip = import_react33.default.memo(DraggableTooltipComponent);
6444
+ DraggableTooltip.displayName = "DraggableTooltip";
6445
+ var DraggableTooltip_default = DraggableTooltip;
6446
+
6447
+ // src/components/charts/components/tooltips/TooltipWithTotal.tsx
6448
+ var import_jsx_runtime54 = require("react/jsx-runtime");
6449
+ var RechartTooltipWithTotal = ({
6450
+ active,
6451
+ payload,
6452
+ label,
6453
+ finalColors = {},
6454
+ periodLabel = "Per\xEDodo",
6455
+ totalLabel = "Total"
6456
+ }) => {
6457
+ if (!active || !payload || payload.length === 0) return null;
6458
+ const numeric = payload.filter(
6459
+ (p) => typeof p.value === "number" && Number.isFinite(p.value)
6460
+ );
6461
+ const total = numeric.reduce((sum, p) => sum + (p.value || 0), 0);
6462
+ const isTotalNegative = total < 0;
6463
+ const absDenominator = numeric.reduce(
6464
+ (sum, p) => sum + Math.abs(typeof p.value === "number" ? p.value : 0),
6465
+ 0
6466
+ );
6467
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
6468
+ "div",
6469
+ {
6470
+ role: "dialog",
6471
+ "aria-label": `Tooltip ${label ?? ""}`,
6472
+ className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-xs",
6473
+ style: { minWidth: 220 },
6474
+ children: [
6475
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between mb-2", children: [
6476
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "pr-2", children: [
6477
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-xs text-muted-foreground", children: periodLabel }),
6478
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "font-medium text-foreground truncate", children: label })
6479
+ ] }),
6480
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "text-right ml-3", children: [
6481
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-xs text-muted-foreground", children: totalLabel }),
6482
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6483
+ "p",
6484
+ {
6485
+ className: `text-sm font-semibold ${isTotalNegative ? "text-rose-500" : "text-foreground"}`,
6486
+ children: total.toLocaleString("pt-BR")
6487
+ }
6488
+ )
6489
+ ] })
6490
+ ] }),
6491
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-col gap-2", children: payload.map((entry, index) => {
6492
+ const value = typeof entry.value === "number" ? entry.value : 0;
6493
+ const pct = absDenominator > 0 ? Math.abs(value) / absDenominator * 100 : 0;
6494
+ const baseColor = finalColors[entry.dataKey] || entry.color || "#999";
6495
+ const isNeg = value < 0;
6496
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-1", children: [
6497
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
6498
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2 truncate", children: [
6499
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6500
+ "span",
6501
+ {
6502
+ className: "w-3 h-3 rounded-sm flex-shrink-0",
6503
+ style: { backgroundColor: baseColor },
6504
+ "aria-hidden": true
6505
+ }
6506
+ ),
6507
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-muted-foreground truncate", children: entry.name })
6508
+ ] }),
6509
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-baseline gap-3 ml-3", children: [
6510
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6511
+ "span",
6512
+ {
6513
+ className: `${isNeg ? "text-rose-500" : "text-foreground"} font-medium`,
6514
+ children: value.toLocaleString("pt-BR")
6515
+ }
6516
+ ),
6517
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs text-muted-foreground", children: absDenominator > 0 ? `${pct.toFixed(1)}%` : "-" })
6518
+ ] })
6519
+ ] }),
6520
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "w-full bg-muted rounded-full h-1 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6521
+ "div",
6522
+ {
6523
+ className: "h-1 rounded-full transition-all duration-300",
6524
+ style: {
6525
+ width: `${Math.max(0, Math.min(100, pct))}%`,
6526
+ background: baseColor
6527
+ }
6528
+ }
6529
+ ) })
6530
+ ] }, index);
6531
+ }) })
6532
+ ]
6533
+ }
6534
+ );
6535
+ };
6536
+ var TooltipWithTotal_default = RechartTooltipWithTotal;
6537
+
6538
+ // src/components/charts/components/tooltips/TooltipSimple.tsx
6539
+ var import_jsx_runtime55 = require("react/jsx-runtime");
6540
+ var TooltipSimple = ({
6541
+ active,
6542
+ payload,
6543
+ label,
6544
+ finalColors = {},
6545
+ periodLabel = "Per\xEDodo"
6546
+ }) => {
6547
+ if (!active || !payload || payload.length === 0) return null;
6548
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
6549
+ "div",
6550
+ {
6551
+ role: "dialog",
6552
+ "aria-label": `Tooltip ${label ?? ""}`,
6553
+ className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-[280px]",
6554
+ style: { minWidth: 220 },
6555
+ children: [
6556
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex items-center justify-between gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0", children: [
6557
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-muted-foreground", children: periodLabel }),
6558
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "font-medium text-foreground truncate", children: label })
6559
+ ] }) }) }),
6560
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "divide-y divide-border rounded-md overflow-hidden", children: payload.map((entry, index) => {
6561
+ const value = typeof entry.value === "number" ? entry.value : 0;
6562
+ const color = finalColors[entry.dataKey] || entry.color || "#999";
6563
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
6564
+ "div",
6565
+ {
6566
+ className: "flex items-center justify-between text-sm px-2 py-2 bg-card/0 hover:bg-muted transition-colors",
6567
+ children: [
6568
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [
6569
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6570
+ "span",
6571
+ {
6572
+ className: "w-3 h-3 rounded-sm flex-shrink-0 border border-border/20",
6573
+ style: { backgroundColor: color },
6574
+ "aria-hidden": true
6575
+ }
6576
+ ),
6577
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-muted-foreground truncate", children: entry.name })
6578
+ ] }),
6579
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ml-3", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6580
+ "span",
6581
+ {
6582
+ className: `font-medium tabular-nums ${value < 0 ? "text-destructive" : "text-foreground"}`,
6583
+ children: value.toLocaleString("pt-BR")
6584
+ }
6585
+ ) })
6586
+ ]
6587
+ },
6588
+ index
6589
+ );
6590
+ }) })
6591
+ ]
6592
+ }
6593
+ );
6594
+ };
6595
+ var TooltipSimple_default = TooltipSimple;
6596
+
6597
+ // src/components/charts/utils/helpers.ts
6598
+ var formatFieldName = (fieldName) => {
6599
+ return fieldName.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()).trim();
6600
+ };
6601
+ var detectDataFields = (data, xAxisKey) => {
6602
+ if (!data || data.length === 0) return [];
6603
+ const firstItem = data[0];
6604
+ return Object.keys(firstItem).filter(
6605
+ (key) => key !== xAxisKey && typeof firstItem[key] === "number"
6606
+ );
6607
+ };
6608
+ var detectXAxis = (data) => {
6609
+ if (!data || data.length === 0) return "name";
6610
+ const firstItem = data[0];
6611
+ const stringFields = Object.keys(firstItem).filter(
6612
+ (key) => typeof firstItem[key] === "string" || typeof firstItem[key] === "number" && String(firstItem[key]).length <= 4
6613
+ );
6614
+ return stringFields[0] || Object.keys(firstItem)[0] || "name";
6615
+ };
6616
+ var generateAdditionalColors = (baseColors, count) => {
6617
+ const hexToRgb = (hex) => {
6618
+ const clean = hex.replace("#", "");
6619
+ const bigint = parseInt(
6620
+ clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean,
6621
+ 16
6622
+ );
6623
+ return { r: bigint >> 16 & 255, g: bigint >> 8 & 255, b: bigint & 255 };
6624
+ };
6625
+ const rgbToHsl = ({ r, g, b }) => {
6626
+ r /= 255;
6627
+ g /= 255;
6628
+ b /= 255;
6629
+ const max = Math.max(r, g, b), min = Math.min(r, g, b);
6630
+ let h = 0;
6631
+ let s = 0;
6632
+ const l = (max + min) / 2;
6633
+ if (max !== min) {
6634
+ const d = max - min;
6635
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
6636
+ switch (max) {
6637
+ case r:
6638
+ h = (g - b) / d + (g < b ? 6 : 0);
6639
+ break;
6640
+ case g:
6641
+ h = (b - r) / d + 2;
6642
+ break;
6643
+ case b:
6644
+ h = (r - g) / d + 4;
6645
+ break;
6646
+ }
6647
+ h /= 6;
6648
+ }
6649
+ return {
6650
+ h: Math.round(h * 360),
6651
+ s: Math.round(s * 100),
6652
+ l: Math.round(l * 100)
6653
+ };
6654
+ };
6655
+ const hslToHex = (h, s, l) => {
6656
+ s /= 100;
6657
+ l /= 100;
6658
+ const k = (n) => (n + h / 30) % 5;
6659
+ const a = s * Math.min(l, 1 - l);
6660
+ const f = (n) => {
6661
+ const color = l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
6662
+ return Math.round(255 * color).toString(16).padStart(2, "0");
6663
+ };
6664
+ return `#${f(0)}${f(8)}${f(4)}`;
6665
+ };
6666
+ const anchors = baseColors.map((c) => rgbToHsl(hexToRgb(c)));
6667
+ const colors2 = [...baseColors];
6668
+ let i = 0;
6669
+ while (colors2.length < count) {
6670
+ const anchor = anchors[i % anchors.length];
6671
+ const step = Math.floor(i / anchors.length + 1);
6672
+ const hueOffset = step * 25 * (i % 2 === 0 ? 1 : -1);
6673
+ const satOffset = i % 3 === 0 ? -6 : 6;
6674
+ const lightOffset = i % 4 === 0 ? 6 : -4;
6675
+ const newH = (anchor.h + hueOffset + 360) % 360;
6676
+ const newS = Math.max(30, Math.min(95, anchor.s + satOffset));
6677
+ const newL = Math.max(25, Math.min(45, anchor.l + lightOffset));
6678
+ colors2.push(hslToHex(newH, newS, newL));
6679
+ i += 1;
6680
+ }
6681
+ return colors2.slice(0, count);
6682
+ };
6683
+ var niceCeil = (value) => {
6684
+ if (!isFinite(value) || value <= 0) return 1;
6685
+ const pow = Math.pow(10, Math.floor(Math.log10(value)));
6686
+ const normalized = value / pow;
6687
+ const multipliers = [
6688
+ 1,
6689
+ 1.25,
6690
+ 1.5,
6691
+ 2,
6692
+ 2.5,
6693
+ 3,
6694
+ 4,
6695
+ 5,
6696
+ 7.5,
6697
+ 10,
6698
+ 15,
6699
+ 20,
6700
+ 25,
6701
+ 50,
6702
+ 100
6703
+ ];
6704
+ for (const m of multipliers) {
6705
+ if (m >= normalized) return Math.ceil(m * pow);
6706
+ }
6707
+ return Math.ceil(100 * pow);
6708
+ };
6709
+ var compactTick = (value) => {
6710
+ if (value >= 1e9)
6711
+ return (value / 1e9).toFixed(1).replace(/\.0$/, "") + "B";
6712
+ if (value >= 1e6)
6713
+ return (value / 1e6).toFixed(1).replace(/\.0$/, "") + "M";
6714
+ if (value >= 1e3) return (value / 1e3).toFixed(1).replace(/\.0$/, "") + "K";
6715
+ return String(value);
6716
+ };
6717
+ var resolveContainerPaddingLeft = (padding, containerPaddingLeft, defaultLeft = 16) => {
6718
+ if (typeof padding === "number") return padding;
6719
+ if (padding && typeof padding === "object" && padding.left != null)
6720
+ return padding.left;
6721
+ if (typeof containerPaddingLeft === "number") return containerPaddingLeft;
6722
+ return defaultLeft;
6723
+ };
6724
+ var resolveChartMargins = (margins, chartMargins, showLabels) => {
6725
+ const defaultRight = 30;
6726
+ const defaultLeft = 20;
6727
+ const topDefault = showLabels ? 48 : 20;
6728
+ const bottomDefault = 5;
6729
+ return {
6730
+ top: margins?.top ?? chartMargins?.top ?? topDefault,
6731
+ right: margins?.right ?? chartMargins?.right ?? defaultRight,
6732
+ left: margins?.left ?? chartMargins?.left ?? defaultLeft,
6733
+ bottom: margins?.bottom ?? chartMargins?.bottom ?? bottomDefault
6734
+ };
6735
+ };
6736
+
6737
+ // src/components/charts/utils/pillLabelRenderer.tsx
6738
+ var import_jsx_runtime56 = require("react/jsx-runtime");
6739
+ var formatCompactNumber = (value) => {
6740
+ const isNegative = value < 0;
6741
+ const absValue = Math.abs(value);
6742
+ let formatted;
6743
+ if (absValue >= 1e9) {
6744
+ formatted = (absValue / 1e9).toFixed(1).replace(/\.0$/, "") + "B";
6745
+ } else if (absValue >= 1e6) {
6746
+ formatted = (absValue / 1e6).toFixed(1).replace(/\.0$/, "") + "M";
6747
+ } else if (absValue >= 1e3) {
6748
+ formatted = (absValue / 1e3).toFixed(1).replace(/\.0$/, "") + "K";
6749
+ } else {
6750
+ formatted = absValue.toString();
6751
+ }
6752
+ return isNegative ? `-${formatted}` : formatted;
6753
+ };
6754
+ var parseNumber = (v) => {
6755
+ if (typeof v === "number") return v;
6756
+ if (typeof v === "string" && v.trim() !== "" && !Number.isNaN(Number(v)))
6757
+ return Number(v);
6758
+ return void 0;
6759
+ };
6760
+ var renderPillLabel = (color, variant) => {
6761
+ return (props) => {
6762
+ const { x, y, value } = props;
6763
+ const text = typeof value === "number" ? formatCompactNumber(value) : String(value ?? "");
6764
+ const paddingX = 8;
6765
+ const approxCharWidth = 7;
6766
+ const pillWidth = Math.max(
6767
+ 40,
6768
+ String(text).length * approxCharWidth + paddingX * 2
6769
+ );
6770
+ const pillHeight = 20;
6771
+ const xNum = parseNumber(x);
6772
+ const px = parseNumber(props.x);
6773
+ const pWidth = parseNumber(props.width);
6774
+ const vb = props.viewBox;
6775
+ const cxNum = parseNumber(props.cx);
6776
+ let centerX;
6777
+ if (typeof px === "number" && typeof pWidth === "number") {
6778
+ centerX = px + pWidth / 2;
6779
+ } else if (typeof xNum === "number" && typeof pWidth === "number") {
6780
+ centerX = xNum + pWidth / 2;
6781
+ } else if (typeof cxNum === "number") {
6782
+ centerX = cxNum;
6783
+ } else if (vb && typeof vb.x === "number" && typeof vb.width === "number" && typeof props.index === "number") {
6784
+ const approxCols = Math.max(1, props.index + 1);
6785
+ const colWidth = vb.width / approxCols;
6786
+ centerX = vb.x + colWidth * (props.index + 0.5);
6787
+ } else if (vb && typeof vb.x === "number" && typeof vb.width === "number") {
6788
+ centerX = vb.x + vb.width / 2;
6789
+ } else {
6790
+ centerX = typeof props.index === "number" ? props.index * 40 + 24 : 0;
6791
+ }
6792
+ if (vb && typeof vb.x === "number" && typeof vb.width === "number") {
6793
+ const minX = vb.x + 0 + pillWidth / 22;
6794
+ const maxX = vb.x + vb.width - 2 - pillWidth / 2;
6795
+ centerX = Math.max(minX, Math.min(maxX, centerX));
6796
+ }
6797
+ const yNum = parseNumber(y);
6798
+ const py = parseNumber(props.y);
6799
+ const cyNum = parseNumber(props.cy);
6800
+ const centerY = yNum ?? (typeof py === "number" ? py : vb && typeof vb.y === "number" && typeof vb.height === "number" ? vb.y + vb.height / 2 : typeof cyNum === "number" ? cyNum : 0);
6801
+ const rectX = centerX - pillWidth / 2;
6802
+ const rectY = centerY - pillHeight - 6;
6803
+ const textX = centerX;
6804
+ const textY = rectY + pillHeight / 2 + 3;
6805
+ const rectFill = variant === "filled" ? color : variant === "soft" ? `${color}20` : "#ffffff";
6806
+ const rectStroke = variant === "outline" ? `${color}CC` : void 0;
6807
+ const numValue = parseNumber(value);
6808
+ const isNegative = typeof numValue === "number" && numValue < 0;
6809
+ let textColor;
6810
+ if (isNegative) {
6811
+ textColor = "#dc2626";
6812
+ } else {
6813
+ if (variant === "filled") {
6814
+ textColor = "#ffffff";
6815
+ } else {
6816
+ textColor = "#374151";
6817
+ }
6818
+ }
6819
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("g", { children: [
6820
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6821
+ "rect",
6822
+ {
6823
+ x: rectX,
6824
+ y: rectY,
6825
+ rx: pillHeight / 2,
6826
+ width: pillWidth,
6827
+ height: pillHeight,
6828
+ fill: rectFill,
6829
+ stroke: rectStroke,
6830
+ strokeWidth: rectStroke ? 1 : 0
6831
+ }
6832
+ ),
6833
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6834
+ "text",
6835
+ {
6836
+ x: textX,
6837
+ y: textY - 3,
6838
+ fill: textColor,
6839
+ fontSize: 13,
6840
+ fontWeight: 700,
6841
+ textAnchor: "middle",
6842
+ dominantBaseline: "central",
6843
+ letterSpacing: 0.2,
6844
+ children: text
6845
+ }
6846
+ )
6847
+ ] });
6848
+ };
6849
+ };
6850
+ var pillLabelRenderer_default = renderPillLabel;
6851
+
6852
+ // src/hooks/use-drag.tsx
6853
+ var import_react35 = require("react");
6854
+ var useDrag = (options = {}) => {
6855
+ const [isDragging, setIsDragging] = (0, import_react35.useState)(null);
6856
+ const [positions, setPositions] = (0, import_react35.useState)({});
6857
+ const dragStartPos = (0, import_react35.useRef)(null);
6858
+ const dragId = (0, import_react35.useRef)(null);
6859
+ const handleMouseDown = (0, import_react35.useCallback)((id, e) => {
6860
+ e.preventDefault();
6861
+ const currentPosition = positions[id] || { top: 0, left: 0 };
6862
+ dragStartPos.current = {
6863
+ x: e.clientX,
6864
+ y: e.clientY,
6865
+ elementX: currentPosition.left,
6866
+ elementY: currentPosition.top
6867
+ };
6868
+ dragId.current = id;
6869
+ setIsDragging(id);
6870
+ options.onDragStart?.(id);
6871
+ }, [positions, options]);
6872
+ const handleMouseMove = (0, import_react35.useCallback)((e) => {
6873
+ if (!isDragging || !dragStartPos.current || !dragId.current) return;
6874
+ const deltaX = e.clientX - dragStartPos.current.x;
6875
+ const deltaY = e.clientY - dragStartPos.current.y;
6876
+ const newPosition = {
6877
+ left: dragStartPos.current.elementX + deltaX,
6878
+ top: dragStartPos.current.elementY + deltaY
6879
+ };
6880
+ newPosition.left = Math.max(0, Math.min(window.innerWidth - 300, newPosition.left));
6881
+ newPosition.top = Math.max(0, Math.min(window.innerHeight - 200, newPosition.top));
6882
+ setPositions((prev) => ({
6883
+ ...prev,
6884
+ [dragId.current]: newPosition
6885
+ }));
6886
+ options.onDrag?.(dragId.current, newPosition);
6887
+ }, [isDragging, options]);
6888
+ const handleMouseUp = (0, import_react35.useCallback)(() => {
6889
+ if (dragId.current) {
6890
+ options.onDragEnd?.(dragId.current);
6891
+ }
6892
+ setIsDragging(null);
6893
+ dragStartPos.current = null;
6894
+ dragId.current = null;
6895
+ }, [options]);
6896
+ (0, import_react35.useEffect)(() => {
6897
+ if (isDragging) {
6898
+ document.addEventListener("mousemove", handleMouseMove);
6899
+ document.addEventListener("mouseup", handleMouseUp);
6900
+ document.body.style.userSelect = "none";
6901
+ return () => {
6902
+ document.removeEventListener("mousemove", handleMouseMove);
6903
+ document.removeEventListener("mouseup", handleMouseUp);
6904
+ document.body.style.userSelect = "";
6905
+ };
6906
+ }
6907
+ }, [isDragging, handleMouseMove, handleMouseUp]);
6908
+ const setPosition = (0, import_react35.useCallback)((id, position) => {
6909
+ setPositions((prev) => ({
6910
+ ...prev,
6911
+ [id]: position
6912
+ }));
6913
+ }, []);
6914
+ const getPosition = (0, import_react35.useCallback)((id) => {
6915
+ return positions[id] || { top: 0, left: 0 };
6916
+ }, [positions]);
6917
+ const isElementDragging = (0, import_react35.useCallback)((id) => {
6918
+ return isDragging === id;
6919
+ }, [isDragging]);
6920
+ return {
6921
+ handleMouseDown,
6922
+ getPosition,
6923
+ setPosition,
6924
+ isElementDragging,
6925
+ isDragging: isDragging !== null
6926
+ };
6927
+ };