@algorithm-shift/design-system 1.2.978 → 1.2.979

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
@@ -47,6 +47,7 @@ __export(src_exports, {
47
47
  FileInput: () => FileInput_default,
48
48
  FlexLayout: () => Flex_default,
49
49
  GridLayout: () => Grid_default,
50
+ HistoryTimeline: () => HistoryTimeline_default,
50
51
  Icon: () => Icon_default,
51
52
  Image: () => Image_default,
52
53
  Modal: () => Modal,
@@ -30514,29 +30515,230 @@ var CustomPagination = ({
30514
30515
  };
30515
30516
  var Pagination_default = CustomPagination;
30516
30517
 
30517
- // src/components/Navigation/Tabs/Tabs.tsx
30518
+ // src/components/DataDisplay/HistoryTimeline/HistoryTimeline.tsx
30518
30519
  var import_react30 = require("react");
30520
+
30521
+ // src/components/ui/accordion.tsx
30522
+ var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
30523
+ var import_jsx_runtime55 = require("react/jsx-runtime");
30524
+ function Accordion2({
30525
+ ...props
30526
+ }) {
30527
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
30528
+ }
30529
+ function AccordionItem({
30530
+ className,
30531
+ ...props
30532
+ }) {
30533
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30534
+ AccordionPrimitive.Item,
30535
+ {
30536
+ "data-slot": "accordion-item",
30537
+ className: cn("border-b last:border-b-0", className),
30538
+ ...props
30539
+ }
30540
+ );
30541
+ }
30542
+ function AccordionTrigger({
30543
+ className,
30544
+ children,
30545
+ ...props
30546
+ }) {
30547
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
30548
+ AccordionPrimitive.Trigger,
30549
+ {
30550
+ "data-slot": "accordion-trigger",
30551
+ className: cn(
30552
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
30553
+ className
30554
+ ),
30555
+ ...props,
30556
+ children: [
30557
+ children,
30558
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
30559
+ ]
30560
+ }
30561
+ ) });
30562
+ }
30563
+ function AccordionContent({
30564
+ className,
30565
+ children,
30566
+ ...props
30567
+ }) {
30568
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30569
+ AccordionPrimitive.Content,
30570
+ {
30571
+ "data-slot": "accordion-content",
30572
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
30573
+ ...props,
30574
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("pt-0 pb-4", className), children })
30575
+ }
30576
+ );
30577
+ }
30578
+
30579
+ // src/components/ui/card.tsx
30580
+ var import_jsx_runtime56 = require("react/jsx-runtime");
30581
+ function Card({ className, ...props }) {
30582
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30583
+ "div",
30584
+ {
30585
+ "data-slot": "card",
30586
+ className: cn(
30587
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
30588
+ className
30589
+ ),
30590
+ ...props
30591
+ }
30592
+ );
30593
+ }
30594
+ function CardHeader({ className, ...props }) {
30595
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30596
+ "div",
30597
+ {
30598
+ "data-slot": "card-header",
30599
+ className: cn(
30600
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
30601
+ className
30602
+ ),
30603
+ ...props
30604
+ }
30605
+ );
30606
+ }
30607
+ function CardTitle({ className, ...props }) {
30608
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30609
+ "div",
30610
+ {
30611
+ "data-slot": "card-title",
30612
+ className: cn("leading-none font-semibold", className),
30613
+ ...props
30614
+ }
30615
+ );
30616
+ }
30617
+ function CardContent({ className, ...props }) {
30618
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30619
+ "div",
30620
+ {
30621
+ "data-slot": "card-content",
30622
+ className: cn("px-6", className),
30623
+ ...props
30624
+ }
30625
+ );
30626
+ }
30627
+
30628
+ // src/components/DataDisplay/HistoryTimeline/HistoryTimeline.tsx
30629
+ var import_jsx_runtime57 = require("react/jsx-runtime");
30630
+ function getValue(item, key) {
30631
+ if (!key) return void 0;
30632
+ return item[key];
30633
+ }
30634
+ var HistoryTimeline = ({
30635
+ title = "Timeline",
30636
+ className,
30637
+ loading = false,
30638
+ titleKey,
30639
+ descriptionKey,
30640
+ createdAtKey,
30641
+ ...props
30642
+ }) => {
30643
+ const data = (0, import_react30.useMemo)(() => {
30644
+ if (Array.isArray(props.data)) {
30645
+ return props.data;
30646
+ }
30647
+ return [];
30648
+ }, [props.data]);
30649
+ if (loading) {
30650
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Card, { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(CardContent, { className: "flex items-center justify-center px-4 py-8", children: [
30651
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(LoaderCircle, { className: "h-5 w-5 animate-spin text-muted-foreground" }),
30652
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "ml-2 text-sm text-muted-foreground", children: "Loading history\u2026" })
30653
+ ] }) });
30654
+ }
30655
+ if (data.length === 0) {
30656
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Card, { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CardContent, { className: "px-4 py-8 text-center text-muted-foreground", children: "No history available." }) });
30657
+ }
30658
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Card, { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Accordion2, { type: "single", collapsible: true, defaultValue: "history", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(AccordionItem, { value: "history", className: "border-0", children: [
30659
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 border-b px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30660
+ AccordionTrigger,
30661
+ {
30662
+ className: cn(
30663
+ "flex flex-1 items-center justify-between gap-2 p-0 text-left",
30664
+ "hover:no-underline"
30665
+ ),
30666
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CardTitle, { className: "text-base font-semibold", children: title })
30667
+ }
30668
+ ) }),
30669
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(AccordionContent, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CardContent, { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ol", { className: "relative ml-4 border-l-2 border-[#939393] space-y-4", children: data.map((item, index) => {
30670
+ const id = item.id ?? index;
30671
+ const rawTitle = getValue(item, titleKey);
30672
+ const rawDescription = getValue(item, descriptionKey);
30673
+ const rawCreatedAt = getValue(item, createdAtKey);
30674
+ const titleText = String(rawTitle ?? "");
30675
+ const descriptionText = rawDescription != null ? String(rawDescription) : "";
30676
+ const createdAtDate = rawCreatedAt != null ? new Date(rawCreatedAt) : null;
30677
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "relative pl-4", children: [
30678
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "absolute left-[-9px] top-2 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-[#06A59A] text-white rounded-md p-[5px]", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30679
+ Info,
30680
+ {
30681
+ className: cn(
30682
+ "h-5 w-5 text-white"
30683
+ )
30684
+ }
30685
+ ) }) }),
30686
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30687
+ Accordion2,
30688
+ {
30689
+ type: "single",
30690
+ collapsible: true,
30691
+ className: "w-full",
30692
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(AccordionItem, { value: `item-${item.id}`, className: "border-0", children: [
30693
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30694
+ AccordionTrigger,
30695
+ {
30696
+ className: cn(
30697
+ "flex items-center justify-between gap-2 rounded-md px-2 py-1 text-left",
30698
+ "hover:bg-muted/60 hover:no-underline"
30699
+ ),
30700
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-1", children: [
30701
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-medium leading-none", children: titleText }),
30702
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[11px] text-muted-foreground", children: new Intl.DateTimeFormat("default", {
30703
+ dateStyle: "medium",
30704
+ timeStyle: "short"
30705
+ }).format(createdAtDate ?? /* @__PURE__ */ new Date()) })
30706
+ ] })
30707
+ }
30708
+ ),
30709
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(AccordionContent, { className: "pt-1", children: descriptionText && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "rounded-md bg-muted px-2 py-2 text-xs text-muted-foreground", children: descriptionText }) })
30710
+ ] })
30711
+ }
30712
+ )
30713
+ ] }, id);
30714
+ }) }) }) })
30715
+ ] }) }) });
30716
+ };
30717
+ var HistoryTimeline_default = HistoryTimeline;
30718
+
30719
+ // src/components/Navigation/Tabs/Tabs.tsx
30720
+ var import_react31 = require("react");
30519
30721
  var import_link5 = __toESM(require("next/link"));
