@akshar-technosoft/ui 1.0.18 → 1.0.20
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/components/data/data-table/data-table-toolbar.cjs +1 -1
- package/dist/components/data/data-table/data-table-toolbar.cjs.map +1 -1
- package/dist/components/data/data-table/data-table-toolbar.d.cts +4 -1
- package/dist/components/data/data-table/data-table-toolbar.d.ts +4 -1
- package/dist/components/data/data-table/data-table-toolbar.js +1 -1
- package/dist/components/data/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data/data-table/data-table-types.cjs.map +1 -1
- package/dist/components/data/data-table/data-table-types.d.cts +1 -0
- package/dist/components/data/data-table/data-table-types.d.ts +1 -0
- package/dist/components/data/data-table/data-table.cjs +1 -1
- package/dist/components/data/data-table/data-table.cjs.map +1 -1
- package/dist/components/data/data-table/data-table.js +1 -1
- package/dist/components/data/data-table/data-table.js.map +1 -1
- package/dist/components/data/data-table/index.cjs +1 -1
- package/dist/components/data/data-table/index.cjs.map +1 -1
- package/dist/components/data/data-table/index.js +1 -1
- package/dist/components/data/data-table/index.js.map +1 -1
- package/dist/components/layouts/app-content.cjs +1 -1
- package/dist/components/layouts/app-content.cjs.map +1 -1
- package/dist/components/layouts/app-content.js +1 -1
- package/dist/components/layouts/app-content.js.map +1 -1
- package/dist/components/layouts/factories.cjs +1 -1
- package/dist/components/layouts/factories.cjs.map +1 -1
- package/dist/components/layouts/factories.js +1 -1
- package/dist/components/layouts/factories.js.map +1 -1
- package/dist/components/layouts/index.cjs +1 -1
- package/dist/components/layouts/index.cjs.map +1 -1
- package/dist/components/layouts/index.js +1 -1
- package/dist/components/layouts/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
"use strict";var xn=Object.create;var pt=Object.defineProperty;var Cn=Object.getOwnPropertyDescriptor;var yn=Object.getOwnPropertyNames;var wn=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty;var Pn=(e,t)=>{for(var i in t)pt(e,i,{get:t[i],enumerable:!0})},ro=(e,t,i,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let b of yn(t))!Nn.call(e,b)&&b!==i&&pt(e,b,{get:()=>t[b],enumerable:!(m=Cn(t,b))||m.enumerable});return e};var Ot=(e,t,i)=>(i=e!=null?xn(wn(e)):{},ro(t||!e||!e.__esModule?pt(i,"default",{value:e,enumerable:!0}):i,e)),Dn=e=>ro(pt({},"__esModule",{value:!0}),e);var Fn={};Pn(Fn,{DataTable:()=>Bo,DataTableActionBar:()=>Eo,DataTableActionBarAction:()=>Go,DataTableActionBarSelection:()=>jo,DataTableColumnHeader:()=>Uo,DataTableFacetedFilter:()=>Ko,DataTablePagination:()=>Nt,DataTableToolbar:()=>wt,DataTableViewOptions:()=>$o});module.exports=Dn(Fn);var q=require("@tanstack/react-table"),R=require("lucide-react");var lo=require("radix-ui"),co=require("class-variance-authority");var io=require("clsx"),so=require("tailwind-merge");function n(...e){return(0,so.twMerge)((0,io.clsx)(e))}var mo=require("react/jsx-runtime"),gt=(0,co.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function C({className:e,variant:t,size:i,asChild:m=!1,...b}){let u=m?lo.Slot.Slot:"button";return(0,mo.jsx)(u,{"data-slot":"button",className:n(gt({variant:t,size:i,className:e}),"transition-none"),...b})}var pe=require("react/jsx-runtime");function Et({className:e,...t}){return(0,pe.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,pe.jsx)("table",{"data-slot":"table",className:n("w-full caption-bottom text-sm",e),...t})})}function uo({className:e,...t}){return(0,pe.jsx)("thead",{"data-slot":"table-header",className:n("[&_tr]:border-b",e),...t})}function po({className:e,...t}){return(0,pe.jsx)("tbody",{"data-slot":"table-body",className:n("[&_tr:last-child]:border-0",e),...t})}function Gt({className:e,...t}){return(0,pe.jsx)("tfoot",{"data-slot":"table-footer",className:n("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ge({className:e,...t}){return(0,pe.jsx)("tr",{"data-slot":"table-row",className:n("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function go({className:e,...t}){return(0,pe.jsx)("th",{"data-slot":"table-head",className:n("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function fe({className:e,...t}){return(0,pe.jsx)("td",{"data-slot":"table-cell",className:n("p-2 align-middle whitespace-nowrap",e),...t})}var $t=require("react/jsx-runtime");function jt({className:e,...t}){return(0,$t.jsx)("div",{"data-slot":"card",className:n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ut({className:e,...t}){return(0,$t.jsx)("div",{"data-slot":"card-content",className:n("px-6",e),...t})}var Se=require("radix-ui");var be=require("react/jsx-runtime");function Xe({delayDuration:e=0,...t}){return(0,be.jsx)(Se.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qt({...e}){return(0,be.jsx)(Xe,{children:(0,be.jsx)(Se.Tooltip.Root,{"data-slot":"tooltip",...e})})}function Wt({...e}){return(0,be.jsx)(Se.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function Xt({className:e,sideOffset:t=0,children:i,...m}){return(0,be.jsx)(Se.Tooltip.Portal,{children:(0,be.jsxs)(Se.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:n("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...m,children:[i,(0,be.jsx)(Se.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var D=require("lucide-react");var fo=require("react/jsx-runtime");function Kt({className:e,type:t,...i}){return(0,fo.jsx)("input",{type:t,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...i})}var we=require("cmdk"),vo=require("lucide-react");var Tn=require("radix-ui"),Sn=require("lucide-react");var bo=require("react/jsx-runtime");var ne=require("react/jsx-runtime");function ft({className:e,...t}){return(0,ne.jsx)(we.Command,{"data-slot":"command",className:n("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function bt({className:e,...t}){return(0,ne.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,ne.jsx)(vo.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,ne.jsx)(we.Command.Input,{"data-slot":"command-input",className:n("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",e),...t})]})}function vt({className:e,...t}){return(0,ne.jsx)(we.Command.List,{"data-slot":"command-list",className:n("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ht({...e}){return(0,ne.jsx)(we.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Ke({className:e,...t}){return(0,ne.jsx)(we.Command.Group,{"data-slot":"command-group",className:n("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",e),...t})}function ho({className:e,...t}){return(0,ne.jsx)(we.Command.Separator,{"data-slot":"command-separator",className:n("bg-border -mx-1 h-px",e),...t})}function Me({className:e,...t}){return(0,ne.jsx)(we.Command.Item,{"data-slot":"command-item",className:n("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",e),...t})}var U=require("radix-ui"),Je=require("lucide-react");var B=require("react/jsx-runtime");function de({...e}){return(0,B.jsx)(U.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function ce({...e}){return(0,B.jsx)(U.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function me({className:e,sideOffset:t=4,...i}){return(0,B.jsx)(U.DropdownMenu.Portal,{children:(0,B.jsx)(U.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...i})})}function Jt({...e}){return(0,B.jsx)(U.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function E({className:e,inset:t,variant:i="default",...m}){return(0,B.jsx)(U.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":i,className:n("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m})}function Ie({className:e,children:t,checked:i,...m}){return(0,B.jsxs)(U.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:i,...m,children:[(0,B.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,B.jsx)(U.DropdownMenu.ItemIndicator,{children:(0,B.jsx)(Je.CheckIcon,{className:"size-4"})})}),t]})}function J({className:e,inset:t,...i}){return(0,B.jsx)(U.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...i})}function Z({className:e,...t}){return(0,B.jsx)(U.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",e),...t})}function xo({...e}){return(0,B.jsx)(U.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function Co({className:e,inset:t,children:i,...m}){return(0,B.jsxs)(U.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:n("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...m,children:[i,(0,B.jsx)(Je.ChevronRightIcon,{className:"ml-auto size-4"})]})}function yo({className:e,...t}){return(0,B.jsx)(U.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var yt=require("react");var He=require("react"),No=require("lucide-react"),Be=require("date-fns");var Qe=require("radix-ui");var Ye=require("react/jsx-runtime");function Fe({...e}){return(0,Ye.jsx)(Qe.Popover.Root,{"data-slot":"popover",...e})}function _e({...e}){return(0,Ye.jsx)(Qe.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function Ve({className:e,align:t="center",sideOffset:i=4,...m}){return(0,Ye.jsx)(Qe.Popover.Portal,{children:(0,Ye.jsx)(Qe.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:i,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...m})})}var xt=Ot(require("react"),1),Ae=require("lucide-react"),Ze=require("react-day-picker");var ve=require("react/jsx-runtime");function wo({className:e,classNames:t,showOutsideDays:i=!0,captionLayout:m="label",buttonVariant:b="ghost",formatters:u,components:F,...H}){let v=(0,Ze.getDefaultClassNames)();return(0,ve.jsx)(Ze.DayPicker,{showOutsideDays:i,className:n("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:m,formatters:{formatMonthDropdown:T=>T.toLocaleString("default",{month:"short"}),...u},classNames:{root:n("w-fit",v.root),months:n("flex gap-4 flex-col md:flex-row relative",v.months),month:n("flex flex-col w-full gap-4",v.month),nav:n("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",v.nav),button_previous:n(gt({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_previous),button_next:n(gt({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_next),month_caption:n("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",v.month_caption),dropdowns:n("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",v.dropdowns),dropdown_root:n("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",v.dropdown_root),dropdown:n("absolute bg-popover inset-0 opacity-0",v.dropdown),caption_label:n("select-none font-medium",m==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",v.caption_label),table:"w-full border-collapse",weekdays:n("flex",v.weekdays),weekday:n("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",v.weekday),week:n("flex w-full mt-2",v.week),week_number_header:n("select-none w-(--cell-size)",v.week_number_header),week_number:n("text-[0.8rem] select-none text-muted-foreground",v.week_number),day:n("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",v.day),range_start:n("rounded-l-md bg-accent",v.range_start),range_middle:n("rounded-none",v.range_middle),range_end:n("rounded-r-md bg-accent",v.range_end),today:n("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",v.today),outside:n("text-muted-foreground aria-selected:text-muted-foreground",v.outside),disabled:n("text-muted-foreground opacity-50",v.disabled),hidden:n("invisible",v.hidden),...t},components:{Root:({className:T,rootRef:_,...j})=>(0,ve.jsx)("div",{"data-slot":"calendar",ref:_,className:n(T),...j}),Chevron:({className:T,orientation:_,...j})=>_==="left"?(0,ve.jsx)(Ae.ChevronLeftIcon,{className:n("size-4",T),...j}):_==="right"?(0,ve.jsx)(Ae.ChevronRightIcon,{className:n("size-4",T),...j}):(0,ve.jsx)(Ae.ChevronDownIcon,{className:n("size-4",T),...j}),DayButton:kn,WeekNumber:({children:T,..._})=>(0,ve.jsx)("td",{..._,children:(0,ve.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:T})}),...F},...H})}function kn({className:e,day:t,modifiers:i,...m}){let b=(0,Ze.getDefaultClassNames)(),u=xt.useRef(null);return xt.useEffect(()=>{i.focused&&u.current?.focus()},[i.focused]),(0,ve.jsx)(C,{ref:u,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:n("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",b.day,e),...m})}var $=require("react/jsx-runtime");function Po({value:e,onChange:t,placeholder:i,mode:m,externalSearch:b,onExternalChange:u,onlyExternal:F=!1}){let[H,v]=(0,He.useState)(!1),[T,_]=(0,He.useState)(e),[j,ee]=(0,He.useState)(e);(0,He.useEffect)(()=>{F||ee(e)},[e,F]);let he=()=>{F||t(T),ee(T),b&&u&&u(T),v(!1)},re=()=>{_(j),v(!1)},Y=()=>{let y=m==="single"?null:{from:null,to:null};_(y),F||t(y),ee(y),b&&u&&u(y),v(!1)},W=()=>{let y=F?j:e;return y?m==="single"?(0,Be.format)(y,"PPP"):y.from&&y.to?`${(0,Be.format)(y.from,"MMM dd")} - ${(0,Be.format)(y.to,"MMM dd, yyyy")}`:y.from?`From ${(0,Be.format)(y.from,"MMM dd, yyyy")}`:y.to?`To ${(0,Be.format)(y.to,"MMM dd, yyyy")}`:i:i},te=y=>{_(m==="single"?y:y||{from:null,to:null})};return(0,$.jsxs)(Fe,{open:H,onOpenChange:v,children:[(0,$.jsx)(_e,{className:"h-8",asChild:!0,children:(0,$.jsxs)(C,{variant:"outline",className:n("w-full justify-start text-left font-normal h-9",!W()&&"text-muted-foreground"),children:[(0,$.jsx)(No.Calendar,{className:"mr-2 h-4 w-4"}),W()]})}),(0,$.jsxs)(Ve,{className:"w-auto p-0",align:"start",children:[(0,$.jsx)("div",{className:"p-3",children:(0,$.jsx)(wo,{mode:m,selected:T,onSelect:te,numberOfMonths:m==="range"?2:1,className:"rounded-md border",...m==="range"&&{required:!0}})}),(0,$.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,$.jsx)(C,{variant:"ghost",size:"sm",onClick:Y,children:"Clear"}),(0,$.jsxs)("div",{className:"flex gap-2",children:[(0,$.jsx)(C,{variant:"outline",size:"sm",onClick:re,children:"Cancel"}),(0,$.jsx)(C,{size:"sm",onClick:he,disabled:m==="range"&&(!T?.from||!T?.to),children:"Apply"})]})]})]})]})}var Qt=require("radix-ui"),Do=require("lucide-react");var Ct=require("react/jsx-runtime");function et({className:e,...t}){return(0,Ct.jsx)(Qt.Checkbox.Root,{"data-slot":"checkbox",className:n("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,Ct.jsx)(Qt.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,Ct.jsx)(Do.CheckIcon,{className:"size-3.5"})})})}var a=require("react/jsx-runtime"),To=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function wt({table:e,filters:t=[],globalFilter:i,onGlobalFilterChange:m,enableGlobalFilter:b=!0,onExport:u,onRefresh:F,loading:H=!1,enableColumnVisibility:v=!0,data:T,onClearSorting:_,onClearFilters:j,enableColumnPinning:ee=!1,onExternalSearch:he,onCustomFilterChange:re,aggregations:Y={},onAggregationChange:W}){let[te,y]=(0,yt.useState)({}),[Le,ie]=(0,yt.useState)({}),[tt,ot]=(0,yt.useState)({}),Oe=()=>e.getAllLeafColumns().filter(o=>o.getCanHide?.()!==!1),Ee=()=>e.getAllColumns().filter(o=>!e.getAllLeafColumns().includes(o)&&o.columns?.length&&o.columns.some(c=>c.getCanHide?.()!==!1)),nt=()=>{let o=new Set(Ee().flatMap(c=>c.columns?.filter(p=>p.getCanHide?.()!==!1).map(p=>p.id)||[]));return Oe().filter(c=>!o.has(c.id))},Re=(o,c)=>c&&o.startsWith(`${c}.`)?o.replace(`${c}.`,"").split("_").map(M=>M.slice(1)).join(" "):o.split("_").map(p=>p.charAt(0).toUpperCase()+p.slice(1)).join(" "),Ge=(o,c)=>{let p={...te,[o]:c};y(p)},zt=(o,c)=>{let p={...Le,[o]:c};ie(p),re&&re(o,c),t.find(M=>M.key===o)?.externalSearch&&Ge(o,c)},at=()=>{he&&he(te)},Mt=()=>{y({}),ie({}),j(),he&&he({}),re&&Object.keys(Le).forEach(o=>{re(o,"")})},se=o=>t.find(p=>p.key===o)?.customFilter?Le[o]??"":e.getColumn(o)?.getFilterValue(),xe=(o,c)=>{let p=t.find(M=>M.key===o);p?.customFilter?zt(o,c):(e.getColumn(o)?.setFilterValue(c),p?.externalSearch&&Ge(o,c))},je=(o,c)=>{ot(p=>({...p,[o]:c}))},It=o=>{if(W){let c=Y[o],p={enabled:!c?.enabled,functions:c?.functions||["sum","average"]};W(o,p)}},Ue=(o,c)=>{if(W){let M=Y[o]?.functions||[],X=M.includes(c)?M.filter(st=>st!==c):[...M,c];W(o,{enabled:X.length>0,functions:X})}},rt=()=>{W&&Object.keys(Y).forEach(o=>{let c=Y[o];c&&W(o,{...c,enabled:!1,functions:[]})})},$e=Oe().filter(o=>o.id==="select"||o.id==="serialNumber"?!1:o.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(M=>{let X=M.getValue(o.id);return typeof X=="number"||typeof X=="string"&&!isNaN(parseFloat(String(X)))||typeof X=="object"&&X!==null&&"props"in X})),ue=Object.values(Y).some(o=>o?.enabled);return(0,a.jsx)("div",{className:"rounded-xl",children:(0,a.jsx)("div",{className:"px-2",children:(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,a.jsx)(D.Filter,{className:"size-4"})}),t.map(o=>!e.getColumn(o.key)&&!o.customFilter&&!o.externalSearch?null:(0,a.jsx)("div",{className:n("relative min-w-[150px]",o.width),children:o.type==="select"?(0,a.jsxs)(Fe,{open:tt[o.key],onOpenChange:p=>je(o.key,p),children:[(0,a.jsx)(_e,{asChild:!0,children:(0,a.jsxs)("div",{className:"relative w-full",children:[o.icon&&(0,a.jsx)(o.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground pointer-events-none z-10"}),(0,a.jsxs)(C,{variant:"outline",role:"combobox","aria-expanded":tt[o.key],className:n("h-8 sm:h-8 rounded-lg w-full justify-between font-normal",!se(o.key)&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:n("truncate",o.icon&&"pl-6"),children:se(o.key)?o.options?.find(p=>p.value===se(o.key))?.label:o.placeholder}),(0,a.jsx)(D.ChevronDown,{className:"ml-2 opacity-50 size-4 shrink-0"})]})]})}),(0,a.jsx)(Ve,{className:"w-[--radix-popover-trigger-width] p-0 rounded-lg",children:(0,a.jsxs)(ft,{className:"rounded-lg",children:[(0,a.jsx)(bt,{placeholder:`Search ${o.placeholder?.toLowerCase()}...`}),(0,a.jsxs)(vt,{children:[(0,a.jsx)(ht,{children:"No option found."}),(0,a.jsxs)(Ke,{children:[(0,a.jsxs)(Me,{value:"all",onSelect:()=>{xe(o.key,""),je(o.key,!1)},className:"flex items-center cursor-pointer",children:[(0,a.jsx)(D.Check,{className:n("mr-2 size-4 shrink-0",se(o.key)?"opacity-0":"opacity-100")}),(0,a.jsx)("span",{children:"All"})]}),o.options?.map(p=>(0,a.jsxs)(Me,{value:p.label,onSelect:()=>{xe(o.key,p.value),je(o.key,!1)},className:"flex items-center cursor-pointer",children:[(0,a.jsx)(D.Check,{className:n("mr-2 size-4 shrink-0",se(o.key)===p.value?"opacity-100":"opacity-0")}),(0,a.jsx)("span",{children:p.label})]},p.label))]})]})]})})]}):o.type==="date"?(0,a.jsx)(Po,{value:se(o.key),onChange:p=>{o.onlyExternal||xe(o.key,p)},placeholder:o.placeholder,mode:o.dateMode||"single",externalSearch:o.externalSearch,onlyExternal:o.onlyExternal,onExternalChange:p=>Ge(o.key,p)}):(0,a.jsxs)("div",{className:"relative",children:[o.icon&&(0,a.jsx)(o.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,a.jsx)(Kt,{placeholder:o.placeholder,value:se(o.key)??"",onChange:p=>{xe(o.key,p.target.value)},className:n("h-8 rounded-lg",o.icon&&"pl-9"),type:o.type==="number"?"number":"text"})]})},o.key)),(t.some(o=>o.externalSearch)||t.some(o=>o.customFilter))&&(0,a.jsxs)(C,{variant:"default",size:"sm",onClick:at,className:"rounded-lg h-7",children:[(0,a.jsx)(D.Search,{className:"size-4"}),t.find(o=>o.externalSearch||o.customFilter)?.searchButtonText||"Search"]})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(D.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,a.jsx)(Kt,{placeholder:"Global search...",value:i??"",onChange:o=>m(o.target.value),className:"pl-9 h-8 max-w-max"})]}),$e.length>0&&W&&(0,a.jsxs)(de,{children:[(0,a.jsx)(ce,{asChild:!0,children:(0,a.jsxs)(C,{variant:"outline",size:"sm",className:n("rounded-lg gap-1",ue&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[(0,a.jsx)(D.Calculator,{className:"size-4"}),(0,a.jsx)("span",{children:"Aggregations"}),(0,a.jsx)(D.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,a.jsxs)(me,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,a.jsxs)(J,{className:"flex items-center justify-between px-4 py-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),ue&&(0,a.jsx)(C,{variant:"ghost",size:"sm",onClick:rt,className:"h-6 px-2 text-xs",children:"Clear All"})]}),(0,a.jsx)(Z,{}),$e.map(o=>{let c=Y[o.id],p=c?.enabled;return(0,a.jsxs)(xo,{children:[(0,a.jsx)(Co,{className:"text-sm",children:(0,a.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,a.jsx)(et,{checked:p,onCheckedChange:()=>It(o.id),className:"data-[state=checked]:bg-primary"}),(0,a.jsx)("span",{className:n("flex-1",p&&"font-medium text-primary"),children:Re(o.id)}),p&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[c?.functions?.slice(0,2).map(M=>(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:To.find(X=>X.value===M)?.label},M)),c?.functions&&c.functions.length>2&&(0,a.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",c.functions.length-2]})]})]})}),(0,a.jsxs)(yo,{className:"w-48 rounded-lg",children:[(0,a.jsx)(J,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),To.map(M=>(0,a.jsx)(Ie,{checked:c?.functions?.includes(M.value)||!1,onCheckedChange:()=>Ue(o.id,M.value),className:"py-2 text-sm",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{children:M.label}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:M.description})]})},M.value))]})]},o.id)}),$e.length===0&&(0,a.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,a.jsx)(D.Calculator,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),u&&(0,a.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>u(T),className:"rounded-lg",children:[(0,a.jsx)(D.Download,{className:"size-4"}),"Export"]}),v&&(0,a.jsxs)(de,{children:[(0,a.jsx)(ce,{asChild:!0,className:"h-7",children:(0,a.jsxs)(C,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,a.jsx)("span",{children:"Columns"}),(0,a.jsx)(D.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,a.jsxs)(me,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,a.jsx)(J,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,a.jsx)(Z,{}),nt().length>0&&(0,a.jsxs)(Jt,{children:[(0,a.jsx)(J,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),nt().map(o=>(0,a.jsx)(Ie,{className:"text-sm",checked:o.getIsVisible(),onCheckedChange:c=>o.toggleVisibility(!!c),children:Re(o.id)},o.id))]}),Ee().map(o=>(0,a.jsxs)(Jt,{children:[(0,a.jsx)(Z,{}),(0,a.jsx)(J,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:o.id}),o.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>(0,a.jsx)(Ie,{className:"text-sm",checked:c.getIsVisible(),onCheckedChange:p=>c.toggleVisibility(!!p),children:Re(c.id,o.id)},c.id))]},o.id))]})]}),(0,a.jsxs)(de,{children:[(0,a.jsx)(ce,{asChild:!0,className:"h-7",children:(0,a.jsx)(C,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:(0,a.jsx)(D.Settings2,{className:"size-4"})})}),(0,a.jsxs)(me,{align:"end",className:"w-[200px] rounded-lg",children:[(0,a.jsx)(J,{children:"Table Settings"}),(0,a.jsx)(Z,{}),(0,a.jsxs)(E,{onClick:_,children:[(0,a.jsx)(D.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,a.jsxs)(E,{onClick:Mt,children:[(0,a.jsx)(D.Filter,{className:"size-4"}),"Clear All Filters"]}),ue&&(0,a.jsxs)(E,{onClick:rt,children:[(0,a.jsx)(D.Calculator,{className:"size-4"}),"Clear Aggregations"]}),ee&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Z,{}),(0,a.jsx)(J,{children:"Column Pinning"}),(0,a.jsxs)(E,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,a.jsx)(D.PinOff,{className:"size-4"}),"Reset All Pinning"]}),(0,a.jsxs)(E,{onClick:()=>{let o=Oe().filter(c=>c.getCanPin?.()!==!1).map(c=>c.id);e.setColumnPinning({left:[],right:o})},children:[(0,a.jsx)(D.Pin,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),F&&(0,a.jsx)(C,{variant:"outline",size:"sm",onClick:F,disabled:H,className:"rounded-lg",children:(0,a.jsx)(D.RefreshCw,{className:n("h-4 w-4",H&&"animate-spin")})})]})]})})})})}var Q=require("radix-ui"),ke=require("lucide-react");var I=require("react/jsx-runtime");function So({...e}){return(0,I.jsx)(Q.Select.Root,{"data-slot":"select",...e})}function ko({...e}){return(0,I.jsx)(Q.Select.Value,{"data-slot":"select-value",...e})}function Ro({className:e,size:t="default",children:i,...m}){return(0,I.jsxs)(Q.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:n("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m,children:[i,(0,I.jsx)(Q.Select.Icon,{asChild:!0,children:(0,I.jsx)(ke.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function zo({className:e,children:t,position:i="popper",...m}){return(0,I.jsx)(Q.Select.Portal,{children:(0,I.jsxs)(Q.Select.Content,{"data-slot":"select-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,...m,children:[(0,I.jsx)(Rn,{}),(0,I.jsx)(Q.Select.Viewport,{className:n("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,I.jsx)(zn,{})]})})}function Mo({className:e,children:t,...i}){return(0,I.jsxs)(Q.Select.Item,{"data-slot":"select-item",className:n("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...i,children:[(0,I.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,I.jsx)(Q.Select.ItemIndicator,{children:(0,I.jsx)(ke.CheckIcon,{className:"size-4"})})}),(0,I.jsx)(Q.Select.ItemText,{children:t})]})}function Rn({className:e,...t}){return(0,I.jsx)(Q.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:n("flex cursor-default items-center justify-center py-1",e),...t,children:(0,I.jsx)(ke.ChevronUpIcon,{className:"size-4"})})}function zn({className:e,...t}){return(0,I.jsx)(Q.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:n("flex cursor-default items-center justify-center py-1",e),...t,children:(0,I.jsx)(ke.ChevronDownIcon,{className:"size-4"})})}var k=require("react/jsx-runtime");function Nt({table:e,config:t}){return t.enabled?(0,k.jsx)("div",{className:"rounded-xl",children:(0,k.jsx)("div",{children:(0,k.jsxs)("div",{className:"flex items-center justify-between",children:[(0,k.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,k.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,k.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,k.jsxs)(So,{value:`${e.getState().pagination.pageSize}`,onValueChange:i=>e.setPageSize(Number(i)),children:[(0,k.jsx)(Ro,{className:"h-9 w-[70px] rounded-lg",children:(0,k.jsx)(ko,{})}),(0,k.jsx)(zo,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(i=>(0,k.jsx)(Mo,{value:`${i}`,children:i},i))})]})]}),(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,k.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,k.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(i,m)=>{let b=e.getState().pagination.pageIndex,u=b+m;return u<1||u>e.getPageCount()?null:(0,k.jsx)(C,{variant:u===b+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(u-1),children:u},u)})}),(0,k.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,k.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var Io=require("radix-ui"),Fo=require("class-variance-authority");var Vo=require("react/jsx-runtime"),Mn=(0,Fo.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function _o({className:e,variant:t,size:i,noBg:m,...b}){return(0,Vo.jsx)(Io.Toggle.Root,{"data-slot":"toggle",className:n(Mn({className:e,variant:t,size:i,bg:m?"disabled":"enabled"})),...b})}var x=require("react"),r=require("react/jsx-runtime"),Ao={sum:e=>e.reduce((t,i)=>t+i,0),average:e=>e.length>0?e.reduce((t,i)=>t+i,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((m,b)=>m-b),i=Math.floor(t.length/2);return t.length%2===0?(t[i-1]+t[i])/2:t[i]}};function Bo({data:e,columns:t,filters:i=[],pagination:m={enabled:!1},settings:b={},header:u,footer:F,className:H="",maxHeight:v="100%",loading:T=!1,error:_,emptyMessage:j="No data available",onRowSelectionChange:ee,onExport:he,onRefresh:re,onTableReady:Y,children:W,isRowDisabled:te,isRowSelectable:y,onExternalSearch:Le,aggregations:ie={},onAggregationChange:tt,rowClassName:ot}){let[Oe,Ee]=(0,x.useState)([]),[nt,Re]=(0,x.useState)([]),[Ge,zt]=(0,x.useState)({}),[at,Mt]=(0,x.useState)({}),[se,xe]=(0,x.useState)(""),[je,It]=(0,x.useState)([]),[Ue,rt]=(0,x.useState)(b.enableColumnPinning?{left:[],right:[]}:{}),[it,$e]=(0,x.useState)({}),ue=(0,x.useRef)(null),o=(0,x.useRef)(null),c=(0,x.useRef)(null),p=(0,x.useRef)(null),[M,X]=(0,x.useState)(0),[st,Jo]=(0,x.useState)(0),[Qo,Yo]=(0,x.useState)(0),[Yt,Zo]=(0,x.useState)(0),lt=(0,x.useRef)(null),[Ft,en]=(0,x.useState)(!1),{enableSorting:_t=!0,enableFiltering:Vt=!0,enableGlobalFilter:Zt=!0,enableColumnVisibility:At=!0,enableRowSelection:K=!0,stickyHeader:_n=!0,toolbar:qe=!1,disableHeaderCheckbox:tn=!1,toolbarPosition:De="default",showSerialNumbers:le=!0,fixedCheckboxColumn:dt=!0,striped:on=!0,hoverable:nn=!0,compact:We=!0,bordered:eo=!0,fullHeight:an=!1,enableColumnResizing:to=!1,enableColumnPinning:G=!0,hideHeader:rn=!1,selectionMode:Ce="multiple",showCheckBox:sn=!0,checkboxColumnPosition:oo=0}=b;(0,x.useEffect)(()=>{let d=()=>{lt.current&&en(lt.current.scrollTop>0)},g=lt.current;if(g)return g.addEventListener("scroll",d),()=>g.removeEventListener("scroll",d)},[]),(0,x.useEffect)(()=>{let d=()=>{ue.current&&X(ue.current.offsetHeight+16),o.current&&Jo(o.current.offsetHeight+16),c.current&&Yo(c.current.offsetHeight+16),p.current&&Zo(p.current.offsetHeight+16)};d();let g=new ResizeObserver(()=>{setTimeout(d,50)});return ue.current&&g.observe(ue.current),o.current&&g.observe(o.current),c.current&&g.observe(c.current),p.current&&g.observe(p.current),()=>{g.disconnect()}},[qe,u,De]);let ln=(d,g)=>g.split(".").reduce((l,s)=>l&&l[s],d),Bt=(0,x.useMemo)(()=>Object.keys(it).length===0?e:e.filter(d=>Object.entries(it).every(([g,l])=>{if(!l||l==="")return!0;let s=ln(d,g);return typeof l=="string"?String(s).toLowerCase().includes(l.toLowerCase()):s===l})),[e,it]),dn=(0,x.useCallback)((d,g)=>{$e(l=>{let s={...l};return g===""||g===null||g===void 0?delete s[d]:s[d]=g,s})},[]),ze=(0,x.useMemo)(()=>{let d=[...t],g=f=>f.map(h=>{if(h.id==="select"||h.id==="serialNumber")return h;let P={...h,enablePinning:!0};return h.columns&&(P.columns=g(h.columns)),P}),l=g(d),s={id:"select",header:({table:f})=>{if(Ce==="single")return null;let h=f.getRowModel().rows.filter(V=>!te?.(V.original)&&(y?y(V.original):!0)),P=h.length>0&&h.every(V=>V.getIsSelected()),S=h.some(V=>V.getIsSelected());return(0,r.jsx)(et,{checked:P||S&&"indeterminate",onCheckedChange:V=>{h.forEach(L=>L.toggleSelected(!!V))},disabled:tn||h.length===0,"aria-label":"Select all selectable rows"})},cell:({row:f})=>{let h=te?te(f.original):!1,P=y?y(f.original):!0;return(0,r.jsx)("div",{className:n("flex items-center justify-center",h&&"opacity-50"),children:Ce==="multiple"?(0,r.jsx)(et,{checked:f.getIsSelected(),onCheckedChange:S=>P&&f.toggleSelected(!!S),"aria-label":"Select row",disabled:h||!P}):sn?(0,r.jsx)("input",{type:"radio",checked:f.getIsSelected(),onChange:()=>P&&f.toggleSelected(!0),disabled:h||!P,className:"w-4 h-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:Ce==="multiple"?40:30};if(K){let f=oo;f<0&&(f=l.length+f+1),f=Math.max(0,Math.min(f,l.length)),l.splice(f,0,s)}if(le){let f={id:"serialNumber",header:"No.",cell:({row:h})=>(0,r.jsx)("div",{className:"font-medium text-center text-muted-foreground",children:h.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};l.unshift(f)}return l},[t,le,K,dt,te,y,Ce,oo]),w=(0,q.useReactTable)({data:Bt,columns:ze,onSortingChange:_t?Ee:void 0,onColumnFiltersChange:Vt?Re:void 0,onGlobalFilterChange:Zt?xe:void 0,getCoreRowModel:(0,q.getCoreRowModel)(),getPaginationRowModel:m.enabled?(0,q.getPaginationRowModel)():void 0,getSortedRowModel:_t?(0,q.getSortedRowModel)():void 0,getFilteredRowModel:Vt?(0,q.getFilteredRowModel)():void 0,onColumnVisibilityChange:At?zt:void 0,onRowSelectionChange:K?Mt:void 0,onColumnOrderChange:It,onColumnPinningChange:G?rt:void 0,state:{sorting:_t?Oe:void 0,columnFilters:Vt?nt:void 0,columnVisibility:At?Ge:void 0,rowSelection:K?at:{},globalFilter:se,columnOrder:je,columnPinning:G?Ue:{}},initialState:{pagination:m.enabled?{pageSize:m.pageSize||10}:void 0,columnPinning:G?{left:[...le?["serialNumber"]:[],...K?["select"]:[]],right:[]}:void 0},enableRowSelection:K,enableColumnResizing:to,enableColumnPinning:G,columnResizeMode:"onChange"}),no=(0,x.useMemo)(()=>{if(!ie||Object.keys(ie).length===0)return{};let d={},g=w.getFilteredRowModel().rows;return Object.entries(ie).forEach(([l,s])=>{if(!s?.enabled)return;let f=g.map(P=>{if(s.accessor)return s.accessor(P.original);{let S=P.getValue(l);return typeof S=="number"?S:parseFloat(String(S))||0}}).filter(P=>P!==null&&!isNaN(P)),h={};s.functions?.forEach(P=>{Ao[P]&&(h[P]=Ao[P](f))}),Object.keys(h).length>0&&(d[l]=h)}),d},[Bt,ie,w?.getFilteredRowModel().rows]);(0,x.useEffect)(()=>{if(K&&ee){let d=w.getFilteredSelectedRowModel().rows.filter(g=>!te?.(g.original)&&(y?y(g.original):!0)).map(g=>g.original);ee(d)}},[at,K,ee,w,te,y]);let cn=(0,x.useCallback)(d=>{Ce==="single"?(w.resetRowSelection(),d.toggleSelected(!0)):d.toggleSelected()},[Ce,w]);(0,x.useEffect)(()=>{Y&&Y(w)},[w,Y]);let mn=(0,x.useCallback)(()=>{Ee([])},[]),un=(0,x.useCallback)(()=>{Re([]),xe("")},[]),ao=(d,g)=>{if(!G)return;let l=[...le?["serialNumber"]:[],...K&&dt?["select"]:[]],s={left:[...(Ue.left??[]).filter(f=>l.includes(f))],right:[...Ue.right??[]]};g===!1?(s.left=s.left.filter(f=>f!==d),s.right=s.right.filter(f=>f!==d)):g==="right"?(s.left=s.left.filter(f=>f!==d),s.right.includes(d)||s.right.push(d)):g==="left"&&(s.right=s.right.filter(f=>f!==d),!s.left.includes(d)&&!l.includes(d)&&s.left.push(d)),w.setColumnPinning(s)},pn=()=>{let d=Object.keys(no).length>0,g=w.getHeaderGroups()[0]?.headers.some(s=>s.column.columnDef.customFooter),l=le&&w.getFilteredRowModel().rows.length>0&&(d||g);return!d&&!g&&!l?null:(0,r.jsx)(Gt,{className:"sticky bottom-0 border-t bg-sidebar z-20",children:(0,r.jsx)(ge,{className:"hover:bg-transparent bg-sidebar",children:w.getHeaderGroups()[0]?.headers.map((s,f)=>{let h=s.column.id,P=no[h],S=G&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&K),V=G&&s.column.getIsPinned()==="right",L=s.column.id==="serialNumber",ye=s.column.id==="select",O=s.column.columnDef.customFooter;return P||O||L&&l?(0,r.jsx)(fe,{className:n("font-semibold text-sm py-2 px-2 border-r",We&&"py-1",S&&"sticky left-0 z-30 bg-sidebar/95",V&&"sticky right-0 z-30 bg-sidebar/95",(L||ye)&&"sticky left-0 z-30 bg-sidebar/95",O?.className),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...S&&{left:L?0:ye?le&&w.getColumn("serialNumber")?.getSize()||0:ct(s.column)},...V&&{right:mt(s.column)},...L&&{left:0}},children:(()=>{if(O?.content){let Te=typeof O.content=="function"?O.content(w):O.content;return(0,r.jsx)("div",{className:n("w-full h-full",O.align==="center"&&"text-center",O.align==="right"&&"text-right",O.align==="left"&&"text-left"),children:Te})}return P?(0,r.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(P).map(([Te,hn])=>(0,r.jsxs)("div",{className:"flex items-center justify-between text-muted-foreground",children:[(0,r.jsxs)("span",{className:"text-xs capitalize",children:[Te,":"]}),(0,r.jsx)("span",{className:"font-medium text-foreground",children:gn(Te,hn)})]},Te))}):L&&l?(0,r.jsxs)("div",{className:"text-xs text-center text-muted-foreground",children:["Total: ",w.getFilteredRowModel().rows.length]}):null})()},`agg-${s.id}`):(0,r.jsx)(fe,{className:n("py-0 px-0 border-r",We&&"py-0",S&&"sticky left-0 z-30 bg-sidebar/95",V&&"sticky right-0 z-30 bg-sidebar/95",(L||ye)&&"sticky left-0 z-30 bg-sidebar/95"),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...S&&{left:L?0:ye?le&&w.getColumn("serialNumber")?.getSize()||0:ct(s.column)},...V&&{right:mt(s.column)},...L&&{left:0}}},`agg-${s.id}`)})})})},gn=(d,g)=>typeof g=="number"?d==="count"||d==="unique"?g.toLocaleString():g.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):g,fn=()=>w.getHeaderGroups().map((d,g)=>(0,r.jsx)(ge,{className:"hover:bg-transparent",children:d.headers.map((l,s)=>{let f=l.depth===0&&l.colSpan>1,h=G&&(l.column.getIsPinned()==="left"||l.column.id==="serialNumber"||l.column.id==="select"&&K),P=G&&l.column.getIsPinned()==="right",S=l.column.getCanSort(),V=G&&l.column.columnDef.enablePinning!==!1,L=l.column.id==="serialNumber",ye=l.column.id==="select",Lt=L||ye&&dt,O=l.column.columnDef.headerAlign||"left",ut=ie&&ie[l.column.id]?.enabled,Te={left:"justify-start",center:"justify-center",right:"justify-end"}[O];return(0,r.jsxs)(go,{colSpan:l.colSpan,className:n("font-semibold text-foreground bg-sidebar group px-0",!We&&"py-2",eo&&s<d.headers.length-1&&"border-r","relative",h&&"sticky left-0 z-25 bg-sidebar",P&&"sticky right-0 z-25 bg-sidebar",(L||ye)&&"sticky left-0 z-25 bg-sidebar",f?"text-center":"text-left",ut&&"border-b-2 border-primary/30"),style:{width:l.getSize()!==150?l.getSize():"auto",minWidth:l.getSize()!==150?l.getSize():"auto",...h&&{left:L?0:ye?le&&w.getColumn("serialNumber")?.getSize()||0:ct(l.column)},...P&&{right:mt(l.column)},...L&&{left:0}},children:[f?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,q.flexRender)(l.column.columnDef.header,l.getContext()),ut&&(0,r.jsx)(R.Calculator,{className:"w-3 h-3 ml-1 text-primary"})]}):(0,r.jsxs)("div",{className:n("relative flex items-center w-full px-2",Te),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[ut&&(0,r.jsx)(R.Calculator,{className:"w-3 h-3 mr-1 text-primary"}),S&&O==="right"&&(0,r.jsx)("span",{className:"order-2 ml-1",children:l.column.getIsSorted()&&{asc:(0,r.jsx)(R.ChevronUp,{className:"w-4 h-4"}),desc:(0,r.jsx)(R.ChevronDown,{className:"w-4 h-4"})}[l.column.getIsSorted()]}),l.isPlaceholder?null:(0,q.flexRender)(l.column.columnDef.header,l.getContext()),S&&O!=="right"&&l.column.getIsSorted()&&(0,r.jsx)("span",{className:"order-2 ml-1",children:l.column.getIsSorted()&&{asc:(0,r.jsx)(R.ChevronUp,{className:"w-4 h-4"}),desc:(0,r.jsx)(R.ChevronDown,{className:"w-4 h-4"})}[l.column.getIsSorted()]})]}),(S||V&&!Lt)&&(0,r.jsxs)(de,{children:[(0,r.jsx)(ce,{asChild:!0,className:n("absolute",O==="left"&&"right-1",O==="center"&&"right-1",O==="right"&&"left-1"),children:(0,r.jsx)(_o,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,r.jsx)(R.MoreHorizontal,{className:"w-4 h-4"})})}),(0,r.jsxs)(me,{align:"end",className:"w-48",children:[S&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J,{children:"Sorting"}),(0,r.jsxs)(E,{onClick:()=>l.column.toggleSorting(!1),children:[(0,r.jsx)(R.ChevronUp,{className:"w-4 h-4 mr-2"}),"Sort Ascending"]}),(0,r.jsxs)(E,{onClick:()=>l.column.toggleSorting(!0),children:[(0,r.jsx)(R.ChevronDown,{className:"w-4 h-4 mr-2"}),"Sort Descending"]}),(0,r.jsxs)(E,{onClick:()=>l.column.clearSorting(),disabled:!l.column.getIsSorted(),children:[(0,r.jsx)(R.ChevronsUpDown,{className:"w-4 h-4 mr-2"}),"Clear Sort"]}),(0,r.jsx)(Z,{})]}),V&&!Lt&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J,{children:"Pin Column"}),(0,r.jsxs)(E,{onClick:()=>ao(l.column.id,"right"),disabled:l.column.getIsPinned()==="right",children:[(0,r.jsx)(R.MoveRightIcon,{}),"Pin Right"]}),(0,r.jsxs)(E,{onClick:()=>ao(l.column.id,!1),disabled:!l.column.getIsPinned(),children:[(0,r.jsx)(R.PinOffIcon,{}),"Unpin"]})]})]})]})]}),to&&l.column.getCanResize()&&!f&&l.colSpan===1&&(0,r.jsx)("div",{className:"absolute top-0 right-0 w-1 h-full transition-opacity opacity-0 bg-border hover:bg-primary cursor-col-resize hover:opacity-100",onMouseDown:l.getResizeHandler()})]},l.id)})},d.id)),ct=d=>{if(!G)return;let g=0,l=w.getLeftHeaderGroups()[0]?.headers||[],s=[...le?["serialNumber"]:[],...K?["select"]:[]];for(let f of l){if(f.id===d.id)break;if(s.includes(f.id)){let h=w.getColumn(f.id);h&&(g+=h.getSize())}}return g},mt=d=>{if(!G)return;let g=w.getState().columnPinning.right||[],l=g.indexOf(d.id);if(l===-1)return;let s=0;for(let f=l+1;f<g.length;f++){let h=w.getColumn(g[f]);h&&(s+=h.getSize())}return s};if(_)return(0,r.jsx)(jt,{className:"w-full shadow-sm rounded-xl",children:(0,r.jsx)(Ut,{className:"flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"mb-3 text-2xl text-red-500",children:"\u26A0\uFE0F"}),(0,r.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:_}),re&&(0,r.jsxs)(C,{variant:"outline",size:"sm",onClick:re,className:"rounded-lg",children:[(0,r.jsx)(R.Loader2,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});let bn=d=>d&&typeof d=="object"&&"content"in d,oe=(0,x.useMemo)(()=>u?bn(u)?{content:u.content,align:u.align||"left",className:u.className||"",sticky:u.sticky!==void 0?u.sticky:!0,showOnEmpty:u.showOnEmpty!==void 0?u.showOnEmpty:!0}:{content:u,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[u]),Ht=()=>qe?(0,r.jsx)(wt,{table:w,filters:i,globalFilter:se,onGlobalFilterChange:xe,enableGlobalFilter:Zt,onExport:he,onRefresh:re,loading:T,enableColumnVisibility:At,enableColumnPinning:G,data:Bt,onClearSorting:mn,onClearFilters:un,onExternalSearch:Le,onCustomFilterChange:dn,aggregations:ie,onAggregationChange:tt}):null,vn=()=>{let d=0;return De==="above-header"&&(d+=st),oe&&(d+=Yt),De==="below-header"&&(d+=Qo),d};return(0,r.jsx)(Xe,{children:(0,r.jsxs)("div",{className:n("w-full space-y-2 flex flex-col h-full",H),children:[qe&&De==="default"&&(0,r.jsx)("div",{ref:ue,className:"relative z-40",children:Ht()}),(0,r.jsx)(jt,{className:n("shadow-sm overflow-hidden py-0",an&&"flex-1"),children:(0,r.jsx)(Ut,{className:"h-full p-0",children:(0,r.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[T&&(0,r.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-xl",children:(0,r.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg shadow-sm bg-background/90",children:[(0,r.jsx)(R.Loader2,{className:"size-5 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,r.jsx)("div",{ref:lt,className:n("relative overflow-auto border-b rounded-t-xl",w.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:v},children:(0,r.jsxs)(Et,{className:n("w-full border-collapse relative",w.getRowModel().rows?.length===0&&"h-full"),children:[qe&&De==="above-header"&&(0,r.jsx)("thead",{className:"sticky top-0 z-40 bg-sidebar border-b",children:(0,r.jsx)(ge,{className:"hover:bg-transparent",children:(0,r.jsx)(fe,{colSpan:ze.length,className:"p-2 bg-sidebar border-b shadow-sm",children:(0,r.jsx)("div",{ref:o,children:Ht()})})})}),oe&&(oe.showOnEmpty||w.getRowModel().rows?.length>0)&&(0,r.jsx)("thead",{className:n("sticky bg-sidebar border-b",Ft&&"shadow-sm"),style:{top:De==="above-header"?`${st}px`:"0px",zIndex:35},children:(0,r.jsx)(ge,{className:"hover:bg-transparent",children:(0,r.jsx)(fe,{colSpan:ze.length,className:n("p-2 font-semibold text-foreground bg-sidebar",We?"py-2":"py-4",oe.className),children:(0,r.jsx)("div",{ref:p,className:n("flex items-center w-full",oe.align==="center"&&"justify-center",oe.align==="right"&&"justify-end",oe.align==="left"&&"justify-start"),children:typeof oe.content=="string"?(0,r.jsx)("span",{className:"text-lg font-bold tracking-tight text-foreground",children:oe.content}):oe.content})})})}),qe&&De==="below-header"&&(0,r.jsx)("thead",{className:n("sticky bg-sidebar border-b",Ft&&"shadow-sm"),style:{top:oe?`${Yt}px`:"0px",zIndex:35},children:(0,r.jsx)(ge,{className:"hover:bg-transparent",children:(0,r.jsx)(fe,{colSpan:ze.length,className:"p-2 bg-sidebar",children:(0,r.jsx)("div",{ref:c,children:Ht()})})})}),!rn&&(0,r.jsx)(uo,{className:n("sticky bg-sidebar",Ft&&"shadow-sm"),style:{top:`${vn()}px`,zIndex:30},children:fn()}),(0,r.jsx)(po,{children:w.getRowModel().rows?.length?w.getRowModel().rows.map((d,g)=>{let l=ot?ot(d):"";return(0,r.jsx)(ge,{"data-state":d.getIsSelected()&&"selected",className:n(nn&&"hover:bg-muted/50",on&&g%2===0&&"bg-muted/20",d.getIsSelected()&&"bg-muted","border-b last:border-b-0",Ce==="single"&&"cursor-pointer",l),onClick:()=>{Ce==="single"&&cn(d)},children:d.getVisibleCells().map((s,f)=>{let h=G&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&K),P=G&&s.column.getIsPinned()==="right",S=s.column.id==="serialNumber",V=s.column.id==="select",L=S||V&&dt;return(0,r.jsx)(fe,{className:n(We?"py-2":"py-4",eo&&f<d.getVisibleCells().length&&"border-r",h&&"sticky left-0 z-20 bg-sidebar/95",P&&"sticky right-0 z-20 bg-sidebar/95",S&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:s.column.getSize()!==150?s.column.getSize():"auto",minWidth:s.column.getSize()!==150?s.column.getSize():"auto",...h&&{left:S?0:V?le&&w.getColumn("serialNumber")?.getSize()||0:ct(s.column)},...P&&{right:mt(s.column)},...S&&{left:0}},children:(0,q.flexRender)(s.column.columnDef.cell,s.getContext())},s.id)})},d.id)}):(0,r.jsx)(ge,{children:(0,r.jsx)(fe,{colSpan:ze.length,className:"h-32 text-center border-0",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("div",{className:"text-6xl text-muted-foreground",children:"\u{1F4CB}"}),(0,r.jsx)("p",{className:"font-medium text-muted-foreground",children:j})]})})})}),pn()]})}),F&&(0,r.jsx)("div",{className:"sticky bottom-0 z-10 w-full bg-sidebar",style:{width:"100%",minWidth:"fit-content"},children:(0,r.jsx)(Et,{children:(0,r.jsx)(Gt,{children:(0,r.jsx)(ge,{className:"bg-sidebar",children:(0,r.jsx)(fe,{colSpan:ze.length,className:"p-2",children:F})})})})})]})})}),(0,r.jsx)(Nt,{table:w,config:m}),W&&W(w)]})})}var Ho=require("radix-ui");var Lo=require("react/jsx-runtime");function Pt({className:e,orientation:t="horizontal",decorative:i=!0,...m}){return(0,Lo.jsx)(Ho.Separator.Root,{"data-slot":"separator-root",decorative:i,orientation:t,className:n("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...m})}var Dt=require("lucide-react"),Tt=require("framer-motion"),Ne=Ot(require("react"),1),Oo=Ot(require("react-dom"),1),z=require("react/jsx-runtime");function Eo({table:e,visible:t,container:i,children:m,className:b,...u}){let[F,H]=Ne.useState(!1);Ne.useLayoutEffect(()=>{H(!0)},[]),Ne.useEffect(()=>{function _(j){j.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e]);let v=i??(F?globalThis.document?.body:null);if(!v||!e)return null;let T=t??e.getFilteredSelectedRowModel().rows.length>0;return Oo.createPortal((0,z.jsx)(Tt.AnimatePresence,{children:T&&(0,z.jsx)(Tt.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:n("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",b),...u,children:(0,z.jsx)(Xe,{children:m})})}),v)}function Go({size:e="sm",tooltip:t,isPending:i,disabled:m,className:b,children:u,...F}){let H=(0,z.jsx)(C,{variant:"secondary",size:e,className:n("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",b),disabled:m||i,...F,children:i?(0,z.jsx)(Dt.Loader,{className:"animate-spin"}):u});return t?(0,z.jsxs)(qt,{children:[(0,z.jsx)(Wt,{asChild:!0,children:H}),(0,z.jsx)(Xt,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,z.jsx)("p",{children:t})})]}):H}function jo({table:e}){let t=Ne.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,z.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,z.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,z.jsx)(Pt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,z.jsxs)(qt,{children:[(0,z.jsx)(Wt,{asChild:!0,children:(0,z.jsx)(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,z.jsx)(Dt.X,{className:"size-3.5"})})}),(0,z.jsxs)(Xt,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,z.jsx)("p",{children:"Clear selection"}),(0,z.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,z.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var Pe=require("lucide-react");var A=require("react/jsx-runtime");function Uo({column:e,title:t,className:i}){return e.getCanSort()?(0,A.jsx)("div",{className:n("flex items-center space-x-2",i),children:(0,A.jsxs)(de,{children:[(0,A.jsx)(ce,{asChild:!0,children:(0,A.jsxs)(C,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[(0,A.jsx)("span",{children:t}),e.getIsSorted()==="desc"?(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"}):(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),(0,A.jsxs)(me,{align:"start",className:"rounded-lg",children:[(0,A.jsxs)(E,{onClick:()=>e.toggleSorting(!1),children:[(0,A.jsx)(Pe.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),(0,A.jsxs)(E,{onClick:()=>e.toggleSorting(!0),children:[(0,A.jsx)(Pe.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),(0,A.jsx)(Z,{}),(0,A.jsxs)(E,{onClick:()=>e.toggleVisibility(!1),children:[(0,A.jsx)(Pe.EyeOff,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):(0,A.jsx)("div",{className:n(i),children:t})}var St=require("lucide-react");var ae=require("react/jsx-runtime");function $o({table:e}){return(0,ae.jsxs)(de,{children:[(0,ae.jsx)(ce,{asChild:!0,children:(0,ae.jsxs)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:[(0,ae.jsx)(St.Eye,{className:"mr-2 h-4 w-4"}),"Columns ",(0,ae.jsx)(St.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),(0,ae.jsxs)(me,{align:"end",className:"w-[200px] rounded-lg",children:[(0,ae.jsx)(J,{children:"Toggle Columns"}),(0,ae.jsx)(Z,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>(0,ae.jsx)(Ie,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:i=>t.toggleVisibility(!!i),children:t.id},t.id))]})]})}var qo=require("radix-ui"),Wo=require("class-variance-authority");var Xo=require("react/jsx-runtime"),In=(0,Wo.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function kt({className:e,variant:t,asChild:i=!1,...m}){let b=i?qo.Slot.Slot:"span";return(0,Xo.jsx)(b,{"data-slot":"badge",className:n(In({variant:t}),e),...m})}var Rt=require("lucide-react"),N=require("react/jsx-runtime");function Ko({column:e,title:t,options:i}){let m=e?.getFacetedUniqueValues(),b=new Set(e?.getFilterValue());return(0,N.jsxs)(Fe,{children:[(0,N.jsx)(_e,{asChild:!0,children:(0,N.jsxs)(C,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[(0,N.jsx)(Rt.PlusCircleIcon,{className:"mr-2 h-4 w-4"}),t,b?.size>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Pt,{orientation:"vertical",className:"mx-2 h-4"}),(0,N.jsx)(kt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:b.size}),(0,N.jsx)("div",{className:"hidden space-x-1 lg:flex",children:b.size>2?(0,N.jsxs)(kt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[b.size," selected"]}):i.filter(u=>b.has(u.value)).map(u=>(0,N.jsx)(kt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:u.label},u.value))})]})]})}),(0,N.jsx)(Ve,{className:"w-[200px] p-0 rounded-lg",align:"start",children:(0,N.jsxs)(ft,{className:"rounded-lg",children:[(0,N.jsx)(bt,{placeholder:t}),(0,N.jsxs)(vt,{children:[(0,N.jsx)(ht,{children:"No results found."}),(0,N.jsx)(Ke,{children:i.map(u=>{let F=b.has(u.value);return(0,N.jsxs)(Me,{onSelect:()=>{F?b.delete(u.value):b.add(u.value);let H=Array.from(b);e?.setFilterValue(H.length?H:void 0)},children:[(0,N.jsx)("div",{className:n("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",F?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,N.jsx)(Rt.CheckIcon,{className:n("h-4 w-4")})}),u.icon&&(0,N.jsx)(u.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),(0,N.jsx)("span",{children:u.label}),m?.get(u.value)&&(0,N.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:m.get(u.value)})]},u.value)})}),b.size>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ho,{}),(0,N.jsx)(Ke,{children:(0,N.jsx)(Me,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}0&&(module.exports={DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTableColumnHeader,DataTableFacetedFilter,DataTablePagination,DataTableToolbar,DataTableViewOptions});
|
|
2
|
+
"use strict";var Cn=Object.create;var vt=Object.defineProperty;var yn=Object.getOwnPropertyDescriptor;var wn=Object.getOwnPropertyNames;var Nn=Object.getPrototypeOf,Pn=Object.prototype.hasOwnProperty;var Dn=(e,t)=>{for(var i in t)vt(e,i,{get:t[i],enumerable:!0})},uo=(e,t,i,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let b of wn(t))!Pn.call(e,b)&&b!==i&&vt(e,b,{get:()=>t[b],enumerable:!(m=yn(t,b))||m.enumerable});return e};var qt=(e,t,i)=>(i=e!=null?Cn(Nn(e)):{},uo(t||!e||!e.__esModule?vt(i,"default",{value:e,enumerable:!0}):i,e)),Tn=e=>uo(vt({},"__esModule",{value:!0}),e);var _n={};Dn(_n,{DataTable:()=>jo,DataTableActionBar:()=>Wo,DataTableActionBarAction:()=>Xo,DataTableActionBarSelection:()=>Ko,DataTableColumnHeader:()=>Jo,DataTableFacetedFilter:()=>tn,DataTablePagination:()=>Tt,DataTableToolbar:()=>Dt,DataTableViewOptions:()=>Qo});module.exports=Tn(_n);var X=require("@tanstack/react-table"),z=require("lucide-react");var fo=require("radix-ui"),bo=require("class-variance-authority");var po=require("clsx"),go=require("tailwind-merge");function n(...e){return(0,go.twMerge)((0,po.clsx)(e))}var vo=require("react/jsx-runtime"),ht=(0,bo.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function C({className:e,variant:t,size:i,asChild:m=!1,...b}){let u=m?fo.Slot.Slot:"button";return(0,vo.jsx)(u,{"data-slot":"button",className:n(ht({variant:t,size:i,className:e}),"transition-none"),...b})}var ue=require("react/jsx-runtime");function Wt({className:e,...t}){return(0,ue.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,ue.jsx)("table",{"data-slot":"table",className:n("w-full caption-bottom text-sm",e),...t})})}function ho({className:e,...t}){return(0,ue.jsx)("thead",{"data-slot":"table-header",className:n("[&_tr]:border-b",e),...t})}function xo({className:e,...t}){return(0,ue.jsx)("tbody",{"data-slot":"table-body",className:n("[&_tr:last-child]:border-0",e),...t})}function Xt({className:e,...t}){return(0,ue.jsx)("tfoot",{"data-slot":"table-footer",className:n("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function pe({className:e,...t}){return(0,ue.jsx)("tr",{"data-slot":"table-row",className:n("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Co({className:e,...t}){return(0,ue.jsx)("th",{"data-slot":"table-head",className:n("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function ge({className:e,...t}){return(0,ue.jsx)("td",{"data-slot":"table-cell",className:n("p-2 align-middle whitespace-nowrap",e),...t})}var Qt=require("react/jsx-runtime");function Kt({className:e,...t}){return(0,Qt.jsx)("div",{"data-slot":"card",className:n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Jt({className:e,...t}){return(0,Qt.jsx)("div",{"data-slot":"card-content",className:n("px-6",e),...t})}var Ie=require("radix-ui");var fe=require("react/jsx-runtime");function tt({delayDuration:e=0,...t}){return(0,fe.jsx)(Ie.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Yt({...e}){return(0,fe.jsx)(tt,{children:(0,fe.jsx)(Ie.Tooltip.Root,{"data-slot":"tooltip",...e})})}function Zt({...e}){return(0,fe.jsx)(Ie.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function eo({className:e,sideOffset:t=0,children:i,...m}){return(0,fe.jsx)(Ie.Tooltip.Portal,{children:(0,fe.jsxs)(Ie.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:n("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...m,children:[i,(0,fe.jsx)(Ie.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var w=require("lucide-react");var yo=require("react/jsx-runtime");function to({className:e,type:t,...i}){return(0,yo.jsx)("input",{type:t,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...i})}var we=require("cmdk"),No=require("lucide-react");var Sn=require("radix-ui"),kn=require("lucide-react");var wo=require("react/jsx-runtime");var ne=require("react/jsx-runtime");function xt({className:e,...t}){return(0,ne.jsx)(we.Command,{"data-slot":"command",className:n("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Ct({className:e,...t}){return(0,ne.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,ne.jsx)(No.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,ne.jsx)(we.Command.Input,{"data-slot":"command-input",className:n("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",e),...t})]})}function yt({className:e,...t}){return(0,ne.jsx)(we.Command.List,{"data-slot":"command-list",className:n("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function wt({...e}){return(0,ne.jsx)(we.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function ot({className:e,...t}){return(0,ne.jsx)(we.Command.Group,{"data-slot":"command-group",className:n("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",e),...t})}function Po({className:e,...t}){return(0,ne.jsx)(we.Command.Separator,{"data-slot":"command-separator",className:n("bg-border -mx-1 h-px",e),...t})}function Le({className:e,...t}){return(0,ne.jsx)(we.Command.Item,{"data-slot":"command-item",className:n("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",e),...t})}var q=require("radix-ui"),nt=require("lucide-react");var B=require("react/jsx-runtime");function ae({...e}){return(0,B.jsx)(q.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function re({...e}){return(0,B.jsx)(q.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function ie({className:e,sideOffset:t=4,...i}){return(0,B.jsx)(q.DropdownMenu.Portal,{children:(0,B.jsx)(q.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...i})})}function oo({...e}){return(0,B.jsx)(q.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function H({className:e,inset:t,variant:i="default",...m}){return(0,B.jsx)(q.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":i,className:n("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m})}function Oe({className:e,children:t,checked:i,...m}){return(0,B.jsxs)(q.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:i,...m,children:[(0,B.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,B.jsx)(q.DropdownMenu.ItemIndicator,{children:(0,B.jsx)(nt.CheckIcon,{className:"size-4"})})}),t]})}function Q({className:e,inset:t,...i}){return(0,B.jsx)(q.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...i})}function ee({className:e,...t}){return(0,B.jsx)(q.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",e),...t})}function Do({...e}){return(0,B.jsx)(q.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function To({className:e,inset:t,children:i,...m}){return(0,B.jsxs)(q.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:n("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...m,children:[i,(0,B.jsx)(nt.ChevronRightIcon,{className:"ml-auto size-4"})]})}function So({className:e,...t}){return(0,B.jsx)(q.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var lt=require("react");var qe=require("react"),Ro=require("lucide-react"),$e=require("date-fns");var at=require("radix-ui");var rt=require("react/jsx-runtime");function Ee({...e}){return(0,rt.jsx)(at.Popover.Root,{"data-slot":"popover",...e})}function Ge({...e}){return(0,rt.jsx)(at.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function je({className:e,align:t="center",sideOffset:i=4,...m}){return(0,rt.jsx)(at.Popover.Portal,{children:(0,rt.jsx)(at.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:i,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...m})})}var Nt=qt(require("react"),1),Ue=require("lucide-react"),it=require("react-day-picker");var be=require("react/jsx-runtime");function ko({className:e,classNames:t,showOutsideDays:i=!0,captionLayout:m="label",buttonVariant:b="ghost",formatters:u,components:F,...L}){let v=(0,it.getDefaultClassNames)();return(0,be.jsx)(it.DayPicker,{showOutsideDays:i,className:n("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:m,formatters:{formatMonthDropdown:S=>S.toLocaleString("default",{month:"short"}),...u},classNames:{root:n("w-fit",v.root),months:n("flex gap-4 flex-col md:flex-row relative",v.months),month:n("flex flex-col w-full gap-4",v.month),nav:n("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",v.nav),button_previous:n(ht({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_previous),button_next:n(ht({variant:b}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",v.button_next),month_caption:n("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",v.month_caption),dropdowns:n("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",v.dropdowns),dropdown_root:n("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",v.dropdown_root),dropdown:n("absolute bg-popover inset-0 opacity-0",v.dropdown),caption_label:n("select-none font-medium",m==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",v.caption_label),table:"w-full border-collapse",weekdays:n("flex",v.weekdays),weekday:n("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",v.weekday),week:n("flex w-full mt-2",v.week),week_number_header:n("select-none w-(--cell-size)",v.week_number_header),week_number:n("text-[0.8rem] select-none text-muted-foreground",v.week_number),day:n("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",v.day),range_start:n("rounded-l-md bg-accent",v.range_start),range_middle:n("rounded-none",v.range_middle),range_end:n("rounded-r-md bg-accent",v.range_end),today:n("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",v.today),outside:n("text-muted-foreground aria-selected:text-muted-foreground",v.outside),disabled:n("text-muted-foreground opacity-50",v.disabled),hidden:n("invisible",v.hidden),...t},components:{Root:({className:S,rootRef:_,...U})=>(0,be.jsx)("div",{"data-slot":"calendar",ref:_,className:n(S),...U}),Chevron:({className:S,orientation:_,...U})=>_==="left"?(0,be.jsx)(Ue.ChevronLeftIcon,{className:n("size-4",S),...U}):_==="right"?(0,be.jsx)(Ue.ChevronRightIcon,{className:n("size-4",S),...U}):(0,be.jsx)(Ue.ChevronDownIcon,{className:n("size-4",S),...U}),DayButton:Rn,WeekNumber:({children:S,..._})=>(0,be.jsx)("td",{..._,children:(0,be.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:S})}),...F},...L})}function Rn({className:e,day:t,modifiers:i,...m}){let b=(0,it.getDefaultClassNames)(),u=Nt.useRef(null);return Nt.useEffect(()=>{i.focused&&u.current?.focus()},[i.focused]),(0,be.jsx)(C,{ref:u,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,"data-range-start":i.range_start,"data-range-end":i.range_end,"data-range-middle":i.range_middle,className:n("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",b.day,e),...m})}var W=require("react/jsx-runtime");function zo({value:e,onChange:t,placeholder:i,mode:m,externalSearch:b,onExternalChange:u,onlyExternal:F=!1}){let[L,v]=(0,qe.useState)(!1),[S,_]=(0,qe.useState)(e),[U,te]=(0,qe.useState)(e);(0,qe.useEffect)(()=>{F||te(e)},[e,F]);let ve=()=>{F||t(S),te(S),b&&u&&u(S),v(!1)},le=()=>{_(U),v(!1)},Z=()=>{let P=m==="single"?null:{from:null,to:null};_(P),F||t(P),te(P),b&&u&&u(P),v(!1)},K=()=>{let P=F?U:e;return P?m==="single"?(0,$e.format)(P,"PPP"):P.from&&P.to?`${(0,$e.format)(P.from,"MMM dd")} - ${(0,$e.format)(P.to,"MMM dd, yyyy")}`:P.from?`From ${(0,$e.format)(P.from,"MMM dd, yyyy")}`:P.to?`To ${(0,$e.format)(P.to,"MMM dd, yyyy")}`:i:i},$=P=>{_(m==="single"?P:P||{from:null,to:null})};return(0,W.jsxs)(Ee,{open:L,onOpenChange:v,children:[(0,W.jsx)(Ge,{className:"h-8",asChild:!0,children:(0,W.jsxs)(C,{variant:"outline",className:n("w-full justify-start text-left font-normal h-9",!K()&&"text-muted-foreground"),children:[(0,W.jsx)(Ro.Calendar,{className:"mr-2 h-4 w-4"}),K()]})}),(0,W.jsxs)(je,{className:"w-auto p-0",align:"start",children:[(0,W.jsx)("div",{className:"p-3",children:(0,W.jsx)(ko,{mode:m,selected:S,onSelect:$,numberOfMonths:m==="range"?2:1,className:"rounded-md border",...m==="range"&&{required:!0}})}),(0,W.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,W.jsx)(C,{variant:"ghost",size:"sm",onClick:Z,children:"Clear"}),(0,W.jsxs)("div",{className:"flex gap-2",children:[(0,W.jsx)(C,{variant:"outline",size:"sm",onClick:le,children:"Cancel"}),(0,W.jsx)(C,{size:"sm",onClick:ve,disabled:m==="range"&&(!S?.from||!S?.to),children:"Apply"})]})]})]})]})}var no=require("radix-ui"),Mo=require("lucide-react");var Pt=require("react/jsx-runtime");function st({className:e,...t}){return(0,Pt.jsx)(no.Checkbox.Root,{"data-slot":"checkbox",className:n("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,Pt.jsx)(no.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,Pt.jsx)(Mo.CheckIcon,{className:"size-3.5"})})})}var a=require("react/jsx-runtime"),Io=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function Dt({table:e,filters:t=[],globalFilter:i,onGlobalFilterChange:m,enableGlobalFilter:b=!0,onExport:u,onRefresh:F,loading:L=!1,enableColumnVisibility:v=!0,data:S,onClearSorting:_,onClearFilters:U,enableColumnPinning:te=!1,onExternalSearch:ve,onCustomFilterChange:le,aggregations:Z={},onAggregationChange:K,enableGroupedGlobalFilter:$=!1,groupedFilterLabel:P="Search in",onGroupedFilterChange:_e}){let[de,dt]=(0,lt.useState)({}),[Ve,ct]=(0,lt.useState)({}),[We,Ft]=(0,lt.useState)({}),[De,_t]=(0,lt.useState)("all"),Xe=()=>e.getAllLeafColumns().filter(o=>o.getCanHide?.()!==!1),Ke=()=>e.getAllColumns().filter(o=>!e.getAllLeafColumns().includes(o)&&o.columns?.length&&o.columns.some(c=>c.getCanHide?.()!==!1)),mt=()=>{let o=new Set(Ke().flatMap(c=>c.columns?.filter(f=>f.getCanHide?.()!==!1).map(f=>f.id)||[]));return Xe().filter(c=>!o.has(c.id))},Ae=(o,c)=>c&&o.startsWith(`${c}.`)?o.replace(`${c}.`,"").split("_").map(T=>T.slice(1)).join(" "):o.split("_").map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join(" "),Te=(o,c)=>{let f={...de,[o]:c};dt(f)},Vt=(o,c)=>{let f={...Ve,[o]:c};ct(f),le&&le(o,c),t.find(T=>T.key===o)?.externalSearch&&Te(o,c)},At=()=>{ve&&ve(de)},Je=()=>{dt({}),ct({}),U(),ve&&ve({}),le&&Object.keys(Ve).forEach(o=>{le(o,"")})},me=o=>t.find(f=>f.key===o)?.customFilter?Ve[o]??"":e.getColumn(o)?.getFilterValue(),he=(o,c)=>{let f=t.find(T=>T.key===o);f?.customFilter?Vt(o,c):(e.getColumn(o)?.setFilterValue(c),f?.externalSearch&&Te(o,c))},Qe=(o,c)=>{Ft(f=>({...f,[o]:c}))},Se=o=>{if(K){let c=Z[o],f={enabled:!c?.enabled,functions:c?.functions||["sum","average"]};K(o,f)}},ke=(o,c)=>{if(K){let T=Z[o]?.functions||[],G=T.includes(c)?T.filter(Ht=>Ht!==c):[...T,c];K(o,{enabled:G.length>0,functions:G})}},xe=()=>{K&&Object.keys(Z).forEach(o=>{let c=Z[o];c&&K(o,{...c,enabled:!1,functions:[]})})},Re=()=>Xe().filter(o=>o.id==="select"||o.id==="serialNumber"?!1:o.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(T=>{let G=T.getValue(o.id);return typeof G=="number"||typeof G=="string"&&!isNaN(parseFloat(String(G)))||typeof G=="object"&&G!==null&&"props"in G})),ao=o=>{_t(o),_e&&_e(o,i)},Bt=o=>{m(o),_e&&$&&_e(De,o)},Be=Re(),Ye=Object.values(Z).some(o=>o?.enabled),ut=[{value:"all",label:"All Fields"},...t.map(o=>({value:o.key,label:o.placeholder}))];return(0,a.jsx)("div",{className:"rounded-xl",children:(0,a.jsx)("div",{className:"px-2",children:(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,a.jsx)(w.Filter,{className:"size-4"})}),t.map(o=>!e.getColumn(o.key)&&!o.customFilter&&!o.externalSearch?null:(0,a.jsx)("div",{className:n("relative min-w-[150px]",o.width),children:o.type==="select"?(0,a.jsxs)(Ee,{open:We[o.key],onOpenChange:f=>Qe(o.key,f),children:[(0,a.jsx)(Ge,{asChild:!0,children:(0,a.jsxs)("div",{className:"relative w-full",children:[o.icon&&(0,a.jsx)(o.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground pointer-events-none z-10"}),(0,a.jsxs)(C,{variant:"outline",role:"combobox","aria-expanded":We[o.key],className:n("h-8 sm:h-8 rounded-lg w-full justify-between font-normal",!me(o.key)&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:n("truncate",o.icon&&"pl-6"),children:me(o.key)?o.options?.find(f=>f.value===me(o.key))?.label:o.placeholder}),(0,a.jsx)(w.ChevronDown,{className:"ml-2 opacity-50 size-4 shrink-0"})]})]})}),(0,a.jsx)(je,{className:"w-[--radix-popover-trigger-width] p-0 rounded-lg",children:(0,a.jsxs)(xt,{className:"rounded-lg",children:[(0,a.jsx)(Ct,{placeholder:`Search ${o.placeholder?.toLowerCase()}...`}),(0,a.jsxs)(yt,{children:[(0,a.jsx)(wt,{children:"No option found."}),(0,a.jsxs)(ot,{children:[(0,a.jsxs)(Le,{value:"all",onSelect:()=>{he(o.key,""),Qe(o.key,!1)},className:"flex items-center cursor-pointer",children:[(0,a.jsx)(w.Check,{className:n("mr-2 size-4 shrink-0",me(o.key)?"opacity-0":"opacity-100")}),(0,a.jsx)("span",{children:"All"})]}),o.options?.map(f=>(0,a.jsxs)(Le,{value:f.label,onSelect:()=>{he(o.key,f.value),Qe(o.key,!1)},className:"flex items-center cursor-pointer",children:[(0,a.jsx)(w.Check,{className:n("mr-2 size-4 shrink-0",me(o.key)===f.value?"opacity-100":"opacity-0")}),(0,a.jsx)("span",{children:f.label})]},f.label))]})]})]})})]}):o.type==="date"?(0,a.jsx)(zo,{value:me(o.key),onChange:f=>{o.onlyExternal||he(o.key,f)},placeholder:o.placeholder,mode:o.dateMode||"single",externalSearch:o.externalSearch,onlyExternal:o.onlyExternal,onExternalChange:f=>Te(o.key,f)}):(0,a.jsxs)("div",{className:"relative",children:[o.icon&&(0,a.jsx)(o.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,a.jsx)(to,{placeholder:o.placeholder,value:me(o.key)??"",onChange:f=>{he(o.key,f.target.value)},className:n("h-8 rounded-lg",o.icon&&"pl-9"),type:o.type==="number"?"number":"text"})]})},o.key)),(t.some(o=>o.externalSearch)||t.some(o=>o.customFilter))&&(0,a.jsxs)(C,{variant:"default",size:"sm",onClick:At,className:"rounded-lg h-7",children:[(0,a.jsx)(w.Search,{className:"size-4"}),t.find(o=>o.externalSearch||o.customFilter)?.searchButtonText||"Search"]})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[b&&(0,a.jsxs)("div",{className:n("flex items-center",$?"bg-background border rounded-lg":""),children:[$&&(0,a.jsxs)(ae,{children:[(0,a.jsx)(re,{asChild:!0,children:(0,a.jsxs)(C,{variant:"ghost",size:"sm",className:"gap-1 border-0 border-r rounded-r-none hover:bg-transparent",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:P}),(0,a.jsx)(w.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,a.jsx)(ie,{align:"end",className:"w-48 rounded-lg",children:ut.map(o=>(0,a.jsxs)(H,{onClick:()=>ao(o.value),className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:o.label}),De===o.value&&(0,a.jsx)(w.Check,{className:"size-4 text-primary"})]},o.value))})]}),(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(w.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,a.jsx)(to,{placeholder:$&&De!=="all"?`Search in ${ut.find(o=>o.value===De)?.label}...`:"Global search...",value:i??"",onChange:o=>Bt(o.target.value),className:n("pl-9 h-8 max-w-max",$&&"border-0 rounded-l-none")})]})]}),Be.length>0&&K&&(0,a.jsxs)(ae,{children:[(0,a.jsx)(re,{asChild:!0,children:(0,a.jsxs)(C,{variant:"outline",size:"sm",className:n("rounded-lg gap-1",Ye&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[(0,a.jsx)(w.Calculator,{className:"size-4"}),(0,a.jsx)("span",{children:"Aggregations"}),(0,a.jsx)(w.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,a.jsxs)(ie,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,a.jsxs)(Q,{className:"flex items-center justify-between px-4 py-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),Ye&&(0,a.jsx)(C,{variant:"ghost",size:"sm",onClick:xe,className:"h-6 px-2 text-xs",children:"Clear All"})]}),(0,a.jsx)(ee,{}),Be.map(o=>{let c=Z[o.id],f=c?.enabled;return(0,a.jsxs)(Do,{children:[(0,a.jsx)(To,{className:"text-sm",children:(0,a.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,a.jsx)(st,{checked:f,onCheckedChange:()=>Se(o.id),className:"data-[state=checked]:bg-primary"}),(0,a.jsx)("span",{className:n("flex-1",f&&"font-medium text-primary"),children:Ae(o.id)}),f&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[c?.functions?.slice(0,2).map(T=>(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:Io.find(G=>G.value===T)?.label},T)),c?.functions&&c.functions.length>2&&(0,a.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",c.functions.length-2]})]})]})}),(0,a.jsxs)(So,{className:"w-48 rounded-lg",children:[(0,a.jsx)(Q,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),Io.map(T=>(0,a.jsx)(Oe,{checked:c?.functions?.includes(T.value)||!1,onCheckedChange:()=>ke(o.id,T.value),className:"py-2 text-sm",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{children:T.label}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:T.description})]})},T.value))]})]},o.id)}),Be.length===0&&(0,a.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,a.jsx)(w.Calculator,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),u&&(0,a.jsxs)(C,{variant:"outline",size:"sm",onClick:()=>u(S),className:"rounded-lg",children:[(0,a.jsx)(w.Download,{className:"size-4"}),"Export"]}),v&&(0,a.jsxs)(ae,{children:[(0,a.jsx)(re,{asChild:!0,className:"h-7",children:(0,a.jsxs)(C,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,a.jsx)("span",{children:"Columns"}),(0,a.jsx)(w.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,a.jsxs)(ie,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,a.jsx)(Q,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,a.jsx)(ee,{}),mt().length>0&&(0,a.jsxs)(oo,{children:[(0,a.jsx)(Q,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),mt().map(o=>(0,a.jsx)(Oe,{className:"text-sm",checked:o.getIsVisible(),onCheckedChange:c=>o.toggleVisibility(!!c),children:Ae(o.id)},o.id))]}),Ke().map(o=>(0,a.jsxs)(oo,{children:[(0,a.jsx)(ee,{}),(0,a.jsx)(Q,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:o.id}),o.columns?.filter(c=>c.getCanHide?.()!==!1).map(c=>(0,a.jsx)(Oe,{className:"text-sm",checked:c.getIsVisible(),onCheckedChange:f=>c.toggleVisibility(!!f),children:Ae(c.id,o.id)},c.id))]},o.id))]})]}),(0,a.jsxs)(ae,{children:[(0,a.jsx)(re,{asChild:!0,className:"h-7",children:(0,a.jsx)(C,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:(0,a.jsx)(w.Settings2,{className:"size-4"})})}),(0,a.jsxs)(ie,{align:"end",className:"w-[200px] rounded-lg",children:[(0,a.jsx)(Q,{children:"Table Settings"}),(0,a.jsx)(ee,{}),(0,a.jsxs)(H,{onClick:_,children:[(0,a.jsx)(w.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,a.jsxs)(H,{onClick:Je,children:[(0,a.jsx)(w.Filter,{className:"size-4"}),"Clear All Filters"]}),Ye&&(0,a.jsxs)(H,{onClick:xe,children:[(0,a.jsx)(w.Calculator,{className:"size-4"}),"Clear Aggregations"]}),te&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ee,{}),(0,a.jsx)(Q,{children:"Column Pinning"}),(0,a.jsxs)(H,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,a.jsx)(w.PinOff,{className:"size-4"}),"Reset All Pinning"]}),(0,a.jsxs)(H,{onClick:()=>{let o=Xe().filter(c=>c.getCanPin?.()!==!1).map(c=>c.id);e.setColumnPinning({left:[],right:o})},children:[(0,a.jsx)(w.Pin,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),F&&(0,a.jsx)(C,{variant:"outline",size:"sm",onClick:F,disabled:L,className:"rounded-lg",children:(0,a.jsx)(w.RefreshCw,{className:n("h-4 w-4",L&&"animate-spin")})})]})]})})})})}var Y=require("radix-ui"),Fe=require("lucide-react");var I=require("react/jsx-runtime");function Fo({...e}){return(0,I.jsx)(Y.Select.Root,{"data-slot":"select",...e})}function _o({...e}){return(0,I.jsx)(Y.Select.Value,{"data-slot":"select-value",...e})}function Vo({className:e,size:t="default",children:i,...m}){return(0,I.jsxs)(Y.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:n("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...m,children:[i,(0,I.jsx)(Y.Select.Icon,{asChild:!0,children:(0,I.jsx)(Fe.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Ao({className:e,children:t,position:i="popper",...m}){return(0,I.jsx)(Y.Select.Portal,{children:(0,I.jsxs)(Y.Select.Content,{"data-slot":"select-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,...m,children:[(0,I.jsx)(zn,{}),(0,I.jsx)(Y.Select.Viewport,{className:n("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,I.jsx)(Mn,{})]})})}function Bo({className:e,children:t,...i}){return(0,I.jsxs)(Y.Select.Item,{"data-slot":"select-item",className:n("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...i,children:[(0,I.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,I.jsx)(Y.Select.ItemIndicator,{children:(0,I.jsx)(Fe.CheckIcon,{className:"size-4"})})}),(0,I.jsx)(Y.Select.ItemText,{children:t})]})}function zn({className:e,...t}){return(0,I.jsx)(Y.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:n("flex cursor-default items-center justify-center py-1",e),...t,children:(0,I.jsx)(Fe.ChevronUpIcon,{className:"size-4"})})}function Mn({className:e,...t}){return(0,I.jsx)(Y.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:n("flex cursor-default items-center justify-center py-1",e),...t,children:(0,I.jsx)(Fe.ChevronDownIcon,{className:"size-4"})})}var R=require("react/jsx-runtime");function Tt({table:e,config:t}){return t.enabled?(0,R.jsx)("div",{className:"rounded-xl",children:(0,R.jsx)("div",{children:(0,R.jsxs)("div",{className:"flex items-center justify-between",children:[(0,R.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,R.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,R.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,R.jsxs)("div",{className:"flex items-center gap-2",children:[(0,R.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,R.jsxs)(Fo,{value:`${e.getState().pagination.pageSize}`,onValueChange:i=>e.setPageSize(Number(i)),children:[(0,R.jsx)(Vo,{className:"h-9 w-[70px] rounded-lg",children:(0,R.jsx)(_o,{})}),(0,R.jsx)(Ao,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(i=>(0,R.jsx)(Bo,{value:`${i}`,children:i},i))})]})]}),(0,R.jsxs)("div",{className:"flex items-center gap-2",children:[(0,R.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,R.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,R.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(i,m)=>{let b=e.getState().pagination.pageIndex,u=b+m;return u<1||u>e.getPageCount()?null:(0,R.jsx)(C,{variant:u===b+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(u-1),children:u},u)})}),(0,R.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,R.jsx)(C,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var Ho=require("radix-ui"),Lo=require("class-variance-authority");var Eo=require("react/jsx-runtime"),In=(0,Lo.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function Oo({className:e,variant:t,size:i,noBg:m,...b}){return(0,Eo.jsx)(Ho.Toggle.Root,{"data-slot":"toggle",className:n(In({className:e,variant:t,size:i,bg:m?"disabled":"enabled"})),...b})}var x=require("react"),r=require("react/jsx-runtime"),Go={sum:e=>e.reduce((t,i)=>t+i,0),average:e=>e.length>0?e.reduce((t,i)=>t+i,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((m,b)=>m-b),i=Math.floor(t.length/2);return t.length%2===0?(t[i-1]+t[i])/2:t[i]}};function jo({data:e,columns:t,filters:i=[],pagination:m={enabled:!1},settings:b={},header:u,footer:F,className:L="",maxHeight:v="100%",loading:S=!1,error:_,emptyMessage:U="No data available",onRowSelectionChange:te,onExport:ve,onRefresh:le,onTableReady:Z,children:K,isRowDisabled:$,isRowSelectable:P,onExternalSearch:_e,aggregations:de={},onAggregationChange:dt,rowClassName:Ve}){let[ct,We]=(0,x.useState)([]),[Ft,De]=(0,x.useState)([]),[_t,Xe]=(0,x.useState)({}),[Ke,mt]=(0,x.useState)({}),[Ae,Te]=(0,x.useState)(""),[Vt,At]=(0,x.useState)([]),[Je,me]=(0,x.useState)(b.enableColumnPinning?{left:[],right:[]}:{}),[he,Qe]=(0,x.useState)({}),Se=(0,x.useRef)(null),ke=(0,x.useRef)(null),xe=(0,x.useRef)(null),Re=(0,x.useRef)(null),[ao,Bt]=(0,x.useState)(0),[Be,Ye]=(0,x.useState)(0),[ut,o]=(0,x.useState)(0),[c,f]=(0,x.useState)(0),T=(0,x.useRef)(null),[G,Ht]=(0,x.useState)(!1),{enableSorting:Lt=!0,enableFiltering:Ot=!0,enableGlobalFilter:ro=!0,enableColumnVisibility:Et=!0,enableRowSelection:J=!0,stickyHeader:Vn=!0,toolbar:Ze=!1,disableHeaderCheckbox:on=!1,toolbarPosition:ze="default",showSerialNumbers:ce=!0,fixedCheckboxColumn:pt=!0,striped:nn=!0,hoverable:an=!0,compact:et=!0,bordered:io=!0,fullHeight:rn=!1,enableColumnResizing:so=!1,enableColumnPinning:j=!0,hideHeader:sn=!1,selectionMode:Ce="multiple",showCheckBox:ln=!0,checkboxColumnPosition:lo=0,rounded:Gt=!0}=b;(0,x.useEffect)(()=>{let d=()=>{T.current&&Ht(T.current.scrollTop>0)},p=T.current;if(p)return p.addEventListener("scroll",d),()=>p.removeEventListener("scroll",d)},[]),(0,x.useEffect)(()=>{let d=()=>{Se.current&&Bt(Se.current.offsetHeight+16),ke.current&&Ye(ke.current.offsetHeight+16),xe.current&&o(xe.current.offsetHeight+16),Re.current&&f(Re.current.offsetHeight+16)};d();let p=new ResizeObserver(()=>{setTimeout(d,50)});return Se.current&&p.observe(Se.current),ke.current&&p.observe(ke.current),xe.current&&p.observe(xe.current),Re.current&&p.observe(Re.current),()=>{p.disconnect()}},[Ze,u,ze]);let dn=(d,p)=>p.split(".").reduce((l,s)=>l&&l[s],d),jt=(0,x.useMemo)(()=>Object.keys(he).length===0?e:e.filter(d=>Object.entries(he).every(([p,l])=>{if(!l||l==="")return!0;let s=dn(d,p);return typeof l=="string"?String(s).toLowerCase().includes(l.toLowerCase()):s===l})),[e,he]),cn=(0,x.useCallback)((d,p)=>{Qe(l=>{let s={...l};return p===""||p===null||p===void 0?delete s[d]:s[d]=p,s})},[]),He=(0,x.useMemo)(()=>{let d=[...t],p=g=>g.map(h=>{if(h.id==="select"||h.id==="serialNumber")return h;let D={...h,enablePinning:!0};return h.columns&&(D.columns=p(h.columns)),D}),l=p(d),s={id:"select",header:({table:g})=>{if(Ce==="single")return null;let h=g.getRowModel().rows.filter(V=>!$?.(V.original)&&(P?P(V.original):!0)),D=h.length>0&&h.every(V=>V.getIsSelected()),k=h.some(V=>V.getIsSelected());return(0,r.jsx)(st,{checked:D||k&&"indeterminate",onCheckedChange:V=>{h.forEach(O=>O.toggleSelected(!!V))},disabled:on||h.length===0,"aria-label":"Select all selectable rows"})},cell:({row:g})=>{let h=$?$(g.original):!1,D=P?P(g.original):!0;return(0,r.jsx)("div",{className:n("flex items-center justify-center",h&&"opacity-50"),children:Ce==="multiple"?(0,r.jsx)(st,{checked:g.getIsSelected(),onCheckedChange:k=>D&&g.toggleSelected(!!k),"aria-label":"Select row",disabled:h||!D}):ln?(0,r.jsx)("input",{type:"radio",checked:g.getIsSelected(),onChange:()=>D&&g.toggleSelected(!0),disabled:h||!D,className:"w-4 h-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:Ce==="multiple"?40:30};if(J){let g=lo;g<0&&(g=l.length+g+1),g=Math.max(0,Math.min(g,l.length)),l.splice(g,0,s)}if(ce){let g={id:"serialNumber",header:"No.",cell:({row:h})=>(0,r.jsx)("div",{className:"font-medium text-center text-muted-foreground",children:h.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};l.unshift(g)}return l},[t,ce,J,pt,$,P,Ce,lo]),y=(0,X.useReactTable)({data:jt,columns:He,onSortingChange:Lt?We:void 0,onColumnFiltersChange:Ot?De:void 0,onGlobalFilterChange:ro?Te:void 0,getCoreRowModel:(0,X.getCoreRowModel)(),getPaginationRowModel:m.enabled?(0,X.getPaginationRowModel)():void 0,getSortedRowModel:Lt?(0,X.getSortedRowModel)():void 0,getFilteredRowModel:Ot?(0,X.getFilteredRowModel)():void 0,onColumnVisibilityChange:Et?Xe:void 0,onRowSelectionChange:J?mt:void 0,onColumnOrderChange:At,onColumnPinningChange:j?me:void 0,state:{sorting:Lt?ct:void 0,columnFilters:Ot?Ft:void 0,columnVisibility:Et?_t:void 0,rowSelection:J?Ke:{},globalFilter:Ae,columnOrder:Vt,columnPinning:j?Je:{}},initialState:{pagination:m.enabled?{pageSize:m.pageSize||10}:void 0,columnPinning:j?{left:[...ce?["serialNumber"]:[],...J?["select"]:[]],right:[]}:void 0},enableRowSelection:J,enableColumnResizing:so,enableColumnPinning:j,columnResizeMode:"onChange"}),co=(0,x.useMemo)(()=>{if(!de||Object.keys(de).length===0)return{};let d={},p=y.getFilteredRowModel().rows;return Object.entries(de).forEach(([l,s])=>{if(!s?.enabled)return;let g=p.map(D=>{if(s.accessor)return s.accessor(D.original);{let k=D.getValue(l);return typeof k=="number"?k:parseFloat(String(k))||0}}).filter(D=>D!==null&&!isNaN(D)),h={};s.functions?.forEach(D=>{Go[D]&&(h[D]=Go[D](g))}),Object.keys(h).length>0&&(d[l]=h)}),d},[jt,de,y?.getFilteredRowModel().rows]);(0,x.useEffect)(()=>{if(J&&te){let d=y.getFilteredSelectedRowModel().rows.filter(p=>!$?.(p.original)&&(P?P(p.original):!0)).map(p=>p.original);te(d)}},[Ke,J,te,y,$,P]);let mn=(0,x.useCallback)(d=>{Ce==="single"?(y.resetRowSelection(),d.toggleSelected(!0)):d.toggleSelected()},[Ce,y]);(0,x.useEffect)(()=>{Z&&Z(y)},[y,Z]);let un=(0,x.useCallback)(()=>{We([])},[]),pn=(0,x.useCallback)(()=>{De([]),Te("")},[]),mo=(d,p)=>{if(!j)return;let l=[...ce?["serialNumber"]:[],...J&&pt?["select"]:[]],s={left:[...(Je.left??[]).filter(g=>l.includes(g))],right:[...Je.right??[]]};p===!1?(s.left=s.left.filter(g=>g!==d),s.right=s.right.filter(g=>g!==d)):p==="right"?(s.left=s.left.filter(g=>g!==d),s.right.includes(d)||s.right.push(d)):p==="left"&&(s.right=s.right.filter(g=>g!==d),!s.left.includes(d)&&!l.includes(d)&&s.left.push(d)),y.setColumnPinning(s)},gn=()=>{let d=Object.keys(co).length>0,p=y.getHeaderGroups()[0]?.headers.some(s=>s.column.columnDef.customFooter),l=ce&&y.getFilteredRowModel().rows.length>0&&(d||p);return!d&&!p&&!l?null:(0,r.jsx)(Xt,{className:"sticky bottom-0 border-t bg-sidebar z-20",children:(0,r.jsx)(pe,{className:"hover:bg-transparent bg-sidebar",children:y.getHeaderGroups()[0]?.headers.map((s,g)=>{let h=s.column.id,D=co[h],k=j&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&J),V=j&&s.column.getIsPinned()==="right",O=s.column.id==="serialNumber",ye=s.column.id==="select",E=s.column.columnDef.customFooter;return D||E||O&&l?(0,r.jsx)(ge,{className:n("font-semibold text-sm py-2 px-2 border-r",et&&"py-1",k&&"sticky left-0 z-30 bg-sidebar/95",V&&"sticky right-0 z-30 bg-sidebar/95",(O||ye)&&"sticky left-0 z-30 bg-sidebar/95",E?.className),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...k&&{left:O?0:ye?ce&&y.getColumn("serialNumber")?.getSize()||0:gt(s.column)},...V&&{right:ft(s.column)},...O&&{left:0}},children:(()=>{if(E?.content){let Me=typeof E.content=="function"?E.content(y):E.content;return(0,r.jsx)("div",{className:n("w-full h-full",E.align==="center"&&"text-center",E.align==="right"&&"text-right",E.align==="left"&&"text-left"),children:Me})}return D?(0,r.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(D).map(([Me,xn])=>(0,r.jsxs)("div",{className:"flex items-center justify-between text-muted-foreground",children:[(0,r.jsxs)("span",{className:"text-xs capitalize",children:[Me,":"]}),(0,r.jsx)("span",{className:"font-medium text-foreground",children:fn(Me,xn)})]},Me))}):O&&l?(0,r.jsxs)("div",{className:"text-xs text-center text-muted-foreground",children:["Total: ",y.getFilteredRowModel().rows.length]}):null})()},`agg-${s.id}`):(0,r.jsx)(ge,{className:n("py-0 px-0 border-r",et&&"py-0",k&&"sticky left-0 z-30 bg-sidebar/95",V&&"sticky right-0 z-30 bg-sidebar/95",(O||ye)&&"sticky left-0 z-30 bg-sidebar/95"),style:{width:s.getSize()!==150?s.getSize():"auto",minWidth:s.getSize()!==150?s.getSize():"auto",...k&&{left:O?0:ye?ce&&y.getColumn("serialNumber")?.getSize()||0:gt(s.column)},...V&&{right:ft(s.column)},...O&&{left:0}}},`agg-${s.id}`)})})})},fn=(d,p)=>typeof p=="number"?d==="count"||d==="unique"?p.toLocaleString():p.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):p,bn=()=>y.getHeaderGroups().map((d,p)=>(0,r.jsx)(pe,{className:"hover:bg-transparent",children:d.headers.map((l,s)=>{let g=l.depth===0&&l.colSpan>1,h=j&&(l.column.getIsPinned()==="left"||l.column.id==="serialNumber"||l.column.id==="select"&&J),D=j&&l.column.getIsPinned()==="right",k=l.column.getCanSort(),V=j&&l.column.columnDef.enablePinning!==!1,O=l.column.id==="serialNumber",ye=l.column.id==="select",$t=O||ye&&pt,E=l.column.columnDef.headerAlign||"left",bt=de&&de[l.column.id]?.enabled,Me={left:"justify-start",center:"justify-center",right:"justify-end"}[E];return(0,r.jsxs)(Co,{colSpan:l.colSpan,className:n("font-semibold text-foreground bg-sidebar group px-0",!et&&"py-2",io&&s<d.headers.length-1&&"border-r","relative",h&&"sticky left-0 z-25 bg-sidebar",D&&"sticky right-0 z-25 bg-sidebar",(O||ye)&&"sticky left-0 z-25 bg-sidebar",g?"text-center":"text-left",bt&&"border-b-2 border-primary/30"),style:{width:l.getSize()!==150?l.getSize():"auto",minWidth:l.getSize()!==150?l.getSize():"auto",...h&&{left:O?0:ye?ce&&y.getColumn("serialNumber")?.getSize()||0:gt(l.column)},...D&&{right:ft(l.column)},...O&&{left:0}},children:[g?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,X.flexRender)(l.column.columnDef.header,l.getContext()),bt&&(0,r.jsx)(z.Calculator,{className:"w-3 h-3 ml-1 text-primary"})]}):(0,r.jsxs)("div",{className:n("relative flex items-center w-full px-2",Me),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[bt&&(0,r.jsx)(z.Calculator,{className:"w-3 h-3 mr-1 text-primary"}),k&&E==="right"&&(0,r.jsx)("span",{className:"order-2 ml-1",children:l.column.getIsSorted()&&{asc:(0,r.jsx)(z.ChevronUp,{className:"w-4 h-4"}),desc:(0,r.jsx)(z.ChevronDown,{className:"w-4 h-4"})}[l.column.getIsSorted()]}),l.isPlaceholder?null:(0,X.flexRender)(l.column.columnDef.header,l.getContext()),k&&E!=="right"&&l.column.getIsSorted()&&(0,r.jsx)("span",{className:"order-2 ml-1",children:l.column.getIsSorted()&&{asc:(0,r.jsx)(z.ChevronUp,{className:"w-4 h-4"}),desc:(0,r.jsx)(z.ChevronDown,{className:"w-4 h-4"})}[l.column.getIsSorted()]})]}),(k||V&&!$t)&&(0,r.jsxs)(ae,{children:[(0,r.jsx)(re,{asChild:!0,className:n("absolute",E==="left"&&"right-1",E==="center"&&"right-1",E==="right"&&"left-1"),children:(0,r.jsx)(Oo,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,r.jsx)(z.MoreHorizontal,{className:"w-4 h-4"})})}),(0,r.jsxs)(ie,{align:"end",className:"w-48",children:[k&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q,{children:"Sorting"}),(0,r.jsxs)(H,{onClick:()=>l.column.toggleSorting(!1),children:[(0,r.jsx)(z.ChevronUp,{className:"w-4 h-4 mr-2"}),"Sort Ascending"]}),(0,r.jsxs)(H,{onClick:()=>l.column.toggleSorting(!0),children:[(0,r.jsx)(z.ChevronDown,{className:"w-4 h-4 mr-2"}),"Sort Descending"]}),(0,r.jsxs)(H,{onClick:()=>l.column.clearSorting(),disabled:!l.column.getIsSorted(),children:[(0,r.jsx)(z.ChevronsUpDown,{className:"w-4 h-4 mr-2"}),"Clear Sort"]}),(0,r.jsx)(ee,{})]}),V&&!$t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q,{children:"Pin Column"}),(0,r.jsxs)(H,{onClick:()=>mo(l.column.id,"right"),disabled:l.column.getIsPinned()==="right",children:[(0,r.jsx)(z.MoveRightIcon,{}),"Pin Right"]}),(0,r.jsxs)(H,{onClick:()=>mo(l.column.id,!1),disabled:!l.column.getIsPinned(),children:[(0,r.jsx)(z.PinOffIcon,{}),"Unpin"]})]})]})]})]}),so&&l.column.getCanResize()&&!g&&l.colSpan===1&&(0,r.jsx)("div",{className:"absolute top-0 right-0 w-1 h-full transition-opacity opacity-0 bg-border hover:bg-primary cursor-col-resize hover:opacity-100",onMouseDown:l.getResizeHandler()})]},l.id)})},d.id)),gt=d=>{if(!j)return;let p=0,l=y.getLeftHeaderGroups()[0]?.headers||[],s=[...ce?["serialNumber"]:[],...J?["select"]:[]];for(let g of l){if(g.id===d.id)break;if(s.includes(g.id)){let h=y.getColumn(g.id);h&&(p+=h.getSize())}}return p},ft=d=>{if(!j)return;let p=y.getState().columnPinning.right||[],l=p.indexOf(d.id);if(l===-1)return;let s=0;for(let g=l+1;g<p.length;g++){let h=y.getColumn(p[g]);h&&(s+=h.getSize())}return s};if(_)return(0,r.jsx)(Kt,{className:"w-full shadow-sm rounded-xl",children:(0,r.jsx)(Jt,{className:"flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"mb-3 text-2xl text-red-500",children:"\u26A0\uFE0F"}),(0,r.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:_}),le&&(0,r.jsxs)(C,{variant:"outline",size:"sm",onClick:le,className:"rounded-lg",children:[(0,r.jsx)(z.Loader2,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});let vn=d=>d&&typeof d=="object"&&"content"in d,oe=(0,x.useMemo)(()=>u?vn(u)?{content:u.content,align:u.align||"left",className:u.className||"",sticky:u.sticky!==void 0?u.sticky:!0,showOnEmpty:u.showOnEmpty!==void 0?u.showOnEmpty:!0}:{content:u,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[u]),Ut=()=>Ze?(0,r.jsx)(Dt,{table:y,filters:i,globalFilter:Ae,onGlobalFilterChange:Te,enableGlobalFilter:ro,onExport:ve,onRefresh:le,loading:S,enableColumnVisibility:Et,enableColumnPinning:j,data:jt,onClearSorting:un,onClearFilters:pn,onExternalSearch:_e,onCustomFilterChange:cn,aggregations:de,onAggregationChange:dt}):null,hn=()=>{let d=0;return ze==="above-header"&&(d+=Be),oe&&(d+=c),ze==="below-header"&&(d+=ut),d};return(0,r.jsx)(tt,{children:(0,r.jsxs)("div",{className:n("w-full space-y-2 flex flex-col h-full",L),children:[Ze&&ze==="default"&&(0,r.jsx)("div",{ref:Se,className:"relative z-40",children:Ut()}),(0,r.jsx)(Kt,{className:n("shadow-sm overflow-hidden py-0",rn&&"flex-1",!Gt&&"rounded-none"),children:(0,r.jsx)(Jt,{className:"h-full p-0",children:(0,r.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[S&&(0,r.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-xl",children:(0,r.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg shadow-sm bg-background/90",children:[(0,r.jsx)(z.Loader2,{className:"size-5 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,r.jsx)("div",{ref:T,className:n("relative overflow-auto border-b",y.getRowModel().rows?.length===0&&"h-full",Gt&&"rounded-t-xl"),style:{maxHeight:v},children:(0,r.jsxs)(Wt,{className:n("w-full border-collapse relative",y.getRowModel().rows?.length===0&&"h-full"),children:[Ze&&ze==="above-header"&&(0,r.jsx)("thead",{className:"sticky top-0 z-40 bg-sidebar border-b",children:(0,r.jsx)(pe,{className:"hover:bg-transparent",children:(0,r.jsx)(ge,{colSpan:He.length,className:n("p-2 bg-sidebar border-b shadow-sm",!Gt&&"rounded-none"),children:(0,r.jsx)("div",{ref:ke,children:Ut()})})})}),oe&&(oe.showOnEmpty||y.getRowModel().rows?.length>0)&&(0,r.jsx)("thead",{className:n("sticky bg-sidebar border-b",G&&"shadow-sm"),style:{top:ze==="above-header"?`${Be}px`:"0px",zIndex:35},children:(0,r.jsx)(pe,{className:"hover:bg-transparent",children:(0,r.jsx)(ge,{colSpan:He.length,className:n("p-2 font-semibold text-foreground bg-sidebar",et?"py-2":"py-4",oe.className),children:(0,r.jsx)("div",{ref:Re,className:n("flex items-center w-full",oe.align==="center"&&"justify-center",oe.align==="right"&&"justify-end",oe.align==="left"&&"justify-start"),children:typeof oe.content=="string"?(0,r.jsx)("span",{className:"text-lg font-bold tracking-tight text-foreground",children:oe.content}):oe.content})})})}),Ze&&ze==="below-header"&&(0,r.jsx)("thead",{className:n("sticky bg-sidebar border-b",G&&"shadow-sm"),style:{top:oe?`${c}px`:"0px",zIndex:35},children:(0,r.jsx)(pe,{className:"hover:bg-transparent",children:(0,r.jsx)(ge,{colSpan:He.length,className:"p-2 bg-sidebar",children:(0,r.jsx)("div",{ref:xe,children:Ut()})})})}),!sn&&(0,r.jsx)(ho,{className:n("sticky bg-sidebar",G&&"shadow-sm"),style:{top:`${hn()}px`,zIndex:30},children:bn()}),(0,r.jsx)(xo,{children:y.getRowModel().rows?.length?y.getRowModel().rows.map((d,p)=>{let l=Ve?Ve(d):"";return(0,r.jsx)(pe,{"data-state":d.getIsSelected()&&"selected",className:n(an&&"hover:bg-muted/50",nn&&p%2===0&&"bg-muted/20",d.getIsSelected()&&"bg-muted","border-b last:border-b-0",Ce==="single"&&"cursor-pointer",l),onClick:()=>{Ce==="single"&&mn(d)},children:d.getVisibleCells().map((s,g)=>{let h=j&&(s.column.getIsPinned()==="left"||s.column.id==="serialNumber"||s.column.id==="select"&&J),D=j&&s.column.getIsPinned()==="right",k=s.column.id==="serialNumber",V=s.column.id==="select",O=k||V&&pt;return(0,r.jsx)(ge,{className:n(et?"py-2":"py-4",io&&g<d.getVisibleCells().length&&"border-r",h&&"sticky left-0 z-20 bg-sidebar/95",D&&"sticky right-0 z-20 bg-sidebar/95",k&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:s.column.getSize()!==150?s.column.getSize():"auto",minWidth:s.column.getSize()!==150?s.column.getSize():"auto",...h&&{left:k?0:V?ce&&y.getColumn("serialNumber")?.getSize()||0:gt(s.column)},...D&&{right:ft(s.column)},...k&&{left:0}},children:(0,X.flexRender)(s.column.columnDef.cell,s.getContext())},s.id)})},d.id)}):(0,r.jsx)(pe,{children:(0,r.jsx)(ge,{colSpan:He.length,className:"h-32 text-center border-0",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("div",{className:"text-6xl text-muted-foreground",children:"\u{1F4CB}"}),(0,r.jsx)("p",{className:"font-medium text-muted-foreground",children:U})]})})})}),gn()]})}),F&&(0,r.jsx)("div",{className:"sticky bottom-0 z-10 w-full bg-sidebar",style:{width:"100%",minWidth:"fit-content"},children:(0,r.jsx)(Wt,{children:(0,r.jsx)(Xt,{children:(0,r.jsx)(pe,{className:"bg-sidebar",children:(0,r.jsx)(ge,{colSpan:He.length,className:"p-2",children:F})})})})})]})})}),(0,r.jsx)(Tt,{table:y,config:m}),K&&K(y)]})})}var Uo=require("radix-ui");var $o=require("react/jsx-runtime");function St({className:e,orientation:t="horizontal",decorative:i=!0,...m}){return(0,$o.jsx)(Uo.Separator.Root,{"data-slot":"separator-root",decorative:i,orientation:t,className:n("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...m})}var kt=require("lucide-react"),Rt=require("framer-motion"),Ne=qt(require("react"),1),qo=qt(require("react-dom"),1),M=require("react/jsx-runtime");function Wo({table:e,visible:t,container:i,children:m,className:b,...u}){let[F,L]=Ne.useState(!1);Ne.useLayoutEffect(()=>{L(!0)},[]),Ne.useEffect(()=>{function _(U){U.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e]);let v=i??(F?globalThis.document?.body:null);if(!v||!e)return null;let S=t??e.getFilteredSelectedRowModel().rows.length>0;return qo.createPortal((0,M.jsx)(Rt.AnimatePresence,{children:S&&(0,M.jsx)(Rt.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:n("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",b),...u,children:(0,M.jsx)(tt,{children:m})})}),v)}function Xo({size:e="sm",tooltip:t,isPending:i,disabled:m,className:b,children:u,...F}){let L=(0,M.jsx)(C,{variant:"secondary",size:e,className:n("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",b),disabled:m||i,...F,children:i?(0,M.jsx)(kt.Loader,{className:"animate-spin"}):u});return t?(0,M.jsxs)(Yt,{children:[(0,M.jsx)(Zt,{asChild:!0,children:L}),(0,M.jsx)(eo,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,M.jsx)("p",{children:t})})]}):L}function Ko({table:e}){let t=Ne.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,M.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,M.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,M.jsx)(St,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,M.jsxs)(Yt,{children:[(0,M.jsx)(Zt,{asChild:!0,children:(0,M.jsx)(C,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,M.jsx)(kt.X,{className:"size-3.5"})})}),(0,M.jsxs)(eo,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,M.jsx)("p",{children:"Clear selection"}),(0,M.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,M.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var Pe=require("lucide-react");var A=require("react/jsx-runtime");function Jo({column:e,title:t,className:i}){return e.getCanSort()?(0,A.jsx)("div",{className:n("flex items-center space-x-2",i),children:(0,A.jsxs)(ae,{children:[(0,A.jsx)(re,{asChild:!0,children:(0,A.jsxs)(C,{variant:"ghost",size:"sm",className:"-ml-3 h-8 data-[state=open]:bg-accent",children:[(0,A.jsx)("span",{children:t}),e.getIsSorted()==="desc"?(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"}):e.getIsSorted()==="asc"?(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"}):(0,A.jsx)(Pe.ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),(0,A.jsxs)(ie,{align:"start",className:"rounded-lg",children:[(0,A.jsxs)(H,{onClick:()=>e.toggleSorting(!1),children:[(0,A.jsx)(Pe.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),(0,A.jsxs)(H,{onClick:()=>e.toggleSorting(!0),children:[(0,A.jsx)(Pe.ArrowUpDown,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),(0,A.jsx)(ee,{}),(0,A.jsxs)(H,{onClick:()=>e.toggleVisibility(!1),children:[(0,A.jsx)(Pe.EyeOff,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Hide"]})]})]})}):(0,A.jsx)("div",{className:n(i),children:t})}var zt=require("lucide-react");var se=require("react/jsx-runtime");function Qo({table:e}){return(0,se.jsxs)(ae,{children:[(0,se.jsx)(re,{asChild:!0,children:(0,se.jsxs)(C,{variant:"outline",size:"sm",className:"rounded-lg",children:[(0,se.jsx)(zt.Eye,{className:"mr-2 h-4 w-4"}),"Columns ",(0,se.jsx)(zt.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),(0,se.jsxs)(ie,{align:"end",className:"w-[200px] rounded-lg",children:[(0,se.jsx)(Q,{children:"Toggle Columns"}),(0,se.jsx)(ee,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>(0,se.jsx)(Oe,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:i=>t.toggleVisibility(!!i),children:t.id},t.id))]})]})}var Yo=require("radix-ui"),Zo=require("class-variance-authority");var en=require("react/jsx-runtime"),Fn=(0,Zo.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Mt({className:e,variant:t,asChild:i=!1,...m}){let b=i?Yo.Slot.Slot:"span";return(0,en.jsx)(b,{"data-slot":"badge",className:n(Fn({variant:t}),e),...m})}var It=require("lucide-react"),N=require("react/jsx-runtime");function tn({column:e,title:t,options:i}){let m=e?.getFacetedUniqueValues(),b=new Set(e?.getFilterValue());return(0,N.jsxs)(Ee,{children:[(0,N.jsx)(Ge,{asChild:!0,children:(0,N.jsxs)(C,{variant:"outline",size:"sm",className:"h-9 border-dashed rounded-lg",children:[(0,N.jsx)(It.PlusCircleIcon,{className:"mr-2 h-4 w-4"}),t,b?.size>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(St,{orientation:"vertical",className:"mx-2 h-4"}),(0,N.jsx)(Mt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:b.size}),(0,N.jsx)("div",{className:"hidden space-x-1 lg:flex",children:b.size>2?(0,N.jsxs)(Mt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[b.size," selected"]}):i.filter(u=>b.has(u.value)).map(u=>(0,N.jsx)(Mt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:u.label},u.value))})]})]})}),(0,N.jsx)(je,{className:"w-[200px] p-0 rounded-lg",align:"start",children:(0,N.jsxs)(xt,{className:"rounded-lg",children:[(0,N.jsx)(Ct,{placeholder:t}),(0,N.jsxs)(yt,{children:[(0,N.jsx)(wt,{children:"No results found."}),(0,N.jsx)(ot,{children:i.map(u=>{let F=b.has(u.value);return(0,N.jsxs)(Le,{onSelect:()=>{F?b.delete(u.value):b.add(u.value);let L=Array.from(b);e?.setFilterValue(L.length?L:void 0)},children:[(0,N.jsx)("div",{className:n("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",F?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:(0,N.jsx)(It.CheckIcon,{className:n("h-4 w-4")})}),u.icon&&(0,N.jsx)(u.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),(0,N.jsx)("span",{children:u.label}),m?.get(u.value)&&(0,N.jsx)("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:m.get(u.value)})]},u.value)})}),b.size>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Po,{}),(0,N.jsx)(ot,{children:(0,N.jsx)(Le,{onSelect:()=>e?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}0&&(module.exports={DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTableColumnHeader,DataTableFacetedFilter,DataTablePagination,DataTableToolbar,DataTableViewOptions});
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|