@algorithm-shift/design-system 1.2.954 → 1.2.956

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.mjs CHANGED
@@ -27649,7 +27649,7 @@ function SelectScrollDownButton({
27649
27649
  }
27650
27650
 
27651
27651
  // src/components/Inputs/Dropdown/LazyDropdown.tsx
27652
- import { useState as useState5, useRef as useRef3, useEffect as useEffect14 } from "react";
27652
+ import { useState as useState5, useRef as useRef3, useEffect as useEffect14, useMemo as useMemo3 } from "react";
27653
27653
 
27654
27654
  // src/hooks/useLazyDropdown.ts
27655
27655
  import { useState as useState4, useEffect as useEffect13, useRef as useRef2, useCallback as useCallback2 } from "react";
@@ -27664,6 +27664,14 @@ function useLazyDropdown(config) {
27664
27664
  const allDataRef = useRef2([]);
27665
27665
  const configRef = useRef2(config);
27666
27666
  const PAGE_SIZE = config.pageSize || 10;
27667
+ const uniqueOptions = (items) => {
27668
+ const seen = /* @__PURE__ */ new Set();
27669
+ return items.filter((item) => {
27670
+ if (seen.has(item.value)) return false;
27671
+ seen.add(item.value);
27672
+ return true;
27673
+ });
27674
+ };
27667
27675
  useEffect13(() => {
27668
27676
  configRef.current = config;
27669
27677
  }, [config]);
@@ -27716,7 +27724,10 @@ function useLazyDropdown(config) {
27716
27724
  pageOptions = transformToOptions(filtered.slice(start, end));
27717
27725
  setHasMore(end < filtered.length);
27718
27726
  }
27719
- setOptions((prev) => pageNum === 1 ? pageOptions : [...prev, ...pageOptions]);
27727
+ setOptions((prev) => {
27728
+ const merged = pageNum === 1 ? pageOptions : [...prev, ...pageOptions];
27729
+ return uniqueOptions(merged);
27730
+ });
27720
27731
  setPage(pageNum);
27721
27732
  } catch (err) {
27722
27733
  console.error("\u274C useLazyDropdown loadPage error:", err);
@@ -27736,7 +27747,7 @@ function useLazyDropdown(config) {
27736
27747
  });
27737
27748
  if (res.data?.success && Array.isArray(res.data.data) && res.data.data.length > 0) {
27738
27749
  const fetched = transformToOptions(res.data.data);
27739
- setOptions((prev) => [...fetched, ...prev]);
27750
+ setOptions((prev) => uniqueOptions([...fetched, ...prev]));
27740
27751
  }
27741
27752
  } catch (err) {
27742
27753
  console.warn("\u26A0\uFE0F Failed to fetch default value for dropdown:", err);
@@ -27831,7 +27842,7 @@ function LazySelectDropdown({
27831
27842
  value,
27832
27843
  axiosInstance
27833
27844
  });
27834
- const selectedOption = lazyOptions.find((opt) => opt.value === value);
27845
+ const selectedOption = useMemo3(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
27835
27846
  useEffect14(() => {
27836
27847
  const handleClickOutside = (e) => {
27837
27848
  if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
@@ -27866,7 +27877,16 @@ function LazySelectDropdown({
27866
27877
  };
27867
27878
  const handleFocus = () => {
27868
27879
  if (!disabled) setIsOpen(true);
27869
- loadPage(1, "");
27880
+ if (lazyOptions.length === 0)
27881
+ loadPage(1, "");
27882
+ };
27883
+ const handleRemoveSelection = (e) => {
27884
+ e.preventDefault();
27885
+ e.stopPropagation();
27886
+ onChange?.("", id || "");
27887
+ setSearchTerm("");
27888
+ reset();
27889
+ search("");
27870
27890
  };
27871
27891
  return /* @__PURE__ */ jsxs18("div", { ref: dropdownRef, className: "relative w-full", children: [
27872
27892
  /* @__PURE__ */ jsx36(
@@ -27876,7 +27896,7 @@ function LazySelectDropdown({
27876
27896
  id,
27877
27897
  name: id,
27878
27898
  className: cn(
27879
- "w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
27899
+ "w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 pr-7",
27880
27900
  disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
27881
27901
  className,
27882
27902
  errorMessage ? "border-red-500" : ""
@@ -27889,6 +27909,16 @@ function LazySelectDropdown({
27889
27909
  disabled
27890
27910
  }
27891
27911
  ),
27912
+ selectedOption && !disabled && !readOnly && /* @__PURE__ */ jsx36(
27913
+ "button",
27914
+ {
27915
+ type: "button",
27916
+ "aria-label": "Clear selection",
27917
+ onClick: handleRemoveSelection,
27918
+ className: "absolute right-2 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded hover:bg-gray-200 text-gray-500 focus:outline-none",
27919
+ children: /* @__PURE__ */ jsx36(SquareX, { className: "h-5 w-5 pointer-events-none" })
27920
+ }
27921
+ ),
27892
27922
  errorMessage && /* @__PURE__ */ jsx36("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
27893
27923
  isOpen && !disabled && /* @__PURE__ */ jsx36(Portal_default, { children: /* @__PURE__ */ jsx36(
27894
27924
  "div",
@@ -28611,330 +28641,217 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28611
28641
  var TextInputGroup_default = TextInputGroup;
28612
28642
 
28613
28643
  // src/components/Inputs/Multiselect/MultiSelect.tsx
28614
- import * as React8 from "react";
28615
-
28616
- // src/components/ui/command.tsx
28617
- import { Command as CommandPrimitive } from "cmdk";
28618
-
28619
- // src/components/ui/dialog.tsx
28620
- import * as DialogPrimitive from "@radix-ui/react-dialog";
28621
- import { jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
28622
- function Dialog({
28623
- ...props
28624
- }) {
28625
- return /* @__PURE__ */ jsx48(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28626
- }
28627
- function DialogPortal({
28628
- ...props
28629
- }) {
28630
- return /* @__PURE__ */ jsx48(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28631
- }
28632
- function DialogOverlay({
28644
+ import { useState as useState6, useRef as useRef5, useEffect as useEffect24, useMemo as useMemo4 } from "react";
28645
+ import { Fragment as Fragment19, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
28646
+ function LazyMultiSelectDropdown({
28647
+ options = [],
28648
+ value = [],
28649
+ onChange,
28650
+ placeholder,
28633
28651
  className,
28634
- ...props
28652
+ id,
28653
+ disabled,
28654
+ readOnly,
28655
+ source,
28656
+ apiUrl,
28657
+ pageSize,
28658
+ dataKey = "id",
28659
+ dataLabel = "name",
28660
+ errorMessage,
28661
+ axiosInstance,
28662
+ outputFormat = "array"
28635
28663
  }) {
28636
- return /* @__PURE__ */ jsx48(
28637
- DialogPrimitive.Overlay,
28638
- {
28639
- "data-slot": "dialog-overlay",
28640
- className: cn(
28641
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
28642
- className
28643
- ),
28644
- ...props
28664
+ const [isOpen, setIsOpen] = useState6(false);
28665
+ const [searchTerm, setSearchTerm] = useState6("");
28666
+ const dropdownRef = useRef5(null);
28667
+ const observerTarget = useRef5(null);
28668
+ const {
28669
+ options: lazyOptions,
28670
+ loading,
28671
+ hasMore,
28672
+ loadMore,
28673
+ search,
28674
+ reset,
28675
+ loadPage
28676
+ } = useLazyDropdown({
28677
+ enabled: true,
28678
+ dataSource: source || "",
28679
+ apiUrl,
28680
+ pageSize: pageSize || 10,
28681
+ dataKey,
28682
+ dataLabel,
28683
+ initialData: options || [],
28684
+ value,
28685
+ axiosInstance
28686
+ });
28687
+ const ensureUnique = (arr) => {
28688
+ return Array.from(new Set(arr));
28689
+ };
28690
+ const convertOutput = (values) => {
28691
+ const unique = ensureUnique(values);
28692
+ switch (outputFormat) {
28693
+ case "comma":
28694
+ return unique.join(",");
28695
+ case "semicolon":
28696
+ return unique.join(";");
28697
+ default:
28698
+ return unique;
28645
28699
  }
28646
- );
28647
- }
28648
- function DialogContent({
28649
- className,
28650
- children,
28651
- showCloseButton = true,
28652
- ...props
28653
- }) {
28654
- return /* @__PURE__ */ jsxs27(DialogPortal, { "data-slot": "dialog-portal", children: [
28655
- /* @__PURE__ */ jsx48(DialogOverlay, {}),
28700
+ };
28701
+ const normalizeInput = (value2) => {
28702
+ let arr = [];
28703
+ if (Array.isArray(value2)) {
28704
+ arr = value2;
28705
+ } else if (typeof value2 === "string") {
28706
+ if (!value2.trim()) return [];
28707
+ if (value2.includes(";")) arr = value2.split(";").map((v) => v.trim());
28708
+ else if (value2.includes(",")) arr = value2.split(",").map((v) => v.trim());
28709
+ else arr = [value2.trim()];
28710
+ }
28711
+ return ensureUnique(arr);
28712
+ };
28713
+ const normalizedValue = normalizeInput(value);
28714
+ const selectedOptions = useMemo4(() => {
28715
+ return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
28716
+ }, [lazyOptions, normalizedValue]);
28717
+ useEffect24(() => {
28718
+ const handleClick = (e) => {
28719
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
28720
+ setIsOpen(false);
28721
+ }
28722
+ };
28723
+ document.addEventListener("mousedown", handleClick);
28724
+ return () => document.removeEventListener("mousedown", handleClick);
28725
+ }, []);
28726
+ useEffect24(() => {
28727
+ if (!isOpen || !hasMore || loading) return;
28728
+ const obs = new IntersectionObserver(
28729
+ (entries) => {
28730
+ if (entries[0].isIntersecting) loadMore();
28731
+ },
28732
+ { threshold: 0.1 }
28733
+ );
28734
+ if (observerTarget.current) obs.observe(observerTarget.current);
28735
+ return () => obs.disconnect();
28736
+ }, [isOpen, hasMore, loading, loadMore]);
28737
+ const handleSearch = (e) => {
28738
+ const term = e.target.value;
28739
+ setSearchTerm(term);
28740
+ search(term);
28741
+ };
28742
+ const toggleSelect = (val) => {
28743
+ let updated;
28744
+ if (normalizedValue.includes(val)) {
28745
+ updated = normalizedValue.filter((v) => v !== val);
28746
+ } else {
28747
+ updated = ensureUnique([...normalizedValue, val]);
28748
+ }
28749
+ onChange(convertOutput(updated), id);
28750
+ };
28751
+ const removeTag = (val) => {
28752
+ const updated = normalizedValue.filter((v) => v !== val);
28753
+ onChange(convertOutput(updated), id);
28754
+ };
28755
+ const handleFocus = () => {
28756
+ if (!disabled) setIsOpen(true);
28757
+ if (lazyOptions.length === 0) loadPage(1, "");
28758
+ };
28759
+ return /* @__PURE__ */ jsxs27("div", { ref: dropdownRef, className: "relative w-full", children: [
28656
28760
  /* @__PURE__ */ jsxs27(
28657
- DialogPrimitive.Content,
28761
+ "div",
28658
28762
  {
28659
- "data-slot": "dialog-content",
28763
+ onClick: handleFocus,
28660
28764
  className: cn(
28661
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
28765
+ "min-h-10 w-full flex items-center flex-wrap gap-1 px-2 py-1 border border-[#BDBDBD] rounded-md bg-white cursor-pointer",
28766
+ disabled && "bg-gray-100 cursor-not-allowed",
28767
+ errorMessage && "border-red-500",
28662
28768
  className
28663
28769
  ),
28664
- ...props,
28665
28770
  children: [
28666
- children,
28667
- showCloseButton && /* @__PURE__ */ jsxs27(
28668
- DialogPrimitive.Close,
28771
+ selectedOptions.map((opt) => /* @__PURE__ */ jsxs27(
28772
+ "span",
28669
28773
  {
28670
- "data-slot": "dialog-close",
28671
- 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",
28774
+ className: "bg-blue-100 text-blue-700 px-2 py-1 rounded-md text-xs flex items-center gap-1",
28672
28775
  children: [
28673
- /* @__PURE__ */ jsx48(X, {}),
28674
- /* @__PURE__ */ jsx48("span", { className: "sr-only", children: "Close" })
28776
+ opt.label,
28777
+ !disabled && !readOnly && /* @__PURE__ */ jsx48(
28778
+ "button",
28779
+ {
28780
+ type: "button",
28781
+ onClick: (e) => {
28782
+ e.stopPropagation();
28783
+ removeTag(opt.value);
28784
+ },
28785
+ className: "hover:text-red-600",
28786
+ children: /* @__PURE__ */ jsx48(X, { size: 12 })
28787
+ }
28788
+ )
28675
28789
  ]
28790
+ },
28791
+ opt.value
28792
+ )),
28793
+ /* @__PURE__ */ jsx48(
28794
+ "input",
28795
+ {
28796
+ type: "text",
28797
+ placeholder: selectedOptions.length ? "" : placeholder,
28798
+ className: "flex-1 min-w-[60px] p-1 outline-none",
28799
+ value: isOpen ? searchTerm : "",
28800
+ onChange: handleSearch,
28801
+ readOnly,
28802
+ disabled
28676
28803
  }
28677
28804
  )
28678
28805
  ]
28679
28806
  }
28680
- )
28681
- ] });
28682
- }
28683
- function DialogHeader({ className, ...props }) {
28684
- return /* @__PURE__ */ jsx48(
28685
- "div",
28686
- {
28687
- "data-slot": "dialog-header",
28688
- className: cn("flex flex-col gap-2 text-center sm:text-left", className),
28689
- ...props
28690
- }
28691
- );
28692
- }
28693
- function DialogFooter({ className, ...props }) {
28694
- return /* @__PURE__ */ jsx48(
28695
- "div",
28696
- {
28697
- "data-slot": "dialog-footer",
28698
- className: cn(
28699
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
28700
- className
28701
- ),
28702
- ...props
28703
- }
28704
- );
28705
- }
28706
- function DialogTitle({
28707
- className,
28708
- ...props
28709
- }) {
28710
- return /* @__PURE__ */ jsx48(
28711
- DialogPrimitive.Title,
28712
- {
28713
- "data-slot": "dialog-title",
28714
- className: cn("text-lg leading-none font-semibold", className),
28715
- ...props
28716
- }
28717
- );
28718
- }
28719
- function DialogDescription({
28720
- className,
28721
- ...props
28722
- }) {
28723
- return /* @__PURE__ */ jsx48(
28724
- DialogPrimitive.Description,
28725
- {
28726
- "data-slot": "dialog-description",
28727
- className: cn("text-muted-foreground text-sm", className),
28728
- ...props
28729
- }
28730
- );
28731
- }
28732
-
28733
- // src/components/ui/command.tsx
28734
- import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
28735
- function Command2({
28736
- className,
28737
- ...props
28738
- }) {
28739
- return /* @__PURE__ */ jsx49(
28740
- CommandPrimitive,
28741
- {
28742
- "data-slot": "command",
28743
- className: cn(
28744
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
28745
- className
28746
- ),
28747
- ...props
28748
- }
28749
- );
28750
- }
28751
- function CommandInput({
28752
- className,
28753
- ...props
28754
- }) {
28755
- return /* @__PURE__ */ jsxs28(
28756
- "div",
28757
- {
28758
- "data-slot": "command-input-wrapper",
28759
- className: "flex h-9 items-center gap-2 border-b px-3",
28760
- children: [
28761
- /* @__PURE__ */ jsx49(Search, { className: "size-4 shrink-0 opacity-50" }),
28762
- /* @__PURE__ */ jsx49(
28763
- CommandPrimitive.Input,
28764
- {
28765
- "data-slot": "command-input",
28766
- className: cn(
28767
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
28768
- className
28769
- ),
28770
- ...props
28771
- }
28772
- )
28773
- ]
28774
- }
28775
- );
28776
- }
28777
- function CommandList({
28778
- className,
28779
- ...props
28780
- }) {
28781
- return /* @__PURE__ */ jsx49(
28782
- CommandPrimitive.List,
28783
- {
28784
- "data-slot": "command-list",
28785
- className: cn(
28786
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
28787
- className
28788
- ),
28789
- ...props
28790
- }
28791
- );
28792
- }
28793
- function CommandEmpty({
28794
- ...props
28795
- }) {
28796
- return /* @__PURE__ */ jsx49(
28797
- CommandPrimitive.Empty,
28798
- {
28799
- "data-slot": "command-empty",
28800
- className: "py-6 text-center text-sm",
28801
- ...props
28802
- }
28803
- );
28804
- }
28805
- function CommandGroup({
28806
- className,
28807
- ...props
28808
- }) {
28809
- return /* @__PURE__ */ jsx49(
28810
- CommandPrimitive.Group,
28811
- {
28812
- "data-slot": "command-group",
28813
- className: cn(
28814
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
28815
- className
28816
- ),
28817
- ...props
28818
- }
28819
- );
28820
- }
28821
- function CommandItem({
28822
- className,
28823
- ...props
28824
- }) {
28825
- return /* @__PURE__ */ jsx49(
28826
- CommandPrimitive.Item,
28827
- {
28828
- "data-slot": "command-item",
28829
- className: cn(
28830
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28831
- className
28832
- ),
28833
- ...props
28834
- }
28835
- );
28836
- }
28837
-
28838
- // src/components/Inputs/Multiselect/MultiSelect.tsx
28839
- import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
28840
- var MultiSelect = ({
28841
- value = [],
28842
- onChange,
28843
- data = [],
28844
- placeholder = "Select...",
28845
- disabled,
28846
- searchable = true,
28847
- className = "",
28848
- dataKey = "value",
28849
- dataLabel = "label",
28850
- ...props
28851
- }) => {
28852
- const [open, setOpen] = React8.useState(false);
28853
- React8.useEffect(() => {
28854
- if (value) {
28855
- onChange(value, props?.name || "");
28856
- }
28857
- }, []);
28858
- const toggleOption = (val) => {
28859
- onChange(
28860
- value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val],
28861
- props?.name || ""
28862
- );
28863
- };
28864
- const selectedLabels = React8.useMemo(
28865
- () => {
28866
- if (!data || !value) return [];
28867
- return data?.filter((opt) => value?.includes(opt.value)).map((opt) => opt.label);
28868
- },
28869
- [data, value]
28870
- );
28871
- const options = data && data?.map((item) => ({
28872
- value: item[dataKey],
28873
- label: item[dataLabel]
28874
- }));
28875
- return /* @__PURE__ */ jsxs29(Popover, { open, onOpenChange: setOpen, children: [
28876
- /* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs29(
28877
- Button,
28878
- {
28879
- variant: "outline",
28880
- role: "combobox",
28881
- className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
28882
- disabled,
28883
- type: "button",
28884
- children: [
28885
- /* @__PURE__ */ jsx50("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
28886
- /* @__PURE__ */ jsx50(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
28887
- ]
28888
- }
28889
- ) }),
28890
- /* @__PURE__ */ jsx50(
28891
- PopoverContent,
28807
+ ),
28808
+ errorMessage && /* @__PURE__ */ jsx48("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
28809
+ isOpen && !disabled && /* @__PURE__ */ jsx48(Portal_default, { children: /* @__PURE__ */ jsx48(
28810
+ "div",
28892
28811
  {
28893
- align: "start",
28894
- className: "w-[var(--radix-popover-trigger-width)] p-0",
28895
- onOpenAutoFocus: (e) => e.preventDefault(),
28896
- onInteractOutside: (e) => {
28897
- if (e.target.closest(".keep-open")) e.preventDefault();
28812
+ onMouseDown: (e) => e.stopPropagation(),
28813
+ className: "absolute z-[999] mt-1 bg-white border rounded-lg shadow-lg max-h-60 overflow-y-auto",
28814
+ style: {
28815
+ zIndex: 900,
28816
+ width: dropdownRef.current?.offsetWidth,
28817
+ top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
28818
+ left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
28898
28819
  },
28899
- children: /* @__PURE__ */ jsxs29(Command2, { shouldFilter: searchable, children: [
28900
- searchable && /* @__PURE__ */ jsx50(CommandInput, { placeholder: "Search..." }),
28901
- /* @__PURE__ */ jsxs29(CommandList, { children: [
28902
- /* @__PURE__ */ jsx50(CommandEmpty, { children: "No options found." }),
28903
- /* @__PURE__ */ jsx50(CommandGroup, { children: options.map((opt) => {
28904
- const isSelected = (value ?? [])?.includes(opt.value);
28905
- return /* @__PURE__ */ jsx50(
28906
- "div",
28907
- {
28908
- className: "keep-open",
28909
- children: /* @__PURE__ */ jsx50(
28910
- CommandItem,
28911
- {
28912
- onMouseDown: (e) => {
28913
- e.preventDefault();
28914
- toggleOption(opt.value);
28915
- },
28916
- children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
28917
- /* @__PURE__ */ jsx50(Checkbox, { checked: isSelected }),
28918
- /* @__PURE__ */ jsx50("span", { children: opt.label })
28919
- ] })
28920
- },
28921
- opt.value
28922
- )
28923
- },
28924
- opt.value
28925
- );
28926
- }) })
28927
- ] })
28928
- ] })
28820
+ children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ jsx48("div", { className: "px-3 py-4 text-center text-gray-500", children: "Loading..." }) : lazyOptions.length > 0 ? /* @__PURE__ */ jsxs27(Fragment19, { children: [
28821
+ lazyOptions.map((option) => {
28822
+ const isSelected = normalizedValue.includes(option.value);
28823
+ return /* @__PURE__ */ jsxs27(
28824
+ "div",
28825
+ {
28826
+ onClick: () => toggleSelect(option.value),
28827
+ className: cn(
28828
+ "px-3 py-2 text-sm cursor-pointer hover:bg-blue-50 flex justify-between",
28829
+ isSelected && "bg-blue-100"
28830
+ ),
28831
+ children: [
28832
+ option.label,
28833
+ isSelected && /* @__PURE__ */ jsx48(SquareX, { size: 16 })
28834
+ ]
28835
+ },
28836
+ option.value
28837
+ );
28838
+ }),
28839
+ hasMore && /* @__PURE__ */ jsx48(
28840
+ "div",
28841
+ {
28842
+ ref: observerTarget,
28843
+ className: "px-3 py-3 text-center text-gray-400 text-sm",
28844
+ children: loading ? "Loading\u2026" : "Scroll for more\u2026"
28845
+ }
28846
+ )
28847
+ ] }) : /* @__PURE__ */ jsx48("div", { className: "px-3 py-4 text-center text-gray-500", children: "No results" })
28929
28848
  }
28930
- ),
28931
- props.errorMessage && /* @__PURE__ */ jsx50("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28849
+ ) })
28932
28850
  ] });
28933
- };
28934
- var MultiSelect_default = MultiSelect;
28851
+ }
28935
28852
 
28936
28853
  // src/components/ui/data-table.tsx
28937
- import * as React10 from "react";
28854
+ import * as React9 from "react";
28938
28855
  import { faEllipsisH } from "@fortawesome/free-solid-svg-icons";
28939
28856
  import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
28940
28857
  import {
@@ -28946,14 +28863,14 @@ import {
28946
28863
  } from "@tanstack/react-table";
28947
28864
 
28948
28865
  // src/components/ui/table.tsx
28949
- import { jsx as jsx51 } from "react/jsx-runtime";
28866
+ import { jsx as jsx49 } from "react/jsx-runtime";
28950
28867
  function Table3({ className, ...props }) {
28951
- return /* @__PURE__ */ jsx51(
28868
+ return /* @__PURE__ */ jsx49(
28952
28869
  "div",
28953
28870
  {
28954
28871
  "data-slot": "table-container",
28955
28872
  className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
28956
- children: /* @__PURE__ */ jsx51(
28873
+ children: /* @__PURE__ */ jsx49(
28957
28874
  "table",
28958
28875
  {
28959
28876
  "data-slot": "table",
@@ -28965,7 +28882,7 @@ function Table3({ className, ...props }) {
28965
28882
  );
28966
28883
  }
28967
28884
  function TableHeader({ className, ...props }) {
28968
- return /* @__PURE__ */ jsx51(
28885
+ return /* @__PURE__ */ jsx49(
28969
28886
  "thead",
28970
28887
  {
28971
28888
  "data-slot": "table-header",
@@ -28978,7 +28895,7 @@ function TableHeader({ className, ...props }) {
28978
28895
  );
28979
28896
  }
28980
28897
  function TableBody({ className, ...props }) {
28981
- return /* @__PURE__ */ jsx51(
28898
+ return /* @__PURE__ */ jsx49(
28982
28899
  "tbody",
28983
28900
  {
28984
28901
  "data-slot": "table-body",
@@ -28991,7 +28908,7 @@ function TableBody({ className, ...props }) {
28991
28908
  );
28992
28909
  }
28993
28910
  function TableRow({ className, ...props }) {
28994
- return /* @__PURE__ */ jsx51(
28911
+ return /* @__PURE__ */ jsx49(
28995
28912
  "tr",
28996
28913
  {
28997
28914
  "data-slot": "table-row",
@@ -29004,7 +28921,7 @@ function TableRow({ className, ...props }) {
29004
28921
  );
29005
28922
  }
29006
28923
  function TableHead({ className, ...props }) {
29007
- return /* @__PURE__ */ jsx51(
28924
+ return /* @__PURE__ */ jsx49(
29008
28925
  "th",
29009
28926
  {
29010
28927
  "data-slot": "table-head",
@@ -29017,7 +28934,7 @@ function TableHead({ className, ...props }) {
29017
28934
  );
29018
28935
  }
29019
28936
  function TableCell({ className, ...props }) {
29020
- return /* @__PURE__ */ jsx51(
28937
+ return /* @__PURE__ */ jsx49(
29021
28938
  "td",
29022
28939
  {
29023
28940
  "data-slot": "table-cell",
@@ -29034,7 +28951,7 @@ function TableCell({ className, ...props }) {
29034
28951
  import { createColumnHelper } from "@tanstack/react-table";
29035
28952
 
29036
28953
  // src/lib/table/cellRendererFactory.tsx
29037
- import React9 from "react";
28954
+ import React8 from "react";
29038
28955
  import Image2 from "next/image";
29039
28956
 
29040
28957
  // src/lib/dayjs-setup.ts
@@ -29083,7 +29000,7 @@ var valueFormatter = (value, format2, customFormatters = {}) => {
29083
29000
  };
29084
29001
 
29085
29002
  // src/lib/table/cellRendererFactory.tsx
29086
- import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
29003
+ import { Fragment as Fragment20, jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
29087
29004
  var getContrastColor = (bg) => {
29088
29005
  let c = bg.trim().toUpperCase();
29089
29006
  if (/^#([a-fA-F0-9]{3})$/.test(c)) {
@@ -29117,9 +29034,9 @@ var getContrastColor = (bg) => {
29117
29034
  };
29118
29035
  var sanitizeValue = (val) => {
29119
29036
  if (val == null) return null;
29120
- if (React9.isValidElement(val)) return val;
29037
+ if (React8.isValidElement(val)) return val;
29121
29038
  if (typeof val === "string" || typeof val === "number") return val;
29122
- if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ jsx52(React9.Fragment, { children: sanitizeValue(v) }, i));
29039
+ if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ jsx50(React8.Fragment, { children: sanitizeValue(v) }, i));
29123
29040
  if (typeof val === "object") {
29124
29041
  if ("name" in val && typeof val.name === "string") return val.name;
29125
29042
  if ("label" in val && typeof val.label === "string") return val.label;
@@ -29136,13 +29053,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29136
29053
  switch (renderer) {
29137
29054
  /* -------------------- BASIC -------------------- */
29138
29055
  case "text":
29139
- return /* @__PURE__ */ jsx52("span", { children: row?.[rendererProps?.rowField] || formattedValue });
29056
+ return /* @__PURE__ */ jsx50("span", { children: row?.[rendererProps?.rowField] || formattedValue });
29140
29057
  case "number":
29141
- return /* @__PURE__ */ jsx52("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
29058
+ return /* @__PURE__ */ jsx50("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
29142
29059
  case "date":
29143
- return /* @__PURE__ */ jsx52("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
29060
+ return /* @__PURE__ */ jsx50("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
29144
29061
  case "link":
29145
- return /* @__PURE__ */ jsx52(
29062
+ return /* @__PURE__ */ jsx50(
29146
29063
  "a",
29147
29064
  {
29148
29065
  href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
@@ -29154,7 +29071,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29154
29071
  );
29155
29072
  /* -------------------- VISUAL -------------------- */
29156
29073
  case "image":
29157
- return /* @__PURE__ */ jsx52("div", { className: "relative", children: /* @__PURE__ */ jsx52(
29074
+ return /* @__PURE__ */ jsx50("div", { className: "relative", children: /* @__PURE__ */ jsx50(
29158
29075
  Image2,
29159
29076
  {
29160
29077
  src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
@@ -29171,7 +29088,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29171
29088
  case "icon":
29172
29089
  const maybeIcon = lucide_react_exports[rendererProps?.icon];
29173
29090
  const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
29174
- return /* @__PURE__ */ jsx52(
29091
+ return /* @__PURE__ */ jsx50(
29175
29092
  IconComponent,
29176
29093
  {
29177
29094
  size: rendererProps?.size || 16,
@@ -29183,7 +29100,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29183
29100
  const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
29184
29101
  if (!formattedValue) return null;
29185
29102
  const textColor = getContrastColor(color);
29186
- return /* @__PURE__ */ jsx52(
29103
+ return /* @__PURE__ */ jsx50(
29187
29104
  "span",
29188
29105
  {
29189
29106
  className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
@@ -29198,13 +29115,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29198
29115
  const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
29199
29116
  if (!formattedValue) return null;
29200
29117
  const textColor = getContrastColor(color);
29201
- return /* @__PURE__ */ jsxs30(
29118
+ return /* @__PURE__ */ jsxs28(
29202
29119
  "span",
29203
29120
  {
29204
29121
  className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
29205
29122
  style: { backgroundColor: color, color: textColor },
29206
29123
  children: [
29207
- rendererProps?.icon && /* @__PURE__ */ jsx52(Fragment19, { children: IconComponent2 ? /* @__PURE__ */ jsx52(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx52(Box, { className: "h-4 w-4" }) }),
29124
+ rendererProps?.icon && /* @__PURE__ */ jsx50(Fragment20, { children: IconComponent2 ? /* @__PURE__ */ jsx50(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx50(Box, { className: "h-4 w-4" }) }),
29208
29125
  formattedValue
29209
29126
  ]
29210
29127
  }
@@ -29212,7 +29129,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29212
29129
  }
29213
29130
  /* -------------------- INTERACTIVE -------------------- */
29214
29131
  case "button":
29215
- return /* @__PURE__ */ jsx52(
29132
+ return /* @__PURE__ */ jsx50(
29216
29133
  "button",
29217
29134
  {
29218
29135
  onClick: () => rendererProps?.onClick?.(row, formattedValue),
@@ -29221,8 +29138,8 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29221
29138
  }
29222
29139
  );
29223
29140
  case "switch":
29224
- return /* @__PURE__ */ jsxs30("label", { className: "inline-flex items-center cursor-pointer", children: [
29225
- /* @__PURE__ */ jsx52(
29141
+ return /* @__PURE__ */ jsxs28("label", { className: "inline-flex items-center cursor-pointer", children: [
29142
+ /* @__PURE__ */ jsx50(
29226
29143
  "input",
29227
29144
  {
29228
29145
  type: "checkbox",
@@ -29231,10 +29148,10 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29231
29148
  className: "sr-only peer"
29232
29149
  }
29233
29150
  ),
29234
- /* @__PURE__ */ jsx52("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ jsx52("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
29151
+ /* @__PURE__ */ jsx50("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ jsx50("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
29235
29152
  ] });
29236
29153
  case "progress":
29237
- return /* @__PURE__ */ jsx52("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ jsx52(
29154
+ return /* @__PURE__ */ jsx50("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ jsx50(
29238
29155
  "div",
29239
29156
  {
29240
29157
  className: "bg-blue-600 h-2 rounded-full transition-all",
@@ -29243,7 +29160,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29243
29160
  ) });
29244
29161
  case "rating": {
29245
29162
  const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
29246
- return /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx52(
29163
+ return /* @__PURE__ */ jsx50("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx50(
29247
29164
  Star,
29248
29165
  {
29249
29166
  size: 16,
@@ -29257,7 +29174,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29257
29174
  case "custom": {
29258
29175
  const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
29259
29176
  if (CustomRenderer)
29260
- return /* @__PURE__ */ jsx52(
29177
+ return /* @__PURE__ */ jsx50(
29261
29178
  CustomRenderer,
29262
29179
  {
29263
29180
  value: formattedValue,
@@ -29265,11 +29182,11 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29265
29182
  ...rendererProps
29266
29183
  }
29267
29184
  );
29268
- return /* @__PURE__ */ jsx52("span", { children: "Missing custom renderer" });
29185
+ return /* @__PURE__ */ jsx50("span", { children: "Missing custom renderer" });
29269
29186
  }
29270
29187
  /* -------------------- DEFAULT -------------------- */
29271
29188
  default:
29272
- return /* @__PURE__ */ jsx52("span", { children: formattedValue });
29189
+ return /* @__PURE__ */ jsx50("span", { children: formattedValue });
29273
29190
  }
29274
29191
  };
29275
29192
 
@@ -29293,6 +29210,8 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
29293
29210
  return sanitizeValue(row[accessorKey]);
29294
29211
  };
29295
29212
  return columnHelper.accessor(accessorFn, {
29213
+ ...col,
29214
+ size: col.size > 0 ? col.size : 180,
29296
29215
  id: col.id ?? accessorKey,
29297
29216
  header: col.header,
29298
29217
  cell: (info) => {
@@ -29316,7 +29235,7 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
29316
29235
  };
29317
29236
 
29318
29237
  // src/components/ui/data-table.tsx
29319
- import { Fragment as Fragment20, jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
29238
+ import { Fragment as Fragment21, jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
29320
29239
  function DataTable({
29321
29240
  columns,
29322
29241
  data,
@@ -29335,10 +29254,10 @@ function DataTable({
29335
29254
  onDeleteRow,
29336
29255
  rowActions
29337
29256
  }) {
29338
- const [columnFilters, setColumnFilters] = React10.useState([]);
29339
- const [columnVisibility, setColumnVisibility] = React10.useState({});
29340
- const [manualSort, setManualSort] = React10.useState(null);
29341
- const [searchTerm, setSearchTerm] = React10.useState("");
29257
+ const [columnFilters, setColumnFilters] = React9.useState([]);
29258
+ const [columnVisibility, setColumnVisibility] = React9.useState({});
29259
+ const [manualSort, setManualSort] = React9.useState(null);
29260
+ const [searchTerm, setSearchTerm] = React9.useState("");
29342
29261
  const tableData = Array.isArray(data) ? data : [];
29343
29262
  const dynamicCols = useDynamicColumns({ columns });
29344
29263
  const table = useReactTable({
@@ -29389,11 +29308,11 @@ function DataTable({
29389
29308
  return [];
29390
29309
  };
29391
29310
  const pageCount = table.getPageCount() === 0 ? 1 : table.getPageCount();
29392
- return /* @__PURE__ */ jsxs31("div", { className: "overflow-hidden rounded-md w-full", children: [
29393
- /* @__PURE__ */ jsxs31("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
29394
- globalSearch && /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
29395
- /* @__PURE__ */ jsxs31("div", { className: "relative w-full", children: [
29396
- /* @__PURE__ */ jsx53(
29311
+ return /* @__PURE__ */ jsxs29("div", { className: "overflow-hidden rounded-md w-full", children: [
29312
+ /* @__PURE__ */ jsxs29("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
29313
+ globalSearch && /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
29314
+ /* @__PURE__ */ jsxs29("div", { className: "relative w-full", children: [
29315
+ /* @__PURE__ */ jsx51(
29397
29316
  "input",
29398
29317
  {
29399
29318
  type: "text",
@@ -29408,9 +29327,9 @@ function DataTable({
29408
29327
  className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
29409
29328
  }
29410
29329
  ),
29411
- /* @__PURE__ */ jsx53(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
29330
+ /* @__PURE__ */ jsx51(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
29412
29331
  ] }),
29413
- /* @__PURE__ */ jsx53(
29332
+ /* @__PURE__ */ jsx51(
29414
29333
  Button,
29415
29334
  {
29416
29335
  size: "sm",
@@ -29420,8 +29339,8 @@ function DataTable({
29420
29339
  }
29421
29340
  )
29422
29341
  ] }),
29423
- /* @__PURE__ */ jsxs31(Popover, { children: [
29424
- /* @__PURE__ */ jsx53(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
29342
+ /* @__PURE__ */ jsxs29(Popover, { children: [
29343
+ /* @__PURE__ */ jsx51(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx51(
29425
29344
  Button,
29426
29345
  {
29427
29346
  variant: "outline",
@@ -29430,10 +29349,10 @@ function DataTable({
29430
29349
  children: "Manage Columns"
29431
29350
  }
29432
29351
  ) }),
29433
- /* @__PURE__ */ jsxs31(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
29434
- /* @__PURE__ */ jsx53("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
29435
- /* @__PURE__ */ jsxs31("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
29436
- /* @__PURE__ */ jsx53(
29352
+ /* @__PURE__ */ jsxs29(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
29353
+ /* @__PURE__ */ jsx51("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
29354
+ /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
29355
+ /* @__PURE__ */ jsx51(
29437
29356
  "input",
29438
29357
  {
29439
29358
  type: "checkbox",
@@ -29452,8 +29371,8 @@ function DataTable({
29452
29371
  ),
29453
29372
  "Toggle All"
29454
29373
  ] }),
29455
- table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs31("label", { className: "flex items-center gap-2 text-sm", children: [
29456
- /* @__PURE__ */ jsx53(
29374
+ table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
29375
+ /* @__PURE__ */ jsx51(
29457
29376
  "input",
29458
29377
  {
29459
29378
  type: "checkbox",
@@ -29466,12 +29385,12 @@ function DataTable({
29466
29385
  ] })
29467
29386
  ] })
29468
29387
  ] }),
29469
- /* @__PURE__ */ jsxs31(Table3, { className: "table-fixed", children: [
29470
- /* @__PURE__ */ jsx53(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx53(TableRow, { children: hg.headers.map((header, index) => {
29388
+ /* @__PURE__ */ jsxs29(Table3, { className: "table-fixed", children: [
29389
+ /* @__PURE__ */ jsx51(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx51(TableRow, { children: hg.headers.map((header, index) => {
29471
29390
  const canSort = header.column.getCanSort();
29472
29391
  const canFilter = header.column.getCanFilter();
29473
29392
  const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
29474
- return /* @__PURE__ */ jsx53(
29393
+ return /* @__PURE__ */ jsx51(
29475
29394
  TableHead,
29476
29395
  {
29477
29396
  className: "relative select-none",
@@ -29480,8 +29399,8 @@ function DataTable({
29480
29399
  minWidth: header.column.columnDef.minSize,
29481
29400
  maxWidth: header.column.columnDef.maxSize
29482
29401
  },
29483
- children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
29484
- /* @__PURE__ */ jsxs31(
29402
+ children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
29403
+ /* @__PURE__ */ jsxs29(
29485
29404
  "span",
29486
29405
  {
29487
29406
  className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
@@ -29493,32 +29412,32 @@ function DataTable({
29493
29412
  },
29494
29413
  children: [
29495
29414
  flexRender(header.column.columnDef.header, header.getContext()),
29496
- canSort && /* @__PURE__ */ jsxs31(Fragment20, { children: [
29497
- sortDir === "asc" && /* @__PURE__ */ jsx53(ArrowUp, { size: 14, className: "text-gray-500" }),
29498
- sortDir === "desc" && /* @__PURE__ */ jsx53(ArrowDown, { size: 14, className: "text-gray-500" }),
29499
- !sortDir && /* @__PURE__ */ jsx53(ArrowUpDown, { size: 14, className: "text-gray-400" })
29415
+ canSort && /* @__PURE__ */ jsxs29(Fragment21, { children: [
29416
+ sortDir === "asc" && /* @__PURE__ */ jsx51(ArrowUp, { size: 14, className: "text-gray-500" }),
29417
+ sortDir === "desc" && /* @__PURE__ */ jsx51(ArrowDown, { size: 14, className: "text-gray-500" }),
29418
+ !sortDir && /* @__PURE__ */ jsx51(ArrowUpDown, { size: 14, className: "text-gray-400" })
29500
29419
  ] })
29501
29420
  ]
29502
29421
  }
29503
29422
  ),
29504
- canFilter && /* @__PURE__ */ jsxs31(Popover, { children: [
29505
- /* @__PURE__ */ jsx53(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
29423
+ canFilter && /* @__PURE__ */ jsxs29(Popover, { children: [
29424
+ /* @__PURE__ */ jsx51(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx51(
29506
29425
  "span",
29507
29426
  {
29508
29427
  role: "presentation",
29509
29428
  className: "pl-5 cursor-pointer",
29510
29429
  onClick: (e) => e.stopPropagation(),
29511
- children: /* @__PURE__ */ jsx53(FontAwesomeIcon3, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
29430
+ children: /* @__PURE__ */ jsx51(FontAwesomeIcon3, { icon: faEllipsisH, className: "w-5 h-5 text-gray-500" })
29512
29431
  }
29513
29432
  ) }),
29514
- /* @__PURE__ */ jsx53(
29433
+ /* @__PURE__ */ jsx51(
29515
29434
  PopoverContent,
29516
29435
  {
29517
29436
  align: "center",
29518
29437
  sideOffset: 14,
29519
29438
  className: "w-50 p-3 z-[200] border-gray-300",
29520
29439
  avoidCollisions: true,
29521
- children: /* @__PURE__ */ jsxs31(
29440
+ children: /* @__PURE__ */ jsxs29(
29522
29441
  "form",
29523
29442
  {
29524
29443
  onSubmit: (e) => {
@@ -29531,8 +29450,8 @@ function DataTable({
29531
29450
  },
29532
29451
  className: "space-y-2",
29533
29452
  children: [
29534
- /* @__PURE__ */ jsx53("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29535
- /* @__PURE__ */ jsx53(
29453
+ /* @__PURE__ */ jsx51("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29454
+ /* @__PURE__ */ jsx51(
29536
29455
  "input",
29537
29456
  {
29538
29457
  name: "filter",
@@ -29542,7 +29461,7 @@ function DataTable({
29542
29461
  autoComplete: "off"
29543
29462
  }
29544
29463
  ),
29545
- /* @__PURE__ */ jsx53("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx53(
29464
+ /* @__PURE__ */ jsx51("div", { className: "justify-end flex", children: /* @__PURE__ */ jsx51(
29546
29465
  Button,
29547
29466
  {
29548
29467
  type: "submit",
@@ -29561,11 +29480,11 @@ function DataTable({
29561
29480
  `header-${header.id}-${index}`
29562
29481
  );
29563
29482
  }) }, `header-group-${hg.id}`)) }),
29564
- /* @__PURE__ */ jsx53(TableBody, { children: loading ? /* @__PURE__ */ jsx53(Fragment20, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx53(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ jsx53(TableCell, { className: "p-3", children: /* @__PURE__ */ jsx53("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx53(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
29483
+ /* @__PURE__ */ jsx51(TableBody, { children: loading ? /* @__PURE__ */ jsx51(Fragment21, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx51(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ jsx51(TableCell, { className: "p-3", children: /* @__PURE__ */ jsx51("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx51(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
29565
29484
  const meta = cell.column.columnDef.meta || {};
29566
29485
  const isClickable = meta?.isClickable;
29567
29486
  const isLastCell = cellIndex === arr.length - 1;
29568
- return /* @__PURE__ */ jsxs31(
29487
+ return /* @__PURE__ */ jsxs29(
29569
29488
  TableCell,
29570
29489
  {
29571
29490
  className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
@@ -29582,9 +29501,9 @@ function DataTable({
29582
29501
  },
29583
29502
  children: [
29584
29503
  flexRender(cell.column.columnDef.cell, cell.getContext()),
29585
- isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx53("div", { className: "absolute bg-[#fff] p-1 px-4 inset-y-0 right-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 shadow-lg rounded", children: rowActions.map((action) => {
29504
+ isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx51("div", { className: "absolute bg-[#fff] p-1 px-4 inset-y-0 right-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 shadow-lg rounded", children: rowActions.map((action) => {
29586
29505
  const isDelete = action.id === "delete" || action.icon === "delete";
29587
- return /* @__PURE__ */ jsx53(
29506
+ return /* @__PURE__ */ jsx51(
29588
29507
  "button",
29589
29508
  {
29590
29509
  className: `ml-2 px-2 py-1 text-[12px] rounded cursor-pointer ${isDelete ? "bg-red-800 text-white hover:bg-neutral-600" : "bg-gray-300 hover:bg-gray-400"}`,
@@ -29606,17 +29525,17 @@ function DataTable({
29606
29525
  },
29607
29526
  `cell-${cell.id}-${cellIndex}`
29608
29527
  );
29609
- }) }, row.id)) : /* @__PURE__ */ jsx53(TableRow, { children: /* @__PURE__ */ jsx53(TableCell, { colSpan: dynamicCols.length, className: "h-24 text-center", children: /* @__PURE__ */ jsx53("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
29528
+ }) }, row.id)) : /* @__PURE__ */ jsx51(TableRow, { children: /* @__PURE__ */ jsx51(TableCell, { colSpan: dynamicCols.length, className: "h-24 text-center", children: /* @__PURE__ */ jsx51("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
29610
29529
  ] }),
29611
- pagination && /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29612
- /* @__PURE__ */ jsxs31("div", { children: [
29530
+ pagination && /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29531
+ /* @__PURE__ */ jsxs29("div", { children: [
29613
29532
  "Page ",
29614
29533
  table.getState().pagination.pageIndex + 1,
29615
29534
  " of ",
29616
29535
  pageCount
29617
29536
  ] }),
29618
- /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
29619
- /* @__PURE__ */ jsx53(
29537
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
29538
+ /* @__PURE__ */ jsx51(
29620
29539
  "button",
29621
29540
  {
29622
29541
  onClick: () => table.previousPage(),
@@ -29629,7 +29548,7 @@ function DataTable({
29629
29548
  table.getState().pagination.pageIndex + 1,
29630
29549
  table.getPageCount(),
29631
29550
  5
29632
- ).map((pageNum, index) => /* @__PURE__ */ jsx53(
29551
+ ).map((pageNum, index) => /* @__PURE__ */ jsx51(
29633
29552
  "button",
29634
29553
  {
29635
29554
  disabled: pageNum === "...",
@@ -29639,7 +29558,7 @@ function DataTable({
29639
29558
  },
29640
29559
  index
29641
29560
  )),
29642
- /* @__PURE__ */ jsx53(
29561
+ /* @__PURE__ */ jsx51(
29643
29562
  "button",
29644
29563
  {
29645
29564
  onClick: () => table.nextPage(),
@@ -29654,7 +29573,7 @@ function DataTable({
29654
29573
  }
29655
29574
 
29656
29575
  // src/components/DataDisplay/Table/Table.tsx
29657
- import { jsx as jsx54 } from "react/jsx-runtime";
29576
+ import { jsx as jsx52 } from "react/jsx-runtime";
29658
29577
  var Table4 = ({
29659
29578
  columns,
29660
29579
  data,
@@ -29679,7 +29598,7 @@ var Table4 = ({
29679
29598
  const rawColumns = Array.isArray(columns) ? columns : [];
29680
29599
  const rawData = Array.isArray(data) ? data : [];
29681
29600
  const isControlled = typeof page === "number";
29682
- return /* @__PURE__ */ jsx54("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx54(
29601
+ return /* @__PURE__ */ jsx52("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ jsx52(
29683
29602
  DataTable,
29684
29603
  {
29685
29604
  ...props,
@@ -29711,9 +29630,9 @@ var Table4 = ({
29711
29630
  var Table_default = Table4;
29712
29631
 
29713
29632
  // src/components/ui/pagination.tsx
29714
- import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29633
+ import { jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
29715
29634
  function Pagination({ className, ...props }) {
29716
- return /* @__PURE__ */ jsx55(
29635
+ return /* @__PURE__ */ jsx53(
29717
29636
  "nav",
29718
29637
  {
29719
29638
  role: "navigation",
@@ -29728,7 +29647,7 @@ function PaginationContent({
29728
29647
  className,
29729
29648
  ...props
29730
29649
  }) {
29731
- return /* @__PURE__ */ jsx55(
29650
+ return /* @__PURE__ */ jsx53(
29732
29651
  "ul",
29733
29652
  {
29734
29653
  "data-slot": "pagination-content",
@@ -29738,7 +29657,7 @@ function PaginationContent({
29738
29657
  );
29739
29658
  }
29740
29659
  function PaginationItem({ ...props }) {
29741
- return /* @__PURE__ */ jsx55("li", { "data-slot": "pagination-item", ...props });
29660
+ return /* @__PURE__ */ jsx53("li", { "data-slot": "pagination-item", ...props });
29742
29661
  }
29743
29662
  function PaginationLink({
29744
29663
  className,
@@ -29746,7 +29665,7 @@ function PaginationLink({
29746
29665
  size = "icon",
29747
29666
  ...props
29748
29667
  }) {
29749
- return /* @__PURE__ */ jsx55(
29668
+ return /* @__PURE__ */ jsx53(
29750
29669
  "a",
29751
29670
  {
29752
29671
  "aria-current": isActive ? "page" : void 0,
@@ -29767,7 +29686,7 @@ function PaginationPrevious({
29767
29686
  className,
29768
29687
  ...props
29769
29688
  }) {
29770
- return /* @__PURE__ */ jsxs32(
29689
+ return /* @__PURE__ */ jsxs30(
29771
29690
  PaginationLink,
29772
29691
  {
29773
29692
  "aria-label": "Go to previous page",
@@ -29775,8 +29694,8 @@ function PaginationPrevious({
29775
29694
  className: cn("gap-1 px-2.5 sm:pl-2.5", className),
29776
29695
  ...props,
29777
29696
  children: [
29778
- /* @__PURE__ */ jsx55(ChevronLeft, {}),
29779
- /* @__PURE__ */ jsx55("span", { className: "hidden sm:block", children: "Previous" })
29697
+ /* @__PURE__ */ jsx53(ChevronLeft, {}),
29698
+ /* @__PURE__ */ jsx53("span", { className: "hidden sm:block", children: "Previous" })
29780
29699
  ]
29781
29700
  }
29782
29701
  );
@@ -29785,7 +29704,7 @@ function PaginationNext({
29785
29704
  className,
29786
29705
  ...props
29787
29706
  }) {
29788
- return /* @__PURE__ */ jsxs32(
29707
+ return /* @__PURE__ */ jsxs30(
29789
29708
  PaginationLink,
29790
29709
  {
29791
29710
  "aria-label": "Go to next page",
@@ -29793,8 +29712,8 @@ function PaginationNext({
29793
29712
  className: cn("gap-1 px-2.5 sm:pr-2.5", className),
29794
29713
  ...props,
29795
29714
  children: [
29796
- /* @__PURE__ */ jsx55("span", { className: "hidden sm:block", children: "Next" }),
29797
- /* @__PURE__ */ jsx55(ChevronRight, {})
29715
+ /* @__PURE__ */ jsx53("span", { className: "hidden sm:block", children: "Next" }),
29716
+ /* @__PURE__ */ jsx53(ChevronRight, {})
29798
29717
  ]
29799
29718
  }
29800
29719
  );
@@ -29803,7 +29722,7 @@ function PaginationEllipsis({
29803
29722
  className,
29804
29723
  ...props
29805
29724
  }) {
29806
- return /* @__PURE__ */ jsxs32(
29725
+ return /* @__PURE__ */ jsxs30(
29807
29726
  "span",
29808
29727
  {
29809
29728
  "aria-hidden": true,
@@ -29811,15 +29730,15 @@ function PaginationEllipsis({
29811
29730
  className: cn("flex size-9 items-center justify-center", className),
29812
29731
  ...props,
29813
29732
  children: [
29814
- /* @__PURE__ */ jsx55(Ellipsis, { className: "size-4" }),
29815
- /* @__PURE__ */ jsx55("span", { className: "sr-only", children: "More pages" })
29733
+ /* @__PURE__ */ jsx53(Ellipsis, { className: "size-4" }),
29734
+ /* @__PURE__ */ jsx53("span", { className: "sr-only", children: "More pages" })
29816
29735
  ]
29817
29736
  }
29818
29737
  );
29819
29738
  }
29820
29739
 
29821
29740
  // src/components/DataDisplay/Pagination/Pagination.tsx
29822
- import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
29741
+ import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
29823
29742
  var CustomPagination = ({
29824
29743
  totalPages,
29825
29744
  currentPage,
@@ -29865,10 +29784,10 @@ var CustomPagination = ({
29865
29784
  }
29866
29785
  };
29867
29786
  const pageNumbers = getPageNumbers();
29868
- return /* @__PURE__ */ jsxs33("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29869
- /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
29870
- /* @__PURE__ */ jsx56("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29871
- /* @__PURE__ */ jsxs33(
29787
+ return /* @__PURE__ */ jsxs31("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29788
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
29789
+ /* @__PURE__ */ jsx54("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29790
+ /* @__PURE__ */ jsxs31(
29872
29791
  Select,
29873
29792
  {
29874
29793
  defaultValue: String(perPage),
@@ -29876,26 +29795,26 @@ var CustomPagination = ({
29876
29795
  onPageChange({ page: 1, itemsPerPage: Number(value) });
29877
29796
  },
29878
29797
  children: [
29879
- /* @__PURE__ */ jsx56(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx56(SelectValue, { placeholder: "Select" }) }),
29880
- /* @__PURE__ */ jsxs33(SelectContent, { children: [
29881
- /* @__PURE__ */ jsx56(SelectItem, { value: "5", children: "5" }),
29882
- /* @__PURE__ */ jsx56(SelectItem, { value: "10", children: "10" }),
29883
- /* @__PURE__ */ jsx56(SelectItem, { value: "20", children: "20" }),
29884
- /* @__PURE__ */ jsx56(SelectItem, { value: "50", children: "50" })
29798
+ /* @__PURE__ */ jsx54(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ jsx54(SelectValue, { placeholder: "Select" }) }),
29799
+ /* @__PURE__ */ jsxs31(SelectContent, { children: [
29800
+ /* @__PURE__ */ jsx54(SelectItem, { value: "5", children: "5" }),
29801
+ /* @__PURE__ */ jsx54(SelectItem, { value: "10", children: "10" }),
29802
+ /* @__PURE__ */ jsx54(SelectItem, { value: "20", children: "20" }),
29803
+ /* @__PURE__ */ jsx54(SelectItem, { value: "50", children: "50" })
29885
29804
  ] })
29886
29805
  ]
29887
29806
  }
29888
29807
  )
29889
29808
  ] }),
29890
- /* @__PURE__ */ jsx56(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs33(PaginationContent, { children: [
29891
- /* @__PURE__ */ jsx56(PaginationItem, { children: /* @__PURE__ */ jsx56(
29809
+ /* @__PURE__ */ jsx54(Pagination, { className: "justify-end", children: /* @__PURE__ */ jsxs31(PaginationContent, { children: [
29810
+ /* @__PURE__ */ jsx54(PaginationItem, { children: /* @__PURE__ */ jsx54(
29892
29811
  PaginationPrevious,
29893
29812
  {
29894
29813
  onClick: () => handlePageChange(currentPage - 1),
29895
29814
  className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
29896
29815
  }
29897
29816
  ) }),
29898
- pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx56(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx56(PaginationEllipsis, {}) : /* @__PURE__ */ jsx56(
29817
+ pageNumbers.map((pageNumber, index) => /* @__PURE__ */ jsx54(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ jsx54(PaginationEllipsis, {}) : /* @__PURE__ */ jsx54(
29899
29818
  PaginationLink,
29900
29819
  {
29901
29820
  onClick: () => handlePageChange(pageNumber),
@@ -29904,7 +29823,7 @@ var CustomPagination = ({
29904
29823
  children: pageNumber
29905
29824
  }
29906
29825
  ) }, index)),
29907
- /* @__PURE__ */ jsx56(PaginationItem, { children: /* @__PURE__ */ jsx56(
29826
+ /* @__PURE__ */ jsx54(PaginationItem, { children: /* @__PURE__ */ jsx54(
29908
29827
  PaginationNext,
29909
29828
  {
29910
29829
  onClick: () => handlePageChange(currentPage + 1),
@@ -29917,10 +29836,126 @@ var CustomPagination = ({
29917
29836
  var Pagination_default = CustomPagination;
29918
29837
 
29919
29838
  // src/components/Navigation/Tabs/Tabs.tsx
29920
- import { useCallback as useCallback3, useMemo as useMemo4, useState as useState8 } from "react";
29839
+ import { useCallback as useCallback3, useMemo as useMemo5, useState as useState8 } from "react";
29921
29840
  import Link5 from "next/link";
29922
29841
  import { useRouter } from "next/navigation";
29923
- import { Fragment as Fragment21, jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
29842
+
29843
+ // src/components/ui/dialog.tsx
29844
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
29845
+ import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29846
+ function Dialog({
29847
+ ...props
29848
+ }) {
29849
+ return /* @__PURE__ */ jsx55(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
29850
+ }
29851
+ function DialogPortal({
29852
+ ...props
29853
+ }) {
29854
+ return /* @__PURE__ */ jsx55(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
29855
+ }
29856
+ function DialogOverlay({
29857
+ className,
29858
+ ...props
29859
+ }) {
29860
+ return /* @__PURE__ */ jsx55(
29861
+ DialogPrimitive.Overlay,
29862
+ {
29863
+ "data-slot": "dialog-overlay",
29864
+ className: cn(
29865
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
29866
+ className
29867
+ ),
29868
+ ...props
29869
+ }
29870
+ );
29871
+ }
29872
+ function DialogContent({
29873
+ className,
29874
+ children,
29875
+ showCloseButton = true,
29876
+ ...props
29877
+ }) {
29878
+ return /* @__PURE__ */ jsxs32(DialogPortal, { "data-slot": "dialog-portal", children: [
29879
+ /* @__PURE__ */ jsx55(DialogOverlay, {}),
29880
+ /* @__PURE__ */ jsxs32(
29881
+ DialogPrimitive.Content,
29882
+ {
29883
+ "data-slot": "dialog-content",
29884
+ className: cn(
29885
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
29886
+ className
29887
+ ),
29888
+ ...props,
29889
+ children: [
29890
+ children,
29891
+ showCloseButton && /* @__PURE__ */ jsxs32(
29892
+ DialogPrimitive.Close,
29893
+ {
29894
+ "data-slot": "dialog-close",
29895
+ 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",
29896
+ children: [
29897
+ /* @__PURE__ */ jsx55(X, {}),
29898
+ /* @__PURE__ */ jsx55("span", { className: "sr-only", children: "Close" })
29899
+ ]
29900
+ }
29901
+ )
29902
+ ]
29903
+ }
29904
+ )
29905
+ ] });
29906
+ }
29907
+ function DialogHeader({ className, ...props }) {
29908
+ return /* @__PURE__ */ jsx55(
29909
+ "div",
29910
+ {
29911
+ "data-slot": "dialog-header",
29912
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
29913
+ ...props
29914
+ }
29915
+ );
29916
+ }
29917
+ function DialogFooter({ className, ...props }) {
29918
+ return /* @__PURE__ */ jsx55(
29919
+ "div",
29920
+ {
29921
+ "data-slot": "dialog-footer",
29922
+ className: cn(
29923
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
29924
+ className
29925
+ ),
29926
+ ...props
29927
+ }
29928
+ );
29929
+ }
29930
+ function DialogTitle({
29931
+ className,
29932
+ ...props
29933
+ }) {
29934
+ return /* @__PURE__ */ jsx55(
29935
+ DialogPrimitive.Title,
29936
+ {
29937
+ "data-slot": "dialog-title",
29938
+ className: cn("text-lg leading-none font-semibold", className),
29939
+ ...props
29940
+ }
29941
+ );
29942
+ }
29943
+ function DialogDescription({
29944
+ className,
29945
+ ...props
29946
+ }) {
29947
+ return /* @__PURE__ */ jsx55(
29948
+ DialogPrimitive.Description,
29949
+ {
29950
+ "data-slot": "dialog-description",
29951
+ className: cn("text-muted-foreground text-sm", className),
29952
+ ...props
29953
+ }
29954
+ );
29955
+ }
29956
+
29957
+ // src/components/Navigation/Tabs/Tabs.tsx
29958
+ import { Fragment as Fragment22, jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
29924
29959
  var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
29925
29960
  const [openIndex, setOpenIndex] = useState8(null);
29926
29961
  function groupMenus(menus = []) {
@@ -29955,7 +29990,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29955
29990
  });
29956
29991
  return sortMenus(rootMenus);
29957
29992
  }
29958
- const rawTabs = useMemo4(() => {
29993
+ const rawTabs = useMemo5(() => {
29959
29994
  if (!Array.isArray(tabs)) return [];
29960
29995
  if (source === "manual") return Array.isArray(tabs) ? tabs : [];
29961
29996
  return groupMenus(tabs);
@@ -29990,13 +30025,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
29990
30025
  const renderDesktopTab = (tab, index) => {
29991
30026
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
29992
30027
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
29993
- return /* @__PURE__ */ jsxs34(
30028
+ return /* @__PURE__ */ jsxs33(
29994
30029
  DropdownMenu,
29995
30030
  {
29996
30031
  open: openIndex === index,
29997
30032
  onOpenChange: (open) => setOpenIndex(open ? index : null),
29998
30033
  children: [
29999
- /* @__PURE__ */ jsxs34(
30034
+ /* @__PURE__ */ jsxs33(
30000
30035
  DropdownMenuTrigger,
30001
30036
  {
30002
30037
  className: `${finalClasses} inline-flex items-center gap-1`,
@@ -30009,11 +30044,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30009
30044
  },
30010
30045
  children: [
30011
30046
  tab.header,
30012
- /* @__PURE__ */ jsx57(ChevronDown, { className: "h-4 w-4 opacity-80" })
30047
+ /* @__PURE__ */ jsx56(ChevronDown, { className: "h-4 w-4 opacity-80" })
30013
30048
  ]
30014
30049
  }
30015
30050
  ),
30016
- /* @__PURE__ */ jsx57(
30051
+ /* @__PURE__ */ jsx56(
30017
30052
  DropdownMenuContent,
30018
30053
  {
30019
30054
  align: "start",
@@ -30026,12 +30061,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30026
30061
  onMouseLeave: () => {
30027
30062
  timeout = setTimeout(() => setOpenIndex(null), 150);
30028
30063
  },
30029
- children: tab.children.map((item, index2) => /* @__PURE__ */ jsx57(
30064
+ children: tab.children.map((item, index2) => /* @__PURE__ */ jsx56(
30030
30065
  DropdownMenuItem,
30031
30066
  {
30032
30067
  asChild: true,
30033
30068
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
30034
- children: /* @__PURE__ */ jsx57(
30069
+ children: /* @__PURE__ */ jsx56(
30035
30070
  Link5,
30036
30071
  {
30037
30072
  href: item.url || "#",
@@ -30050,7 +30085,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30050
30085
  index
30051
30086
  );
30052
30087
  }
30053
- return tab.url ? /* @__PURE__ */ jsx57(
30088
+ return tab.url ? /* @__PURE__ */ jsx56(
30054
30089
  Link5,
30055
30090
  {
30056
30091
  href: tab.url,
@@ -30061,14 +30096,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30061
30096
  children: tab.header
30062
30097
  },
30063
30098
  index
30064
- ) : /* @__PURE__ */ jsx57("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
30099
+ ) : /* @__PURE__ */ jsx56("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
30065
30100
  };
30066
- const renderMobileMenu = () => /* @__PURE__ */ jsxs34(DropdownMenu, { children: [
30067
- /* @__PURE__ */ jsxs34(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
30068
- /* @__PURE__ */ jsx57(Menu, { className: "h-4 w-4" }),
30101
+ const renderMobileMenu = () => /* @__PURE__ */ jsxs33(DropdownMenu, { children: [
30102
+ /* @__PURE__ */ jsxs33(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
30103
+ /* @__PURE__ */ jsx56(Menu, { className: "h-4 w-4" }),
30069
30104
  "Menu"
30070
30105
  ] }),
30071
- /* @__PURE__ */ jsx57(
30106
+ /* @__PURE__ */ jsx56(
30072
30107
  DropdownMenuContent,
30073
30108
  {
30074
30109
  align: "start",
@@ -30077,25 +30112,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30077
30112
  children: rawTabs.map((tab, i) => {
30078
30113
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
30079
30114
  if (hasChildren) {
30080
- return /* @__PURE__ */ jsxs34(DropdownMenuSub, { children: [
30081
- /* @__PURE__ */ jsx57(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 }),
30082
- /* @__PURE__ */ jsx57(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ jsx57(
30115
+ return /* @__PURE__ */ jsxs33(DropdownMenuSub, { children: [
30116
+ /* @__PURE__ */ jsx56(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 }),
30117
+ /* @__PURE__ */ jsx56(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ jsx56(
30083
30118
  DropdownMenuItem,
30084
30119
  {
30085
30120
  asChild: true,
30086
30121
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
30087
- children: /* @__PURE__ */ jsx57(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30122
+ children: /* @__PURE__ */ jsx56(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30088
30123
  },
30089
30124
  item.id || index
30090
30125
  )) })
30091
30126
  ] }, i);
30092
30127
  }
30093
- return /* @__PURE__ */ jsx57(
30128
+ return /* @__PURE__ */ jsx56(
30094
30129
  DropdownMenuItem,
30095
30130
  {
30096
30131
  asChild: true,
30097
30132
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
30098
- children: /* @__PURE__ */ jsx57(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30133
+ children: /* @__PURE__ */ jsx56(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30099
30134
  },
30100
30135
  i
30101
30136
  );
@@ -30105,19 +30140,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30105
30140
  ] });
30106
30141
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
30107
30142
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
30108
- return /* @__PURE__ */ jsxs34(Fragment21, { children: [
30109
- /* @__PURE__ */ jsxs34("div", { className: cn("min-h-10", className), style, children: [
30110
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx57("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx57("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx57("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx57("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30111
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx57("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx57("div", { className: "flex md:hidden", children: renderMobileMenu() })
30143
+ return /* @__PURE__ */ jsxs33(Fragment22, { children: [
30144
+ /* @__PURE__ */ jsxs33("div", { className: cn("min-h-10", className), style, children: [
30145
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx56("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx56("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx56("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx56("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30146
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx56("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx56("div", { className: "flex md:hidden", children: renderMobileMenu() })
30112
30147
  ] }),
30113
- /* @__PURE__ */ jsx57(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs34(DialogContent, { className: "bg-[#fff]", children: [
30114
- /* @__PURE__ */ jsxs34(DialogHeader, { children: [
30115
- /* @__PURE__ */ jsx57(DialogTitle, { children: "Exit Builder?" }),
30116
- /* @__PURE__ */ jsx57(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30148
+ /* @__PURE__ */ jsx56(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs33(DialogContent, { className: "bg-[#fff]", children: [
30149
+ /* @__PURE__ */ jsxs33(DialogHeader, { children: [
30150
+ /* @__PURE__ */ jsx56(DialogTitle, { children: "Exit Builder?" }),
30151
+ /* @__PURE__ */ jsx56(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30117
30152
  ] }),
30118
- /* @__PURE__ */ jsxs34(DialogFooter, { children: [
30119
- /* @__PURE__ */ jsx57(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30120
- /* @__PURE__ */ jsx57(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30153
+ /* @__PURE__ */ jsxs33(DialogFooter, { children: [
30154
+ /* @__PURE__ */ jsx56(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30155
+ /* @__PURE__ */ jsx56(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30121
30156
  ] })
30122
30157
  ] }) })
30123
30158
  ] });
@@ -30125,8 +30160,8 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30125
30160
  var Tabs_default = Tabs;
30126
30161
 
30127
30162
  // src/components/Navigation/Stages/Stages.tsx
30128
- import React11, { useState as useState9 } from "react";
30129
- import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
30163
+ import React10, { useState as useState9 } from "react";
30164
+ import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
30130
30165
  var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
30131
30166
  const [activeStage, setActiveStage] = useState9(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30132
30167
  const nextStage = () => {
@@ -30145,9 +30180,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30145
30180
  onStageChange?.(stageKey);
30146
30181
  };
30147
30182
  const isAllStagesCompleted = activeStage === lastStage;
30148
- return /* @__PURE__ */ jsx58("div", { className, style, children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30149
- /* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx58("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx58("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30150
- /* @__PURE__ */ jsx58("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx58(
30183
+ return /* @__PURE__ */ jsx57("div", { className, style, children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30184
+ /* @__PURE__ */ jsx57("div", { className: "flex items-center", children: /* @__PURE__ */ jsx57("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx57("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx57("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30185
+ /* @__PURE__ */ jsx57("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ jsx57(
30151
30186
  "button",
30152
30187
  {
30153
30188
  className: `
@@ -30160,8 +30195,8 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30160
30195
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
30161
30196
  const isCompleted = isAllStagesCompleted || index < currentIndex;
30162
30197
  const isActive = !isAllStagesCompleted && index === currentIndex;
30163
- return /* @__PURE__ */ jsxs35(React11.Fragment, { children: [
30164
- /* @__PURE__ */ jsx58(
30198
+ return /* @__PURE__ */ jsxs34(React10.Fragment, { children: [
30199
+ /* @__PURE__ */ jsx57(
30165
30200
  "button",
30166
30201
  {
30167
30202
  className: `
@@ -30174,10 +30209,10 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30174
30209
  children: stage[dataLabel]
30175
30210
  }
30176
30211
  ),
30177
- index < stages.length - 1 && /* @__PURE__ */ jsx58("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
30212
+ index < stages.length - 1 && /* @__PURE__ */ jsx57("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
30178
30213
  ] }, stage.id);
30179
30214
  }) }),
30180
- isShowBtn && /* @__PURE__ */ jsx58("div", { className: "flex items-center", children: /* @__PURE__ */ jsx58(
30215
+ isShowBtn && /* @__PURE__ */ jsx57("div", { className: "flex items-center", children: /* @__PURE__ */ jsx57(
30181
30216
  "button",
30182
30217
  {
30183
30218
  className: "bg-green-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
@@ -30192,26 +30227,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30192
30227
  var Stages_default = StagesComponent;
30193
30228
 
30194
30229
  // src/components/Navigation/Spacer/Spacer.tsx
30195
- import { jsx as jsx59 } from "react/jsx-runtime";
30230
+ import { jsx as jsx58 } from "react/jsx-runtime";
30196
30231
  var Spacer = ({ className, style }) => {
30197
- return /* @__PURE__ */ jsx59("div", { className: `${className}`, style });
30232
+ return /* @__PURE__ */ jsx58("div", { className: `${className}`, style });
30198
30233
  };
30199
30234
  var Spacer_default = Spacer;
30200
30235
 
30201
30236
  // src/components/Navigation/Profile/Profile.tsx
30202
- import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
30237
+ import { jsx as jsx59, jsxs as jsxs35 } from "react/jsx-runtime";
30203
30238
 
30204
30239
  // src/components/Navigation/Notification/Notification.tsx
30205
- import { jsx as jsx61, jsxs as jsxs37 } from "react/jsx-runtime";
30240
+ import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
30206
30241
 
30207
30242
  // src/components/Navigation/Logo/Logo.tsx
30208
- import { jsx as jsx62 } from "react/jsx-runtime";
30243
+ import { jsx as jsx61 } from "react/jsx-runtime";
30209
30244
 
30210
30245
  // src/components/ui/avatar.tsx
30211
- import * as React12 from "react";
30246
+ import * as React11 from "react";
30212
30247
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
30213
- import { jsx as jsx63 } from "react/jsx-runtime";
30214
- var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
30248
+ import { jsx as jsx62 } from "react/jsx-runtime";
30249
+ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
30215
30250
  AvatarPrimitive.Root,
30216
30251
  {
30217
30252
  ref,
@@ -30223,7 +30258,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
30223
30258
  }
30224
30259
  ));
30225
30260
  Avatar.displayName = AvatarPrimitive.Root.displayName;
30226
- var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
30261
+ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
30227
30262
  AvatarPrimitive.Image,
30228
30263
  {
30229
30264
  ref,
@@ -30232,7 +30267,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
30232
30267
  }
30233
30268
  ));
30234
30269
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
30235
- var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx63(
30270
+ var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx62(
30236
30271
  AvatarPrimitive.Fallback,
30237
30272
  {
30238
30273
  ref,
@@ -30250,8 +30285,8 @@ import Link6 from "next/link";
30250
30285
  import Image4 from "next/image";
30251
30286
  import { useRouter as useRouter2 } from "next/navigation";
30252
30287
  import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
30253
- import { useCallback as useCallback4, useMemo as useMemo5, useState as useState10 } from "react";
30254
- import { Fragment as Fragment22, jsx as jsx64, jsxs as jsxs38 } from "react/jsx-runtime";
30288
+ import { useCallback as useCallback4, useMemo as useMemo6, useState as useState10 } from "react";
30289
+ import { Fragment as Fragment23, jsx as jsx63, jsxs as jsxs37 } from "react/jsx-runtime";
30255
30290
  function Navbar({
30256
30291
  style,
30257
30292
  badgeType,
@@ -30289,29 +30324,29 @@ function Navbar({
30289
30324
  router.push(pendingUrl);
30290
30325
  }
30291
30326
  };
30292
- const formatedMenu = useMemo5(() => {
30327
+ const formatedMenu = useMemo6(() => {
30293
30328
  if (source === "state" && navList && navList.length) {
30294
30329
  return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
30295
30330
  }
30296
30331
  return list || [];
30297
30332
  }, [source, navList]);
30298
- return /* @__PURE__ */ jsxs38(Fragment22, { children: [
30299
- /* @__PURE__ */ jsx64(
30333
+ return /* @__PURE__ */ jsxs37(Fragment23, { children: [
30334
+ /* @__PURE__ */ jsx63(
30300
30335
  "nav",
30301
30336
  {
30302
30337
  className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
30303
30338
  style,
30304
- children: /* @__PURE__ */ jsxs38("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
30305
- /* @__PURE__ */ jsx64(
30339
+ children: /* @__PURE__ */ jsxs37("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
30340
+ /* @__PURE__ */ jsx63(
30306
30341
  Link6,
30307
30342
  {
30308
30343
  href: "/",
30309
30344
  onClick: (e) => handleBuilderExit(e, "/"),
30310
30345
  className: "flex items-center space-x-2",
30311
- children: imageUrl ? /* @__PURE__ */ jsx64(Image4, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx64("span", { className: "font-semibold text-blue-700", children: "Logo" })
30346
+ children: imageUrl ? /* @__PURE__ */ jsx63(Image4, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx63("span", { className: "font-semibold text-blue-700", children: "Logo" })
30312
30347
  }
30313
30348
  ),
30314
- !isMobileView && /* @__PURE__ */ jsx64("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx64(
30349
+ !isMobileView && /* @__PURE__ */ jsx63("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx63(
30315
30350
  Link6,
30316
30351
  {
30317
30352
  href: item.url || "#",
@@ -30321,39 +30356,39 @@ function Navbar({
30321
30356
  },
30322
30357
  item.id
30323
30358
  )) }),
30324
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-3", children: [
30325
- !isMobileView ? /* @__PURE__ */ jsx64("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs38("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
30326
- /* @__PURE__ */ jsx64(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
30327
- /* @__PURE__ */ jsx64(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
30328
- ] }) }) : /* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx64(Search, { className: "h-5 w-5 text-gray-400" }) }),
30329
- /* @__PURE__ */ jsxs38("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
30330
- /* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx64(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
30331
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx64("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__ */ jsx64("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
30359
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-center space-x-3", children: [
30360
+ !isMobileView ? /* @__PURE__ */ jsx63("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs37("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
30361
+ /* @__PURE__ */ jsx63(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
30362
+ /* @__PURE__ */ jsx63(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
30363
+ ] }) }) : /* @__PURE__ */ jsx63(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx63(Search, { className: "h-5 w-5 text-gray-400" }) }),
30364
+ /* @__PURE__ */ jsxs37("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
30365
+ /* @__PURE__ */ jsx63(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx63(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
30366
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx63("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__ */ jsx63("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
30332
30367
  ] }),
30333
- /* @__PURE__ */ jsxs38(DropdownMenu, { children: [
30334
- /* @__PURE__ */ jsx64(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center space-x-2", children: [
30335
- !isMobileView && showName && /* @__PURE__ */ jsx64("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
30336
- !isMobileView ? /* @__PURE__ */ jsxs38(Fragment22, { children: [
30337
- /* @__PURE__ */ jsx64(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx64(
30368
+ /* @__PURE__ */ jsxs37(DropdownMenu, { children: [
30369
+ /* @__PURE__ */ jsx63(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center space-x-2", children: [
30370
+ !isMobileView && showName && /* @__PURE__ */ jsx63("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
30371
+ !isMobileView ? /* @__PURE__ */ jsxs37(Fragment23, { children: [
30372
+ /* @__PURE__ */ jsx63(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx63(
30338
30373
  AvatarImage,
30339
30374
  {
30340
30375
  src: "/images/appbuilder/toolset/profile.svg",
30341
30376
  alt: "Profile"
30342
30377
  }
30343
- ) : /* @__PURE__ */ jsx64("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) }) }),
30344
- /* @__PURE__ */ jsx64(
30378
+ ) : /* @__PURE__ */ jsx63("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) }) }),
30379
+ /* @__PURE__ */ jsx63(
30345
30380
  Button,
30346
30381
  {
30347
30382
  variant: "ghost",
30348
30383
  size: "icon",
30349
30384
  className: "text-gray-900 md:hidden dark:invert",
30350
- children: /* @__PURE__ */ jsx64(Menu, { className: "h-6 w-6" })
30385
+ children: /* @__PURE__ */ jsx63(Menu, { className: "h-6 w-6" })
30351
30386
  }
30352
30387
  )
30353
- ] }) : /* @__PURE__ */ jsx64(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx64(Menu, { className: "h-6 w-6" }) })
30388
+ ] }) : /* @__PURE__ */ jsx63(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx63(Menu, { className: "h-6 w-6" }) })
30354
30389
  ] }) }),
30355
- /* @__PURE__ */ jsxs38(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
30356
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx64(Fragment22, { children: profileMenu.map((item) => /* @__PURE__ */ jsx64(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx64(
30390
+ /* @__PURE__ */ jsxs37(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
30391
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx63(Fragment23, { children: profileMenu.map((item) => /* @__PURE__ */ jsx63(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx63(
30357
30392
  Link6,
30358
30393
  {
30359
30394
  href: item.url || "#",
@@ -30361,9 +30396,9 @@ function Navbar({
30361
30396
  children: item.header
30362
30397
  }
30363
30398
  ) }, item.id)) }),
30364
- /* @__PURE__ */ jsxs38("div", { className: "md:hidden", children: [
30365
- /* @__PURE__ */ jsx64(DropdownMenuSeparator, {}),
30366
- formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx64(Fragment22, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx64(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx64(
30399
+ /* @__PURE__ */ jsxs37("div", { className: "md:hidden", children: [
30400
+ /* @__PURE__ */ jsx63(DropdownMenuSeparator, {}),
30401
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx63(Fragment23, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx63(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx63(
30367
30402
  Link6,
30368
30403
  {
30369
30404
  href: item.url || "#",
@@ -30378,21 +30413,21 @@ function Navbar({
30378
30413
  ] })
30379
30414
  }
30380
30415
  ),
30381
- /* @__PURE__ */ jsx64(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs38(DialogContent, { className: "bg-[#fff]", children: [
30382
- /* @__PURE__ */ jsxs38(DialogHeader, { children: [
30383
- /* @__PURE__ */ jsx64(DialogTitle, { children: "Exit Builder?" }),
30384
- /* @__PURE__ */ jsx64(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30416
+ /* @__PURE__ */ jsx63(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs37(DialogContent, { className: "bg-[#fff]", children: [
30417
+ /* @__PURE__ */ jsxs37(DialogHeader, { children: [
30418
+ /* @__PURE__ */ jsx63(DialogTitle, { children: "Exit Builder?" }),
30419
+ /* @__PURE__ */ jsx63(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30385
30420
  ] }),
30386
- /* @__PURE__ */ jsxs38(DialogFooter, { children: [
30387
- /* @__PURE__ */ jsx64(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30388
- /* @__PURE__ */ jsx64(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30421
+ /* @__PURE__ */ jsxs37(DialogFooter, { children: [
30422
+ /* @__PURE__ */ jsx63(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30423
+ /* @__PURE__ */ jsx63(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30389
30424
  ] })
30390
30425
  ] }) })
30391
30426
  ] });
30392
30427
  }
30393
30428
 
30394
30429
  // src/components/Chart/BarChart.tsx
30395
- import React13 from "react";
30430
+ import React12 from "react";
30396
30431
  import {
30397
30432
  BarChart,
30398
30433
  Bar,
@@ -30405,35 +30440,35 @@ import {
30405
30440
  ResponsiveContainer,
30406
30441
  Legend
30407
30442
  } from "recharts";
30408
- import { jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
30443
+ import { jsx as jsx64, jsxs as jsxs38 } from "react/jsx-runtime";
30409
30444
  var ChartComponent = ({ className, style, loading, ...props }) => {
30410
30445
  const data = Array.isArray(props.data) ? props.data : [];
30411
30446
  const chartType = props.chartType || "bar";
30412
30447
  const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
30413
30448
  if (loading || data.length === 0) {
30414
- return /* @__PURE__ */ jsx65(
30449
+ return /* @__PURE__ */ jsx64(
30415
30450
  "div",
30416
30451
  {
30417
30452
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
30418
30453
  style,
30419
- children: /* @__PURE__ */ jsx65("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30454
+ children: /* @__PURE__ */ jsx64("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30420
30455
  }
30421
30456
  );
30422
30457
  }
30423
- return /* @__PURE__ */ jsx65("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx65(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs39(BarChart, { data, title: "Leads", desc: "content", children: [
30424
- /* @__PURE__ */ jsx65(CartesianGrid, { strokeDasharray: "3 3" }),
30425
- /* @__PURE__ */ jsx65(XAxis, { dataKey: "name" }),
30426
- /* @__PURE__ */ jsx65(YAxis, {}),
30427
- /* @__PURE__ */ jsx65(Tooltip, { formatter: (value) => `${value}k` }),
30428
- /* @__PURE__ */ jsx65(Legend, { verticalAlign: legendsPosition, align: "center" }),
30429
- /* @__PURE__ */ jsx65(
30458
+ return /* @__PURE__ */ jsx64("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx64(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs38(BarChart, { data, title: "Leads", desc: "content", children: [
30459
+ /* @__PURE__ */ jsx64(CartesianGrid, { strokeDasharray: "3 3" }),
30460
+ /* @__PURE__ */ jsx64(XAxis, { dataKey: "name" }),
30461
+ /* @__PURE__ */ jsx64(YAxis, {}),
30462
+ /* @__PURE__ */ jsx64(Tooltip, { formatter: (value) => `${value}k` }),
30463
+ /* @__PURE__ */ jsx64(Legend, { verticalAlign: legendsPosition, align: "center" }),
30464
+ /* @__PURE__ */ jsx64(
30430
30465
  Bar,
30431
30466
  {
30432
30467
  dataKey: "value",
30433
30468
  fill: "#00695C",
30434
30469
  radius: [6, 6, 0, 0],
30435
30470
  isAnimationActive: false,
30436
- children: data.map((entry, index) => /* @__PURE__ */ jsx65(
30471
+ children: data.map((entry, index) => /* @__PURE__ */ jsx64(
30437
30472
  "rect",
30438
30473
  {
30439
30474
  fill: entry.color || "#00695C"
@@ -30442,16 +30477,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
30442
30477
  ))
30443
30478
  }
30444
30479
  )
30445
- ] }) : /* @__PURE__ */ jsxs39(AreaChart, { data, children: [
30446
- /* @__PURE__ */ jsx65("defs", { children: /* @__PURE__ */ jsxs39("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
30447
- /* @__PURE__ */ jsx65("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
30448
- /* @__PURE__ */ jsx65("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
30480
+ ] }) : /* @__PURE__ */ jsxs38(AreaChart, { data, children: [
30481
+ /* @__PURE__ */ jsx64("defs", { children: /* @__PURE__ */ jsxs38("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
30482
+ /* @__PURE__ */ jsx64("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
30483
+ /* @__PURE__ */ jsx64("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
30449
30484
  ] }) }),
30450
- /* @__PURE__ */ jsx65(CartesianGrid, { strokeDasharray: "3 3" }),
30451
- /* @__PURE__ */ jsx65(XAxis, { dataKey: "name" }),
30452
- /* @__PURE__ */ jsx65(YAxis, {}),
30453
- /* @__PURE__ */ jsx65(Tooltip, { formatter: (value) => `${value}k` }),
30454
- /* @__PURE__ */ jsx65(
30485
+ /* @__PURE__ */ jsx64(CartesianGrid, { strokeDasharray: "3 3" }),
30486
+ /* @__PURE__ */ jsx64(XAxis, { dataKey: "name" }),
30487
+ /* @__PURE__ */ jsx64(YAxis, {}),
30488
+ /* @__PURE__ */ jsx64(Tooltip, { formatter: (value) => `${value}k` }),
30489
+ /* @__PURE__ */ jsx64(
30455
30490
  Area,
30456
30491
  {
30457
30492
  type: "monotone",
@@ -30464,10 +30499,10 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
30464
30499
  )
30465
30500
  ] }) }) });
30466
30501
  };
30467
- var BarChart_default = React13.memo(ChartComponent);
30502
+ var BarChart_default = React12.memo(ChartComponent);
30468
30503
 
30469
30504
  // src/components/Chart/PieChart.tsx
30470
- import React14, { useEffect as useEffect25, useMemo as useMemo6, useState as useState11 } from "react";
30505
+ import React13, { useEffect as useEffect25, useMemo as useMemo7, useState as useState11 } from "react";
30471
30506
  import {
30472
30507
  PieChart,
30473
30508
  Pie,
@@ -30476,7 +30511,7 @@ import {
30476
30511
  Tooltip as Tooltip2,
30477
30512
  LabelList
30478
30513
  } from "recharts";
30479
- import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
30514
+ import { Fragment as Fragment24, jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
30480
30515
  var getRandomColor = () => {
30481
30516
  const palette = [
30482
30517
  "#2563eb",
@@ -30496,32 +30531,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30496
30531
  const showLegends = props.showLegends ?? true;
30497
30532
  const labelType = props.labelType || "inside";
30498
30533
  const canvasMode = props.canvasMode;
30499
- const data = useMemo6(() => {
30534
+ const data = useMemo7(() => {
30500
30535
  if (!Array.isArray(props.data)) return [];
30501
30536
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
30502
30537
  }, [props.data]);
30503
- const total = useMemo6(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30538
+ const total = useMemo7(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30504
30539
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
30505
30540
  const [mounted, setMounted] = useState11(false);
30506
30541
  useEffect25(() => {
30507
30542
  const timeout = setTimeout(() => setMounted(true), 100);
30508
30543
  return () => clearTimeout(timeout);
30509
30544
  }, []);
30510
- const renderLegends = useMemo6(() => {
30545
+ const renderLegends = useMemo7(() => {
30511
30546
  if (!showLegends) return null;
30512
- return /* @__PURE__ */ jsx66(Fragment23, { children: data.map((d) => /* @__PURE__ */ jsxs40(
30547
+ return /* @__PURE__ */ jsx65(Fragment24, { children: data.map((d) => /* @__PURE__ */ jsxs39(
30513
30548
  "div",
30514
30549
  {
30515
30550
  className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
30516
30551
  children: [
30517
- /* @__PURE__ */ jsx66(
30552
+ /* @__PURE__ */ jsx65(
30518
30553
  "span",
30519
30554
  {
30520
30555
  className: "inline-block w-[16px] h-[16px] rounded",
30521
30556
  style: { backgroundColor: d.color }
30522
30557
  }
30523
30558
  ),
30524
- /* @__PURE__ */ jsx66("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
30559
+ /* @__PURE__ */ jsx65("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
30525
30560
  ]
30526
30561
  },
30527
30562
  d.name
@@ -30529,24 +30564,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30529
30564
  }, [data, showLegends]);
30530
30565
  if (!mounted) return null;
30531
30566
  if (loading || data.length === 0) {
30532
- return /* @__PURE__ */ jsx66(
30567
+ return /* @__PURE__ */ jsx65(
30533
30568
  "div",
30534
30569
  {
30535
30570
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
30536
30571
  style,
30537
- children: /* @__PURE__ */ jsx66("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30572
+ children: /* @__PURE__ */ jsx65("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30538
30573
  }
30539
30574
  );
30540
30575
  }
30541
- return /* @__PURE__ */ jsxs40(
30576
+ return /* @__PURE__ */ jsxs39(
30542
30577
  "div",
30543
30578
  {
30544
30579
  className: `relative flex flex-col items-center ${className}`,
30545
30580
  style,
30546
30581
  children: [
30547
- /* @__PURE__ */ jsxs40("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
30548
- /* @__PURE__ */ jsx66(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs40(PieChart, { children: [
30549
- /* @__PURE__ */ jsxs40(
30582
+ /* @__PURE__ */ jsxs39("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
30583
+ /* @__PURE__ */ jsx65(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs39(PieChart, { children: [
30584
+ /* @__PURE__ */ jsxs39(
30550
30585
  Pie,
30551
30586
  {
30552
30587
  data,
@@ -30558,8 +30593,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30558
30593
  labelLine: false,
30559
30594
  isAnimationActive: false,
30560
30595
  children: [
30561
- data.map((entry, index) => /* @__PURE__ */ jsx66(Cell, { fill: entry.color }, `cell-${index}`)),
30562
- /* @__PURE__ */ jsx66(
30596
+ data.map((entry, index) => /* @__PURE__ */ jsx65(Cell, { fill: entry.color }, `cell-${index}`)),
30597
+ /* @__PURE__ */ jsx65(
30563
30598
  LabelList,
30564
30599
  {
30565
30600
  dataKey: "value",
@@ -30572,14 +30607,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30572
30607
  ]
30573
30608
  }
30574
30609
  ),
30575
- /* @__PURE__ */ jsx66(
30610
+ /* @__PURE__ */ jsx65(
30576
30611
  Tooltip2,
30577
30612
  {
30578
30613
  formatter: (value, name) => [`${value}k`, name]
30579
30614
  }
30580
30615
  )
30581
30616
  ] }) }),
30582
- /* @__PURE__ */ jsxs40(
30617
+ /* @__PURE__ */ jsxs39(
30583
30618
  "div",
30584
30619
  {
30585
30620
  className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
@@ -30590,18 +30625,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30590
30625
  }
30591
30626
  )
30592
30627
  ] }),
30593
- /* @__PURE__ */ jsx66("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
30628
+ /* @__PURE__ */ jsx65("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
30594
30629
  ]
30595
30630
  }
30596
30631
  );
30597
30632
  };
30598
- var PieChart_default = React14.memo(DonutChart);
30633
+ var PieChart_default = React13.memo(DonutChart);
30599
30634
 
30600
30635
  // src/components/Blocks/EmailComposer.tsx
30601
- import { jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
30636
+ import { jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
30602
30637
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
30603
- return /* @__PURE__ */ jsx67("div", { className, style, children: /* @__PURE__ */ jsxs41("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
30604
- /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
30638
+ return /* @__PURE__ */ jsx66("div", { className, style, children: /* @__PURE__ */ jsxs40("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
30639
+ /* @__PURE__ */ jsx66("div", { className: "mb-3", children: /* @__PURE__ */ jsx66(
30605
30640
  "input",
30606
30641
  {
30607
30642
  type: "email",
@@ -30610,8 +30645,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30610
30645
  required: true
30611
30646
  }
30612
30647
  ) }),
30613
- /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
30614
- /* @__PURE__ */ jsx67(
30648
+ /* @__PURE__ */ jsx66("div", { className: "mb-3", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
30649
+ /* @__PURE__ */ jsx66(
30615
30650
  "input",
30616
30651
  {
30617
30652
  type: "email",
@@ -30622,7 +30657,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30622
30657
  required: true
30623
30658
  }
30624
30659
  ),
30625
- !showCc && /* @__PURE__ */ jsx67(
30660
+ !showCc && /* @__PURE__ */ jsx66(
30626
30661
  "button",
30627
30662
  {
30628
30663
  onClick: () => setShowCc?.(true),
@@ -30630,7 +30665,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30630
30665
  children: "Cc"
30631
30666
  }
30632
30667
  ),
30633
- !showBcc && /* @__PURE__ */ jsx67(
30668
+ !showBcc && /* @__PURE__ */ jsx66(
30634
30669
  "button",
30635
30670
  {
30636
30671
  onClick: () => setShowBcc?.(true),
@@ -30639,7 +30674,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30639
30674
  }
30640
30675
  )
30641
30676
  ] }) }),
30642
- showCc && /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
30677
+ showCc && /* @__PURE__ */ jsx66("div", { className: "mb-3", children: /* @__PURE__ */ jsx66(
30643
30678
  "input",
30644
30679
  {
30645
30680
  type: "text",
@@ -30649,7 +30684,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30649
30684
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30650
30685
  }
30651
30686
  ) }),
30652
- showBcc && /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
30687
+ showBcc && /* @__PURE__ */ jsx66("div", { className: "mb-3", children: /* @__PURE__ */ jsx66(
30653
30688
  "input",
30654
30689
  {
30655
30690
  type: "text",
@@ -30659,7 +30694,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30659
30694
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30660
30695
  }
30661
30696
  ) }),
30662
- /* @__PURE__ */ jsx67("div", { className: "mb-3", children: /* @__PURE__ */ jsx67(
30697
+ /* @__PURE__ */ jsx66("div", { className: "mb-3", children: /* @__PURE__ */ jsx66(
30663
30698
  "input",
30664
30699
  {
30665
30700
  type: "text",
@@ -30669,11 +30704,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30669
30704
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30670
30705
  }
30671
30706
  ) }),
30672
- /* @__PURE__ */ jsx67("div", { className: "mb-4", children: /* @__PURE__ */ jsx67(MyEditor, { value: body, onChange: setBody }) }),
30673
- /* @__PURE__ */ jsxs41("div", { className: "flex justify-end gap-2", children: [
30674
- /* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30675
- /* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30676
- /* @__PURE__ */ jsx67("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30707
+ /* @__PURE__ */ jsx66("div", { className: "mb-4", children: /* @__PURE__ */ jsx66(MyEditor, { value: body, onChange: setBody }) }),
30708
+ /* @__PURE__ */ jsxs40("div", { className: "flex justify-end gap-2", children: [
30709
+ /* @__PURE__ */ jsx66("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30710
+ /* @__PURE__ */ jsx66("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30711
+ /* @__PURE__ */ jsx66("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30677
30712
  ] })
30678
30713
  ] }) });
30679
30714
  }
@@ -30718,10 +30753,10 @@ function showSonnerToast({
30718
30753
  // src/components/ui/sonner.tsx
30719
30754
  import { useTheme } from "next-themes";
30720
30755
  import { Toaster as Sonner } from "sonner";
30721
- import { jsx as jsx68 } from "react/jsx-runtime";
30756
+ import { jsx as jsx67 } from "react/jsx-runtime";
30722
30757
  var Toaster = ({ ...props }) => {
30723
30758
  const { theme = "system" } = useTheme();
30724
- return /* @__PURE__ */ jsx68(
30759
+ return /* @__PURE__ */ jsx67(
30725
30760
  Sonner,
30726
30761
  {
30727
30762
  theme,
@@ -30756,7 +30791,7 @@ export {
30756
30791
  Image_default as Image,
30757
30792
  Modal,
30758
30793
  MultiCheckbox_default as MultiCheckbox,
30759
- MultiSelect_default as MultiSelect,
30794
+ LazyMultiSelectDropdown as MultiSelect,
30760
30795
  Navbar,
30761
30796
  NumberInput_default as NumberInput,
30762
30797
  Pagination_default as Pagination,