30520
30722
  var import_navigation3 = require("next/navigation");
30521
30723
 
30522
30724
  // src/components/ui/dialog.tsx
30523
30725
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
30524
- var import_jsx_runtime55 = require("react/jsx-runtime");
30726
+ var import_jsx_runtime58 = require("react/jsx-runtime");
30525
30727
  function Dialog({
30526
30728
  ...props
30527
30729
  }) {
30528
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
30730
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
30529
30731
  }
30530
30732
  function DialogPortal({
30531
30733
  ...props
30532
30734
  }) {
30533
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
30735
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
30534
30736
  }
30535
30737
  function DialogOverlay({
30536
30738
  className,
30537
30739
  ...props
30538
30740
  }) {
30539
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30741
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30540
30742
  DialogPrimitive.Overlay,
30541
30743
  {
30542
30744
  "data-slot": "dialog-overlay",
@@ -30554,9 +30756,9 @@ function DialogContent({
30554
30756
  showCloseButton = true,
30555
30757
  ...props
30556
30758
  }) {
30557
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
30558
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogOverlay, {}),
30559
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
30759
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
30760
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DialogOverlay, {}),
30761
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
30560
30762
  DialogPrimitive.Content,
30561
30763
  {
30562
30764
  "data-slot": "dialog-content",
@@ -30567,14 +30769,14 @@ function DialogContent({
30567
30769
  ...props,
30568
30770
  children: [
30569
30771
  children,
30570
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
30772
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
30571
30773
  DialogPrimitive.Close,
30572
30774
  {
30573
30775
  "data-slot": "dialog-close",
30574
30776
  className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
30575
30777
  children: [
30576
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(X, {}),
30577
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Close" })
30778
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(X, {}),
30779
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "sr-only", children: "Close" })
30578
30780
  ]
30579
30781
  }
30580
30782
  )
@@ -30584,7 +30786,7 @@ function DialogContent({
30584
30786
  ] });
30585
30787
  }
30586
30788
  function DialogHeader({ className, ...props }) {
30587
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30789
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30588
30790
  "div",
30589
30791
  {
30590
30792
  "data-slot": "dialog-header",
@@ -30594,7 +30796,7 @@ function DialogHeader({ className, ...props }) {
30594
30796
  );
30595
30797
  }
30596
30798
  function DialogFooter({ className, ...props }) {
30597
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30799
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30598
30800
  "div",
30599
30801
  {
30600
30802
  "data-slot": "dialog-footer",
@@ -30610,7 +30812,7 @@ function DialogTitle({
30610
30812
  className,
30611
30813
  ...props
30612
30814
  }) {
30613
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30815
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30614
30816
  DialogPrimitive.Title,
30615
30817
  {
30616
30818
  "data-slot": "dialog-title",
@@ -30623,7 +30825,7 @@ function DialogDescription({
30623
30825
  className,
30624
30826
  ...props
30625
30827
  }) {
30626
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30828
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30627
30829
  DialogPrimitive.Description,
30628
30830
  {
30629
30831
  "data-slot": "dialog-description",
@@ -30671,9 +30873,9 @@ function showSonnerToast({
30671
30873
  }
30672
30874
 
30673
30875
  // src/components/Navigation/Tabs/Tabs.tsx
30674
- var import_jsx_runtime56 = require("react/jsx-runtime");
30876
+ var import_jsx_runtime59 = require("react/jsx-runtime");
30675
30877
  var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading, bgActiveColor, textActiveColor }) => {
30676
- const [openIndex, setOpenIndex] = (0, import_react30.useState)(null);
30878
+ const [openIndex, setOpenIndex] = (0, import_react31.useState)(null);
30677
30879
  const currentPathname = (0, import_navigation3.usePathname)();
30678
30880
  function groupMenus(menus = []) {
30679
30881
  const menuMap = /* @__PURE__ */ new Map();
@@ -30707,7 +30909,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30707
30909
  });
30708
30910
  return sortMenus(rootMenus);
30709
30911
  }
30710
- const rawTabs = (0, import_react30.useMemo)(() => {
30912
+ const rawTabs = (0, import_react31.useMemo)(() => {
30711
30913
  if (!Array.isArray(tabs)) return [];
30712
30914
  if (source === "manual") return Array.isArray(tabs) ? tabs : [];
30713
30915
  return groupMenus(tabs);
@@ -30737,9 +30939,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30737
30939
  return tab.children.some((child) => isActive(child.url));
30738
30940
  };
30739
30941
  const router = (0, import_navigation3.useRouter)();
30740
- const [showExitDialog, setShowExitDialog] = (0, import_react30.useState)(false);
30741
- const [pendingUrl, setPendingUrl] = (0, import_react30.useState)(null);
30742
- const handleBuilderExit = (0, import_react30.useCallback)(
30942
+ const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
30943
+ const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
30944
+ const handleBuilderExit = (0, import_react31.useCallback)(
30743
30945
  (e, url) => {
30744
30946
  if (isBuilder) {
30745
30947
  e.preventDefault();
@@ -30770,13 +30972,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30770
30972
  border: active && textActiveColor ? `1px solid ${textActiveColor}` : void 0
30771
30973
  };
30772
30974
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
30773
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
30975
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
30774
30976
  DropdownMenu,
30775
30977
  {
30776
30978
  open: openIndex === index,
30777
30979
  onOpenChange: (open) => setOpenIndex(open ? index : null),
30778
30980
  children: [
30779
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
30981
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
30780
30982
  DropdownMenuTrigger,
30781
30983
  {
30782
30984
  className: `${finalClasses} inline-flex items-center gap-1`,
@@ -30790,11 +30992,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30790
30992
  style: finalStyle,
30791
30993
  children: [
30792
30994
  tab.header,
30793
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30995
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30794
30996
  ]
30795
30997
  }
30796
30998
  ),
30797
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30999
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30798
31000
  DropdownMenuContent,
30799
31001
  {
30800
31002
  align: "start",
@@ -30807,12 +31009,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30807
31009
  onMouseLeave: () => {
30808
31010
  timeout = setTimeout(() => setOpenIndex(null), 150);
30809
31011
  },
30810
- children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31012
+ children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30811
31013
  DropdownMenuItem,
30812
31014
  {
30813
31015
  asChild: true,
30814
31016
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
30815
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31017
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30816
31018
  import_link5.default,
30817
31019
  {
30818
31020
  href: item.url || "#",
@@ -30831,7 +31033,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30831
31033
  index
30832
31034
  );
30833
31035
  }
30834
- return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31036
+ return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30835
31037
  import_link5.default,
30836
31038
  {
30837
31039
  href: tab.url,
@@ -30842,14 +31044,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30842
31044
  children: tab.header
30843
31045
  },
30844
31046
  index
30845
- ) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style: finalStyle, role: "button", tabIndex: 0, children: tab.header }, index);
31047
+ ) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: finalClasses, style: finalStyle, role: "button", tabIndex: 0, children: tab.header }, index);
30846
31048
  };
30847
- const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
30848
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
30849
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Menu, { className: "h-4 w-4" }),
31049
+ const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DropdownMenu, { children: [
31050
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
31051
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Menu, { className: "h-4 w-4" }),
30850
31052
  "Menu"
30851
31053
  ] }),
30852
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31054
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30853
31055
  DropdownMenuContent,
30854
31056
  {
30855
31057
  align: "start",
@@ -30858,25 +31060,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30858
31060
  children: rawTabs.map((tab, i) => {
30859
31061
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
30860
31062
  if (hasChildren) {
30861
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuSub, { children: [
30862
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
30863
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31063
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DropdownMenuSub, { children: [
31064
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
31065
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30864
31066
  DropdownMenuItem,
30865
31067
  {
30866
31068
  asChild: true,
30867
31069
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
30868
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
31070
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30869
31071
  },
30870
31072
  item.id || index
30871
31073
  )) })
30872
31074
  ] }, i);
30873
31075
  }
30874
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
31076
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
30875
31077
  DropdownMenuItem,
30876
31078
  {
30877
31079
  asChild: true,
30878
31080
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
30879
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
31081
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30880
31082
  },
30881
31083
  i
30882
31084
  );
@@ -30886,19 +31088,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30886
31088
  ] });
30887
31089
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
30888
31090
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
30889
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
30890
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("min-h-10", className), style, children: [
30891
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30892
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
31091
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
31092
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: cn("min-h-10", className), style, children: [
31093
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
31094
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
30893
31095
  ] }),
30894
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30895
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogHeader, { children: [
30896
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogTitle, { children: "Exit Builder?" }),
30897
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
31096
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
31097
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DialogHeader, { children: [
31098
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DialogTitle, { children: "Exit Builder?" }),
31099
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30898
31100
  ] }),
30899
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogFooter, { children: [
30900
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30901
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
31101
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(DialogFooter, { children: [
31102
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
31103
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30902
31104
  ] })
30903
31105
  ] }) })
30904
31106
  ] });
@@ -30906,8 +31108,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30906
31108
  var Tabs_default = Tabs;
30907
31109
 
30908
31110
  // src/components/Navigation/Stages/Stages.tsx
30909
- var import_react31 = __toESM(require("react"));
30910
- var import_jsx_runtime57 = require("react/jsx-runtime");
31111
+ var import_react32 = __toESM(require("react"));
31112
+ var import_jsx_runtime60 = require("react/jsx-runtime");
30911
31113
  var StagesComponent = ({
30912
31114
  stages,
30913
31115
  isShowBtn,
@@ -30923,8 +31125,8 @@ var StagesComponent = ({
30923
31125
  triggerOnClick = false,
30924
31126
  canvasMode = "desktop"
30925
31127
  }) => {
30926
- const [activeStage, setActiveStage] = (0, import_react31.useState)(currentStage || (stages && stages.length > 0 ? stages[0][dataKey] : null));
30927
- const [isCompleted, setIsCompleted] = (0, import_react31.useState)(false);
31128
+ const [activeStage, setActiveStage] = (0, import_react32.useState)(currentStage || (stages && stages.length > 0 ? stages[0][dataKey] : null));
31129
+ const [isCompleted, setIsCompleted] = (0, import_react32.useState)(false);
30928
31130
  const updateStage = (stageKey) => {
30929
31131
  setActiveStage(stageKey);
30930
31132
  onStageChange?.(stageKey);
@@ -30955,7 +31157,7 @@ var StagesComponent = ({
30955
31157
  };
30956
31158
  const isAllStagesCompleted = isCompleted || currentStage === lastStage;
30957
31159
  const disabled = isAllStagesCompleted || loading || saving;
30958
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
31160
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
30959
31161
  "div",
30960
31162
  {
30961
31163
  className: `
@@ -30965,8 +31167,8 @@ var StagesComponent = ({
30965
31167
  ${isMobile ? "p-3 sm:p-4" : "p-2"}
30966
31168
  `,
30967
31169
  children: [
30968
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30969
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
31170
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex items-center flex-shrink-0 order-1 lg:order-1", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
31171
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
30970
31172
  "div",
30971
31173
  {
30972
31174
  className: `
@@ -30974,7 +31176,7 @@ var StagesComponent = ({
30974
31176
  flex-wrap gap-2 sm:gap-2 lg:gap-3 w-full lg:w-auto
30975
31177
  ${isMobile ? "order-2 mt-2 lg:mt-0" : "order-2"}
30976
31178
  `,
30977
- children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
31179
+ children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
30978
31180
  "button",
30979
31181
  {
30980
31182
  className: `
@@ -30992,8 +31194,8 @@ var StagesComponent = ({
30992
31194
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
30993
31195
  const isCompletedStage = isAllStagesCompleted || index <= currentIndex;
30994
31196
  const isActive = !isAllStagesCompleted && index === currentIndex;
30995
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react31.default.Fragment, { children: [
30996
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
31197
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react32.default.Fragment, { children: [
31198
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
30997
31199
  "button",
30998
31200
  {
30999
31201
  className: `
@@ -31010,19 +31212,19 @@ var StagesComponent = ({
31010
31212
  children: stage[dataLabel]
31011
31213
  }
31012
31214
  ),
31013
- !isMobile && index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
31215
+ !isMobile && index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "hidden sm:flex sm:flex-shrink-0 w-3 h-px bg-gray-300 sm:w-4" })
31014
31216
  ] }, stage.id);
31015
31217
  })
31016
31218
  }
31017
31219
  ),
31018
- isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
31220
+ isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
31019
31221
  "div",
31020
31222
  {
31021
31223
  className: `
31022
31224
  flex items-center flex-shrink-0 w-full lg:w-auto
31023
31225
  ${isMobile ? "order-3 mt-3 lg:mt-0" : "order-3"}
31024
31226
  `,
31025
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
31227
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
31026
31228
  "button",
31027
31229
  {
31028
31230
  className: `
@@ -31044,26 +31246,26 @@ var StagesComponent = ({
31044
31246
  var Stages_default = StagesComponent;
31045
31247
 
31046
31248
  // src/components/Navigation/Spacer/Spacer.tsx
31047
- var import_jsx_runtime58 = require("react/jsx-runtime");
31249
+ var import_jsx_runtime61 = require("react/jsx-runtime");
31048
31250
  var Spacer = ({ className, style }) => {
31049
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: `${className}`, style });
31251
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: `${className}`, style });
31050
31252
  };
31051
31253
  var Spacer_default = Spacer;
31052
31254
 
31053
31255
  // src/components/Navigation/Profile/Profile.tsx
31054
- var import_jsx_runtime59 = require("react/jsx-runtime");
31256
+ var import_jsx_runtime62 = require("react/jsx-runtime");
31055
31257
 
31056
31258
  // src/components/Navigation/Notification/Notification.tsx
31057
- var import_jsx_runtime60 = require("react/jsx-runtime");
31259
+ var import_jsx_runtime63 = require("react/jsx-runtime");
31058
31260
 
31059
31261
  // src/components/Navigation/Logo/Logo.tsx
31060
- var import_jsx_runtime61 = require("react/jsx-runtime");
31262
+ var import_jsx_runtime64 = require("react/jsx-runtime");
31061
31263
 
31062
31264
  // src/components/ui/avatar.tsx
31063
31265
  var React11 = __toESM(require("react"));
31064
31266
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
31065
- var import_jsx_runtime62 = require("react/jsx-runtime");
31066
- var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
31267
+ var import_jsx_runtime65 = require("react/jsx-runtime");
31268
+ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
31067
31269
  AvatarPrimitive.Root,
31068
31270
  {
31069
31271
  ref,
@@ -31075,7 +31277,7 @@ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
31075
31277
  }
31076
31278
  ));
31077
31279
  Avatar.displayName = AvatarPrimitive.Root.displayName;
31078
- var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
31280
+ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
31079
31281
  AvatarPrimitive.Image,
31080
31282
  {
31081
31283
  ref,
@@ -31084,7 +31286,7 @@ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
31084
31286
  }
31085
31287
  ));
31086
31288
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
31087
- var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
31289
+ var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
31088
31290
  AvatarPrimitive.Fallback,
31089
31291
  {
31090
31292
  ref,
@@ -31102,8 +31304,8 @@ var import_link6 = __toESM(require("next/link"));
31102
31304
  var import_image4 = __toESM(require("next/image"));
31103
31305
  var import_navigation4 = require("next/navigation");
31104
31306
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
31105
- var import_react32 = require("react");
31106
- var import_jsx_runtime63 = require("react/jsx-runtime");
31307
+ var import_react33 = require("react");
31308
+ var import_jsx_runtime66 = require("react/jsx-runtime");
31107
31309
  function Navbar({
31108
31310
  style,
31109
31311
  badgeType,
@@ -31123,9 +31325,9 @@ function Navbar({
31123
31325
  }) {
31124
31326
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
31125
31327
  const router = (0, import_navigation4.useRouter)();
31126
- const [showExitDialog, setShowExitDialog] = (0, import_react32.useState)(false);
31127
- const [pendingUrl, setPendingUrl] = (0, import_react32.useState)(null);
31128
- const handleBuilderExit = (0, import_react32.useCallback)(
31328
+ const [showExitDialog, setShowExitDialog] = (0, import_react33.useState)(false);
31329
+ const [pendingUrl, setPendingUrl] = (0, import_react33.useState)(null);
31330
+ const handleBuilderExit = (0, import_react33.useCallback)(
31129
31331
  (e, url) => {
31130
31332
  if (isBuilder) {
31131
31333
  e.preventDefault();
@@ -31141,29 +31343,29 @@ function Navbar({
31141
31343
  router.push(pendingUrl);
31142
31344
  }
31143
31345
  };
31144
- const formatedMenu = (0, import_react32.useMemo)(() => {
31346
+ const formatedMenu = (0, import_react33.useMemo)(() => {
31145
31347
  if (source === "state" && navList && navList.length) {
31146
31348
  return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
31147
31349
  }
31148
31350
  return list || [];
31149
31351
  }, [source, navList]);
31150
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
31151
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31352
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
31353
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31152
31354
  "nav",
31153
31355
  {
31154
31356
  className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
31155
31357
  style,
31156
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
31157
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31358
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
31359
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31158
31360
  import_link6.default,
31159
31361
  {
31160
31362
  href: "/",
31161
31363
  onClick: (e) => handleBuilderExit(e, "/"),
31162
31364
  className: "flex items-center space-x-2",
31163
- children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
31365
+ children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
31164
31366
  }
31165
31367
  ),
31166
- !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31368
+ !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31167
31369
  import_link6.default,
31168
31370
  {
31169
31371
  href: item.url || "#",
@@ -31173,39 +31375,39 @@ function Navbar({
31173
31375
  },
31174
31376
  item.id
31175
31377
  )) }),
31176
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-3", children: [
31177
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
31178
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
31179
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
31180
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
31181
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
31182
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
31183
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
31378
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-3", children: [
31379
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
31380
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
31381
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
31382
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
31383
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
31384
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
31385
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
31184
31386
  ] }),
31185
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenu, { children: [
31186
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-2", children: [
31187
- !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
31188
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
31189
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31387
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DropdownMenu, { children: [
31388
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center space-x-2", children: [
31389
+ !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
31390
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
31391
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31190
31392
  AvatarImage,
31191
31393
  {
31192
31394
  src: "/images/appbuilder/toolset/profile.svg",
31193
31395
  alt: "Profile"
31194
31396
  }
31195
- ) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
31196
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31397
+ ) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
31398
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31197
31399
  Button,
31198
31400
  {
31199
31401
  variant: "ghost",
31200
31402
  size: "icon",
31201
31403
  className: "text-gray-900 md:hidden dark:invert",
31202
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" })
31404
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Menu, { className: "h-6 w-6" })
31203
31405
  }
31204
31406
  )
31205
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" }) })
31407
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Menu, { className: "h-6 w-6" }) })
31206
31408
  ] }) }),
31207
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
31208
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31409
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
31410
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31209
31411
  import_link6.default,
31210
31412
  {
31211
31413
  href: item.url || "#",
@@ -31213,9 +31415,9 @@ function Navbar({
31213
31415
  children: item.header
31214
31416
  }
31215
31417
  ) }, item.id)) }),
31216
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "md:hidden", children: [
31217
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
31218
- formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
31418
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "md:hidden", children: [
31419
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
31420
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
31219
31421
  import_link6.default,
31220
31422
  {
31221
31423
  href: item.url || "#",
@@ -31230,24 +31432,24 @@ function Navbar({
31230
31432
  ] })
31231
31433
  }
31232
31434
  ),
31233
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
31234
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogHeader, { children: [
31235
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogTitle, { children: "Exit Builder?" }),
31236
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
31435
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
31436
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DialogHeader, { children: [
31437
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogTitle, { children: "Exit Builder?" }),
31438
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
31237
31439
  ] }),
31238
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogFooter, { children: [
31239
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
31240
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
31440
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(DialogFooter, { children: [
31441
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
31442
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
31241
31443
  ] })
31242
31444
  ] }) })
31243
31445
  ] });
31244
31446
  }
31245
31447
 
31246
31448
  // src/components/Chart/BarChart.tsx
31247
- var import_react33 = __toESM(require("react"));
31449
+ var import_react34 = __toESM(require("react"));
31248
31450
  var import_axios2 = __toESM(require("axios"));
31249
31451
  var import_recharts = require("recharts");
31250
- var import_jsx_runtime64 = require("react/jsx-runtime");
31452
+ var import_jsx_runtime67 = require("react/jsx-runtime");
31251
31453
  var getRandomColor = () => {
31252
31454
  const palette = [
31253
31455
  "#2563eb",
@@ -31305,18 +31507,18 @@ var ChartComponent = ({
31305
31507
  canvasMode,
31306
31508
  ...props
31307
31509
  }) => {
31308
- const [rawData, setRawData] = (0, import_react33.useState)([]);
31309
- const [rawMeta, setRawMeta] = (0, import_react33.useState)(null);
31310
- const [localLoading, setLocalLoading] = (0, import_react33.useState)(false);
31311
- const [currentPage, setCurrentPage] = (0, import_react33.useState)(1);
31510
+ const [rawData, setRawData] = (0, import_react34.useState)([]);
31511
+ const [rawMeta, setRawMeta] = (0, import_react34.useState)(null);
31512
+ const [localLoading, setLocalLoading] = (0, import_react34.useState)(false);
31513
+ const [currentPage, setCurrentPage] = (0, import_react34.useState)(1);
31312
31514
  const effectiveData = apiUrl ? rawData : props.data || [];
31313
31515
  const effectiveLoading = apiUrl ? localLoading : externalLoading;
31314
- (0, import_react33.useEffect)(() => {
31516
+ (0, import_react34.useEffect)(() => {
31315
31517
  if (apiUrl) {
31316
31518
  setCurrentPage(1);
31317
31519
  }
31318
31520
  }, [apiUrl]);
31319
- const fetchData = (0, import_react33.useCallback)(async (page) => {
31521
+ const fetchData = (0, import_react34.useCallback)(async (page) => {
31320
31522
  if (!apiUrl) return;
31321
31523
  const cancelled = false;
31322
31524
  try {
@@ -31325,7 +31527,8 @@ var ChartComponent = ({
31325
31527
  page: page.toString(),
31326
31528
  limit: limit.toString()
31327
31529
  });
31328
- const res = await import_axios2.default.get(`${apiUrl}?${params.toString()}`, {
31530
+ const axiosClient = props.axiosInstance ?? import_axios2.default;
31531
+ const res = await axiosClient.get(`${apiUrl}?${params.toString()}`, {
31329
31532
  withCredentials: true
31330
31533
  });
31331
31534
  if (!cancelled) {
@@ -31352,7 +31555,7 @@ var ChartComponent = ({
31352
31555
  if (!cancelled) setLocalLoading(false);
31353
31556
  }
31354
31557
  }, [apiUrl, limit]);
31355
- (0, import_react33.useEffect)(() => {
31558
+ (0, import_react34.useEffect)(() => {
31356
31559
  if (!apiUrl) return;
31357
31560
  fetchData(currentPage);
31358
31561
  }, [apiUrl, currentPage, fetchData]);
@@ -31360,7 +31563,7 @@ var ChartComponent = ({
31360
31563
  if (rawMeta && (newPage < 1 || newPage > rawMeta.pages)) return;
31361
31564
  setCurrentPage(newPage);
31362
31565
  };
31363
- const data = (0, import_react33.useMemo)(() => {
31566
+ const data = (0, import_react34.useMemo)(() => {
31364
31567
  if (!Array.isArray(effectiveData) || effectiveData.length === 0 || !dataKey || !dataLabel) {
31365
31568
  return [];
31366
31569
  }
@@ -31373,27 +31576,27 @@ var ChartComponent = ({
31373
31576
  const chartType = props.chartType || "bar";
31374
31577
  const legendsPosition = ["middle", "bottom"].includes(props.legendsPosition) ? props.legendsPosition : "top";
31375
31578
  if (effectiveLoading || data.length === 0) {
31376
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
31579
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
31377
31580
  "div",
31378
31581
  {
31379
31582
  className: `relative flex flex-col w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
31380
31583
  style,
31381
31584
  children: [
31382
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "inline-flex items-center space-x-2 bg-white/90 px-6 py-2.5 rounded-xl backdrop-blur-sm border border-gray-200 shadow-lg", children: [
31383
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
31384
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-sm font-medium text-gray-700 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
31585
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "inline-flex items-center space-x-2 bg-white/90 px-6 py-2.5 rounded-xl backdrop-blur-sm border border-gray-200 shadow-lg", children: [
31586
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "w-5 h-5 border-2 border-gray-400 border-t-blue-500 rounded-full animate-spin" }),
31587
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "text-sm font-medium text-gray-700 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
31385
31588
  ] }) }),
31386
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
31387
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-1 relative w-full h-full min-h-[240px] md:min-h-[320px] bg-white/80 rounded-lg border border-gray-200/50 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute bottom-0 left-4 right-4 flex gap-2 h-[200px] md:h-[280px] justify-center items-end", children: [...Array(20)].map((_, idx) => {
31589
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
31590
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-1 relative w-full h-full min-h-[240px] md:min-h-[320px] bg-white/80 rounded-lg border border-gray-200/50 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "absolute bottom-0 left-4 right-4 flex gap-2 h-[200px] md:h-[280px] justify-center items-end", children: [...Array(20)].map((_, idx) => {
31388
31591
  const randomHeight = `${Math.floor(Math.random() * 76) + 20}%`;
31389
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
31592
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
31390
31593
  "div",
31391
31594
  {
31392
31595
  className: `relative w-10 md:w-12 flex-1 max-w-[48px] rounded-t-lg bg-gradient-to-t from-gray-100 via-gray-200 to-transparent shadow-lg border border-gray-200/50 animate-slide-up stagger-${idx} overflow-hidden`,
31393
31596
  style: { height: randomHeight, animationDelay: `${idx * 0.08}s` },
31394
31597
  children: [
31395
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
31396
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
31598
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-white/40 via-transparent to-white/40 animate-shimmer-bar" }),
31599
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "absolute bottom-1 left-1/2 w-4 h-1 rounded-full transform -translate-x-1/2 blur-sm" })
31397
31600
  ]
31398
31601
  },
31399
31602
  `bar-${idx}`
@@ -31403,9 +31606,9 @@ var ChartComponent = ({
31403
31606
  }
31404
31607
  );
31405
31608
  }
31406
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: `${className} h-[450px]`, style, children: [
31407
- isPaginationEnabled && rawMeta && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center justify-between mb-4 px-2", children: [
31408
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
31609
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: `${className} h-[450px]`, style, children: [
31610
+ isPaginationEnabled && rawMeta && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center justify-between mb-4 px-2", children: [
31611
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "text-sm text-gray-600 hidden sm:block", children: [
31409
31612
  "Page ",
31410
31613
  rawMeta.page,
31411
31614
  " of ",
@@ -31414,52 +31617,52 @@ var ChartComponent = ({
31414
31617
  rawMeta.total.toLocaleString(),
31415
31618
  " total records)"
31416
31619
  ] }),
31417
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
31418
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31620
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-2 sm:hidden w-full justify-center", children: [
31621
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31419
31622
  "button",
31420
31623
  {
31421
31624
  onClick: () => handlePageChange(currentPage - 1),
31422
31625
  disabled: currentPage === 1 || localLoading,
31423
31626
  className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
31424
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: "\u2190 Prev" })
31627
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "\u2190 Prev" })
31425
31628
  }
31426
31629
  ),
31427
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
31428
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31630
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "px-2 py-2 text-xs font-semibold text-gray-700 min-w-[36px] text-center flex-shrink-0", children: currentPage }),
31631
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31429
31632
  "button",
31430
31633
  {
31431
31634
  onClick: () => handlePageChange(currentPage + 1),
31432
31635
  disabled: currentPage >= rawMeta.pages || localLoading,
31433
31636
  className: "flex-1 px-3 py-2 text-xs font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center justify-center space-x-1 min-w-0",
31434
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: "Next \u2192" })
31637
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Next \u2192" })
31435
31638
  }
31436
31639
  )
31437
31640
  ] }),
31438
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
31439
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31641
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center space-x-2 hidden sm:flex", children: [
31642
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31440
31643
  "button",
31441
31644
  {
31442
31645
  onClick: () => handlePageChange(currentPage - 1),
31443
31646
  disabled: currentPage === 1 || localLoading,
31444
31647
  className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
31445
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: "\u2190 Prev" })
31648
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "\u2190 Prev" })
31446
31649
  }
31447
31650
  ),
31448
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
31449
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31651
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "px-3 py-1 text-sm font-medium text-gray-700", children: currentPage }),
31652
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31450
31653
  "button",
31451
31654
  {
31452
31655
  onClick: () => handlePageChange(currentPage + 1),
31453
31656
  disabled: currentPage >= rawMeta.pages || localLoading,
31454
31657
  className: "px-3 py-1.5 text-sm font-medium rounded-lg border bg-white shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center space-x-1",
31455
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: "Next \u2192" })
31658
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: "Next \u2192" })
31456
31659
  }
31457
31660
  )
31458
31661
  ] })
31459
31662
  ] }),
31460
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.BarChart, { data, children: [
31461
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
31462
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31663
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_recharts.BarChart, { data, children: [
31664
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
31665
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31463
31666
  import_recharts.XAxis,
31464
31667
  {
31465
31668
  dataKey: dataLabel,
@@ -31477,7 +31680,7 @@ var ChartComponent = ({
31477
31680
  className: "hidden sm:block"
31478
31681
  }
31479
31682
  ),
31480
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31683
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31481
31684
  import_recharts.YAxis,
31482
31685
  {
31483
31686
  tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
@@ -31490,9 +31693,9 @@ var ChartComponent = ({
31490
31693
  width: 60
31491
31694
  }
31492
31695
  ),
31493
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => [`${value}`, "Count"] }),
31494
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
31495
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31696
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.Tooltip, { formatter: (value) => [`${value}`, "Count"] }),
31697
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
31698
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31496
31699
  import_recharts.Bar,
31497
31700
  {
31498
31701
  dataKey,
@@ -31500,13 +31703,13 @@ var ChartComponent = ({
31500
31703
  isAnimationActive: false
31501
31704
  }
31502
31705
  )
31503
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.AreaChart, { data, children: [
31504
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
31505
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
31506
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
31706
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_recharts.AreaChart, { data, children: [
31707
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
31708
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
31709
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
31507
31710
  ] }) }),
31508
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
31509
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31711
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
31712
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31510
31713
  import_recharts.XAxis,
31511
31714
  {
31512
31715
  dataKey: dataLabel,
@@ -31520,7 +31723,7 @@ var ChartComponent = ({
31520
31723
  }
31521
31724
  }
31522
31725
  ),
31523
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31726
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31524
31727
  import_recharts.YAxis,
31525
31728
  {
31526
31729
  tickFormatter: (value) => `${(value / 1e3).toFixed(0)}k`,
@@ -31533,8 +31736,8 @@ var ChartComponent = ({
31533
31736
  width: 60
31534
31737
  }
31535
31738
  ),
31536
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
31537
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
31739
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
31740
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
31538
31741
  import_recharts.Area,
31539
31742
  {
31540
31743
  type: "monotone",
@@ -31548,13 +31751,13 @@ var ChartComponent = ({
31548
31751
  ] }) })
31549
31752
  ] });
31550
31753
  };
31551
- var BarChart_default = import_react33.default.memo(ChartComponent);
31754
+ var BarChart_default = import_react34.default.memo(ChartComponent);
31552
31755
 
31553
31756
  // src/components/Chart/PieChart.tsx
31554
- var import_react34 = __toESM(require("react"));
31757
+ var import_react35 = __toESM(require("react"));
31555
31758
  var import_axios3 = __toESM(require("axios"));
31556
31759
  var import_recharts2 = require("recharts");
31557
- var import_jsx_runtime65 = require("react/jsx-runtime");
31760
+ var import_jsx_runtime68 = require("react/jsx-runtime");
31558
31761
  var getRandomColor2 = () => {
31559
31762
  const palette = [
31560
31763
  "#2563eb",
@@ -31631,17 +31834,18 @@ var DonutChart = ({
31631
31834
  }) => {
31632
31835
  const showLegends = props.showLegends ?? true;
31633
31836
  const canvasMode = props.canvasMode;
31634
- const [rawData, setRawData] = (0, import_react34.useState)([]);
31635
- const [localLoading, setLocalLoading] = (0, import_react34.useState)(false);
31837
+ const [rawData, setRawData] = (0, import_react35.useState)([]);
31838
+ const [localLoading, setLocalLoading] = (0, import_react35.useState)(false);
31636
31839
  const effectiveData = apiUrl ? rawData : props.data || [];
31637
31840
  const effectiveLoading = apiUrl ? localLoading : externalLoading;
31638
- (0, import_react34.useEffect)(() => {
31841
+ (0, import_react35.useEffect)(() => {
31639
31842
  if (!apiUrl) return;
31640
31843
  let cancelled = false;
31641
31844
  const fetchData = async () => {
31642
31845
  try {
31643
31846
  setLocalLoading(true);
31644
- const res = await import_axios3.default.get(apiUrl, {
31847
+ const axiosClient = props.axiosInstance ?? import_axios3.default;
31848
+ const res = await axiosClient.get(apiUrl, {
31645
31849
  withCredentials: true
31646
31850
  });
31647
31851
  if (!cancelled) {
@@ -31670,7 +31874,7 @@ var DonutChart = ({
31670
31874
  cancelled = true;
31671
31875
  };
31672
31876
  }, [apiUrl]);
31673
- const data = (0, import_react34.useMemo)(() => {
31877
+ const data = (0, import_react35.useMemo)(() => {
31674
31878
  if (!Array.isArray(effectiveData) || effectiveData.length === 0) return [];
31675
31879
  return effectiveData.map((item) => ({
31676
31880
  ...item,
@@ -31679,11 +31883,11 @@ var DonutChart = ({
31679
31883
  [dataLabel]: item[dataLabel] ?? "Unknown"
31680
31884
  }));
31681
31885
  }, [effectiveData, dataKey, dataLabel]);
31682
- const total = (0, import_react34.useMemo)(
31886
+ const total = (0, import_react35.useMemo)(
31683
31887
  () => data.reduce((sum, d) => sum + (d[dataKey] ?? 0), 0),
31684
31888
  [data, dataKey]
31685
31889
  );
31686
- const formattedTotal = (0, import_react34.useMemo)(() => {
31890
+ const formattedTotal = (0, import_react35.useMemo)(() => {
31687
31891
  if (total >= 1e6) {
31688
31892
  return `${(total / 1e6).toFixed(1)}M`;
31689
31893
  }
@@ -31692,7 +31896,7 @@ var DonutChart = ({
31692
31896
  }
31693
31897
  return total.toString();
31694
31898
  }, [total]);
31695
- const chartData = (0, import_react34.useMemo)(() => {
31899
+ const chartData = (0, import_react35.useMemo)(() => {
31696
31900
  if (total === 0) return data;
31697
31901
  const sortedData = [...data].sort((a, b) => (b[dataKey] ?? 0) - (a[dataKey] ?? 0));
31698
31902
  const minAngle = 360 / Math.max(12, sortedData.length);
@@ -31715,39 +31919,39 @@ var DonutChart = ({
31715
31919
  if (chartData.length <= 6) return { inner: 85, outer: 150 };
31716
31920
  return { inner: 70, outer: 130 };
31717
31921
  };
31718
- const [mounted, setMounted] = (0, import_react34.useState)(false);
31719
- (0, import_react34.useEffect)(() => {
31922
+ const [mounted, setMounted] = (0, import_react35.useState)(false);
31923
+ (0, import_react35.useEffect)(() => {
31720
31924
  const timeout = setTimeout(() => setMounted(true), 100);
31721
31925
  return () => clearTimeout(timeout);
31722
31926
  }, []);
31723
- const renderLegends = (0, import_react34.useMemo)(() => {
31927
+ const renderLegends = (0, import_react35.useMemo)(() => {
31724
31928
  if (!showLegends) return null;
31725
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
31929
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-4 w-full max-w-4xl", children: chartData.map((d, index) => {
31726
31930
  const actualValue = data.find(
31727
31931
  (item) => item[dataLabel] === d[dataLabel]
31728
31932
  )?.[dataKey] ?? d[dataKey];
31729
31933
  const displayValue = actualValue >= 1e3 ? `${(actualValue / 1e3).toFixed(0)}k` : actualValue.toLocaleString();
31730
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
31934
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
31731
31935
  "div",
31732
31936
  {
31733
31937
  className: "flex items-center space-x-2 rounded-lg border border-gray-200/50 px-3 py-1.5 w-[48%] sm:w-[32%] md:w-auto bg-white/80 backdrop-blur-sm shadow-sm hover:shadow-md transition-all",
31734
31938
  children: [
31735
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
31939
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
31736
31940
  "span",
31737
31941
  {
31738
31942
  className: "inline-block w-[12px] h-[12px] rounded-full shrink-0 border-2 border-white/50",
31739
31943
  style: { backgroundColor: d.color }
31740
31944
  }
31741
31945
  ),
31742
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "min-w-0 flex-1", children: [
31743
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
31744
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
31745
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: displayValue }),
31746
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { children: [
31946
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "min-w-0 flex-1", children: [
31947
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-gray-900 text-[11px] md:text-[13px] font-semibold block truncate leading-tight", children: d[dataLabel] }),
31948
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center gap-1 text-xs text-gray-600 font-medium", children: [
31949
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: displayValue }),
31950
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { children: [
31747
31951
  (actualValue / total * 100).toFixed(1),
31748
31952
  "%"
31749
31953
  ] }),
31750
- d.isBoosted && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
31954
+ d.isBoosted && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-[9px] px-1 py-0.5 bg-blue-100 text-blue-700 rounded-full", children: "min" })
31751
31955
  ] })
31752
31956
  ] })
31753
31957
  ]
@@ -31758,26 +31962,26 @@ var DonutChart = ({
31758
31962
  }, [chartData, data, dataLabel, dataKey, total, showLegends]);
31759
31963
  if (!mounted) return null;
31760
31964
  if (effectiveLoading || data.length === 0) {
31761
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
31965
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
31762
31966
  "div",
31763
31967
  {
31764
31968
  className: `relative flex flex-col items-center w-full h-[300px] md:h-[400px] bg-gradient-to-br from-gray-50 to-gray-100 rounded-xl p-6 ${className}`,
31765
31969
  style,
31766
31970
  children: [
31767
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
31768
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mt-6 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "inline-flex items-center space-x-2 bg-white/80 px-6 py-2 rounded-full backdrop-blur-sm border border-gray-200 shadow-lg", children: [
31769
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
31770
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm font-medium text-gray-600 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
31971
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/60 to-transparent animate-shimmer rounded-xl" }),
31972
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "mt-6 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "inline-flex items-center space-x-2 bg-white/80 px-6 py-2 rounded-full backdrop-blur-sm border border-gray-200 shadow-lg", children: [
31973
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-5 h-5 border-2 border-gray-300 border-t-blue-400 rounded-full animate-spin" }),
31974
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm font-medium text-gray-600 bg-gradient-to-r from-gray-300 bg-clip-text animate-pulse", children: "Loading chart data..." })
31771
31975
  ] }) }),
31772
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
31976
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex flex-wrap justify-center gap-3 mt-8 w-full max-w-4xl", children: [...Array(18)].map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
31773
31977
  "div",
31774
31978
  {
31775
31979
  className: `h-10 w-[48%] sm:w-[32%] md:w-32 rounded-xl bg-gradient-to-r from-gray-200 via-gray-300/50 to-gray-200 p-3 flex items-center space-x-3 animate-slide-up stagger-${idx} shadow-sm border border-gray-200/50`,
31776
31980
  children: [
31777
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
31778
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-1 space-y-1", children: [
31779
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
31780
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
31981
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-4 h-4 rounded-full bg-gradient-to-r from-blue-300 to-purple-300 animate-pulse" }),
31982
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex-1 space-y-1", children: [
31983
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "h-3 w-20 bg-gray-300 rounded animate-pulse" }),
31984
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "h-2.5 w-16 bg-gray-200/60 rounded animate-pulse-delayed" })
31781
31985
  ] })
31782
31986
  ]
31783
31987
  },
@@ -31790,10 +31994,10 @@ var DonutChart = ({
31790
31994
  const { inner, outer } = getDynamicRadius();
31791
31995
  const innerRadius = inner;
31792
31996
  const outerRadius = outer;
31793
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
31794
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
31795
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts2.PieChart, { children: [
31796
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
31997
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: `relative flex flex-col items-center ${className}`, style, children: [
31998
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative w-full md:w-[75%] h-[280px] md:h-[380px] flex items-center justify-center mb-2", children: [
31999
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_recharts2.PieChart, { children: [
32000
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
31797
32001
  import_recharts2.Pie,
31798
32002
  {
31799
32003
  data: chartData,
@@ -31806,7 +32010,7 @@ var DonutChart = ({
31806
32010
  isAnimationActive: true,
31807
32011
  animationDuration: 800,
31808
32012
  minAngle: 3,
31809
- children: chartData.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
32013
+ children: chartData.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
31810
32014
  import_recharts2.Cell,
31811
32015
  {
31812
32016
  fill: entry.color,
@@ -31817,7 +32021,7 @@ var DonutChart = ({
31817
32021
  ))
31818
32022
  }
31819
32023
  ),
31820
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
32024
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
31821
32025
  import_recharts2.Tooltip,
31822
32026
  {
31823
32027
  formatter: (value, name, payload) => {
@@ -31840,21 +32044,21 @@ var DonutChart = ({
31840
32044
  }
31841
32045
  )
31842
32046
  ] }) }),
31843
- total > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none ${forceMobile ? "text-xl px-2" : "text-3xl px-4"} font-bold bg-white/90 backdrop-blur-sm rounded-full py-1 shadow-lg`, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "text-[#1f2937] leading-tight", children: [
32047
+ total > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none ${forceMobile ? "text-xl px-2" : "text-3xl px-4"} font-bold bg-white/90 backdrop-blur-sm rounded-full py-1 shadow-lg`, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "text-[#1f2937] leading-tight", children: [
31844
32048
  formattedTotal,
31845
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
32049
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm md:text-base font-normal text-gray-600 block md:inline-block md:ml-1", children: "total" })
31846
32050
  ] }) })
31847
32051
  ] }),
31848
32052
  renderLegends
31849
32053
  ] });
31850
32054
  };
31851
- var PieChart_default = import_react34.default.memo(DonutChart);
32055
+ var PieChart_default = import_react35.default.memo(DonutChart);
31852
32056
 
31853
32057
  // src/components/Blocks/EmailComposer.tsx
31854
- var import_jsx_runtime66 = require("react/jsx-runtime");
32058
+ var import_jsx_runtime69 = require("react/jsx-runtime");
31855
32059
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
31856
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
31857
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32060
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
32061
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31858
32062
  "input",
31859
32063
  {
31860
32064
  type: "email",
@@ -31863,8 +32067,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31863
32067
  required: true
31864
32068
  }
31865
32069
  ) }),
31866
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-2", children: [
31867
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32070
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2", children: [
32071
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31868
32072
  "input",
31869
32073
  {
31870
32074
  type: "email",
@@ -31875,7 +32079,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31875
32079
  required: true
31876
32080
  }
31877
32081
  ),
31878
- !showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32082
+ !showCc && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31879
32083
  "button",
31880
32084
  {
31881
32085
  onClick: () => setShowCc?.(true),
@@ -31883,7 +32087,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31883
32087
  children: "Cc"
31884
32088
  }
31885
32089
  ),
31886
- !showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32090
+ !showBcc && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31887
32091
  "button",
31888
32092
  {
31889
32093
  onClick: () => setShowBcc?.(true),
@@ -31892,7 +32096,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31892
32096
  }
31893
32097
  )
31894
32098
  ] }) }),
31895
- showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32099
+ showCc && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31896
32100
  "input",
31897
32101
  {
31898
32102
  type: "text",
@@ -31902,7 +32106,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31902
32106
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
31903
32107
  }
31904
32108
  ) }),
31905
- showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32109
+ showBcc && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31906
32110
  "input",
31907
32111
  {
31908
32112
  type: "text",
@@ -31912,7 +32116,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31912
32116
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
31913
32117
  }
31914
32118
  ) }),
31915
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
32119
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
31916
32120
  "input",
31917
32121
  {
31918
32122
  type: "text",
@@ -31922,11 +32126,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31922
32126
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
31923
32127
  }
31924
32128
  ) }),
31925
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MyEditor, { value: body, onChange: setBody }) }),
31926
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex justify-end gap-2", children: [
31927
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
31928
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
31929
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
32129
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MyEditor, { value: body, onChange: setBody }) }),
32130
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex justify-end gap-2", children: [
32131
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
32132
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
32133
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
31930
32134
  ] })
31931
32135
  ] }) });
31932
32136
  }
@@ -31934,10 +32138,10 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
31934
32138
  // src/components/ui/sonner.tsx
31935
32139
  var import_next_themes = require("next-themes");
31936
32140
  var import_sonner2 = require("sonner");
31937
- var import_jsx_runtime67 = require("react/jsx-runtime");
32141
+ var import_jsx_runtime70 = require("react/jsx-runtime");
31938
32142
  var Toaster = ({ ...props }) => {
31939
32143
  const { theme = "system" } = (0, import_next_themes.useTheme)();
31940
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
32144
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
31941
32145
  import_sonner2.Toaster,
31942
32146
  {
31943
32147
  theme,
@@ -31969,6 +32173,7 @@ var Toaster = ({ ...props }) => {
31969
32173
  FileInput,
31970
32174
  FlexLayout,
31971
32175
  GridLayout,
32176
+ HistoryTimeline,
31972
32177
  Icon,
31973
32178
  Image,
31974
32179
  Modal,