@akshar-technosoft/ui 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client"
2
- import{flexRender as Qt,getCoreRowModel as Wa,getFilteredRowModel as Ja,getPaginationRowModel as qa,getSortedRowModel as Xa,useReactTable as Ka}from"@tanstack/react-table";import{Loader2 as ko,ChevronUp as eo,ChevronDown as to,ChevronsUpDown as Ya,MoreHorizontal as Za,MoveRightIcon as Qa,PinOffIcon as en}from"lucide-react";import{Slot as fa}from"radix-ui";import{cva as ga}from"class-variance-authority";import{clsx as pa}from"clsx";import{twMerge as ua}from"tailwind-merge";function o(...e){return ua(pa(e))}import{jsx as ba}from"react/jsx-runtime";var Rt=ga("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 g({className:e,variant:t,size:a,asChild:n=!1,...s}){let i=n?fa.Slot:"button";return ba(i,{"data-slot":"button",className:o(Rt({variant:t,size:a,className:e}),"transition-none"),...s})}import{jsx as ke}from"react/jsx-runtime";function jt({className:e,...t}){return ke("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:ke("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function go({className:e,...t}){return ke("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function bo({className:e,...t}){return ke("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function vo({className:e,...t}){return ke("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function pt({className:e,...t}){return ke("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ho({className:e,...t}){return ke("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function Mt({className:e,...t}){return ke("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as xo}from"react/jsx-runtime";function be({className:e,...t}){return xo("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ve({className:e,...t}){return xo("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as Ze}from"radix-ui";import{jsx as Qe,jsxs as va}from"react/jsx-runtime";function Ee({delayDuration:e=0,...t}){return Qe(Ze.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Re({...e}){return Qe(Ee,{children:Qe(Ze.Root,{"data-slot":"tooltip",...e})})}function Me({...e}){return Qe(Ze.Trigger,{"data-slot":"tooltip-trigger",...e})}function ze({className:e,sideOffset:t=0,children:a,...n}){return Qe(Ze.Portal,{children:va(Ze.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("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),...n,children:[a,Qe(Ze.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as Po,RefreshCw as Aa,Download as Ia,Settings2 as Ba,Filter as To,ArrowUpDown as Fa,PinOff as _a,Pin as La,ChevronDown as Oa}from"lucide-react";import{jsx as ha}from"react/jsx-runtime";function et({className:e,type:t,...a}){return ha("input",{type:t,"data-slot":"input",className:o("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),...a})}import{Select as de}from"radix-ui";import{CheckIcon as xa,ChevronDownIcon as yo,ChevronUpIcon as ya}from"lucide-react";import{jsx as K,jsxs as $t}from"react/jsx-runtime";function Ae({...e}){return K(de.Root,{"data-slot":"select",...e})}function Ie({...e}){return K(de.Value,{"data-slot":"select-value",...e})}function Be({className:e,size:t="default",children:a,...n}){return $t(de.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("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),...n,children:[a,K(de.Icon,{asChild:!0,children:K(yo,{className:"size-4 opacity-50"})})]})}function Fe({className:e,children:t,position:a="popper",...n}){return K(de.Portal,{children:$t(de.Content,{"data-slot":"select-content",className:o("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",a==="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:a,...n,children:[K(Ca,{}),K(de.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),K(wa,{})]})})}function he({className:e,children:t,...a}){return $t(de.Item,{"data-slot":"select-item",className:o("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),...a,children:[K("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:K(de.ItemIndicator,{children:K(xa,{className:"size-4"})})}),K(de.ItemText,{children:t})]})}function Ca({className:e,...t}){return K(de.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:K(ya,{className:"size-4"})})}function wa({className:e,...t}){return K(de.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:K(yo,{className:"size-4"})})}import{DropdownMenu as xe}from"radix-ui";import{CheckIcon as Na,ChevronRightIcon as Gr,CircleIcon as Er}from"lucide-react";import{jsx as me,jsxs as Pa}from"react/jsx-runtime";function ye({...e}){return me(xe.Root,{"data-slot":"dropdown-menu",...e})}function Ce({...e}){return me(xe.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function we({className:e,sideOffset:t=4,...a}){return me(xe.Portal,{children:me(xe.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("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),...a})})}function Ut({...e}){return me(xe.Group,{"data-slot":"dropdown-menu-group",...e})}function W({className:e,inset:t,variant:a="default",...n}){return me(xe.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("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),...n})}function zt({className:e,children:t,checked:a,...n}){return Pa(xe.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("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:a,...n,children:[me("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:me(xe.ItemIndicator,{children:me(Na,{className:"size-4"})})}),t]})}function ne({className:e,inset:t,...a}){return me(xe.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function re({className:e,...t}){return me(xe.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}import{useState as Va}from"react";import{useEffect as Ma,useState as Xt}from"react";import{Calendar as za}from"lucide-react";import{format as ut}from"date-fns";import{Popover as At}from"radix-ui";import{jsx as It}from"react/jsx-runtime";function Wt({...e}){return It(At.Root,{"data-slot":"popover",...e})}function Jt({...e}){return It(At.Trigger,{"data-slot":"popover-trigger",...e})}function qt({className:e,align:t="center",sideOffset:a=4,...n}){return It(At.Portal,{children:It(At.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("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),...n})})}import*as Bt from"react";import{ChevronDownIcon as Ta,ChevronLeftIcon as Sa,ChevronRightIcon as Da}from"lucide-react";import{DayPicker as ka,getDefaultClassNames as Co}from"react-day-picker";import{jsx as _e}from"react/jsx-runtime";function wo({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:i,components:m,...x}){let p=Co();return _e(ka,{showOutsideDays:a,className:o("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:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...i},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(Rt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(Rt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",n==="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",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("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",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:d,rootRef:c,...N})=>_e("div",{"data-slot":"calendar",ref:c,className:o(d),...N}),Chevron:({className:d,orientation:c,...N})=>c==="left"?_e(Sa,{className:o("size-4",d),...N}):c==="right"?_e(Da,{className:o("size-4",d),...N}):_e(Ta,{className:o("size-4",d),...N}),DayButton:Ra,WeekNumber:({children:d,...c})=>_e("td",{...c,children:_e("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...m},...x})}function Ra({className:e,day:t,modifiers:a,...n}){let s=Co(),i=Bt.useRef(null);return Bt.useEffect(()=>{a.focused&&i.current?.focus()},[a.focused]),_e(g,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("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",s.day,e),...n})}import{jsx as He,jsxs as ft}from"react/jsx-runtime";function No({value:e,onChange:t,placeholder:a,mode:n,externalSearch:s,onExternalChange:i,onlyExternal:m=!1}){let[x,p]=Xt(!1),[d,c]=Xt(e),[N,D]=Xt(e);Ma(()=>{m||D(e)},[e,m]);let M=()=>{m||t(d),D(d),s&&i&&i(d),p(!1)},k=()=>{c(N),p(!1)},S=()=>{let C=n==="single"?null:{from:null,to:null};c(C),m||t(C),D(C),s&&i&&i(C),p(!1)},z=()=>{let C=m?N:e;return C?n==="single"?ut(C,"PPP"):C.from&&C.to?`${ut(C.from,"MMM dd")} - ${ut(C.to,"MMM dd, yyyy")}`:C.from?`From ${ut(C.from,"MMM dd, yyyy")}`:C.to?`To ${ut(C.to,"MMM dd, yyyy")}`:a:a},I=C=>{c(n==="single"?C:C||{from:null,to:null})};return ft(Wt,{open:x,onOpenChange:p,children:[He(Jt,{asChild:!0,children:ft(g,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!z()&&"text-muted-foreground"),children:[He(za,{className:"mr-2 h-4 w-4"}),z()]})}),ft(qt,{className:"w-auto p-0",align:"start",children:[He("div",{className:"p-3",children:He(wo,{mode:n,selected:d,onSelect:I,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),ft("div",{className:"flex items-center justify-between p-3 border-t",children:[He(g,{variant:"ghost",size:"sm",onClick:S,children:"Clear"}),ft("div",{className:"flex gap-2",children:[He(g,{variant:"outline",size:"sm",onClick:k,children:"Cancel"}),He(g,{size:"sm",onClick:M,disabled:n==="range"&&(!d?.from||!d?.to),children:"Apply"})]})]})]})]})}import{Fragment as Ga,jsx as w,jsxs as O}from"react/jsx-runtime";function Kt({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:n,enableGlobalFilter:s=!0,onExport:i,onRefresh:m,loading:x=!1,enableColumnVisibility:p=!0,data:d,onClearSorting:c,onClearFilters:N,enableColumnPinning:D=!1,onExternalSearch:M}){let[k,S]=Va({}),z=()=>e.getAllLeafColumns().filter(l=>l.getCanHide?.()!==!1),I=()=>e.getAllColumns().filter(l=>!e.getAllLeafColumns().includes(l)&&l.columns?.length&&l.columns.some(u=>u.getCanHide?.()!==!1)),C=()=>{let l=new Set(I().flatMap(u=>u.columns?.filter(E=>E.getCanHide?.()!==!1).map(E=>E.id)||[]));return z().filter(u=>!l.has(u.id))},ee=(l,u)=>u&&l.startsWith(`${u}.`)?l.replace(`${u}.`,"").split("_").map(Y=>Y.slice(1)).join(" "):l.split("_").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join(" "),y=(l,u)=>{let E={...k,[l]:u};S(E)},A=()=>{M&&M(k)},fe=()=>{S({}),N(),M&&M({})},se=l=>e.getColumn(l)?.getFilterValue(),ae=(l,u)=>{e.getColumn(l)?.setFilterValue(u)};return w("div",{className:"rounded-xl",children:w("div",{className:"px-2",children:w("div",{className:"flex flex-col gap-6",children:O("div",{className:"flex items-center justify-between",children:[w("div",{className:"flex items-center gap-3",children:t.length>0&&O("div",{className:"flex items-center gap-3 flex-wrap",children:[w("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:w(To,{className:"h-4 w-4"})}),t.map(l=>w("div",{className:o("relative min-w-[150px]",l.width),children:l.type==="select"?O(Ae,{value:se(l.key)??"",onValueChange:u=>{ae(l.key,u==="all"?"":u),l.externalSearch&&y(l.key,u==="all"?"":u)},children:[l.icon&&w("span",{children:w(l.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),w(Be,{className:o("h-9 rounded-lg w-full",l.icon&&"pl-9"),children:w(Ie,{placeholder:l.placeholder})}),O(Fe,{className:"rounded-lg",children:[w(he,{value:"all",children:"All"}),l.options?.map(u=>w(he,{value:u.value,children:u.label},u.label))]})]}):l.type==="date"?w(No,{value:se(l.key),onChange:u=>{l.onlyExternal||ae(l.key,u)},placeholder:l.placeholder,mode:l.dateMode||"single",externalSearch:l.externalSearch,onlyExternal:l.onlyExternal,onExternalChange:u=>y(l.key,u)}):O("div",{className:"relative",children:[l.icon&&w("span",{children:w(l.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),w(et,{placeholder:l.placeholder,value:se(l.key)??"",onChange:u=>{ae(l.key,u.target.value),l.externalSearch&&y(l.key,u.target.value)},className:o("h-9 rounded-lg",l.icon&&"pl-9"),type:l.type==="number"?"number":"text"})]})},l.key)),t.some(l=>l.externalSearch)&&O(g,{variant:"default",size:"sm",onClick:A,className:"rounded-lg",children:[w(Po,{className:"mr-2 h-4 w-4"}),t.find(l=>l.externalSearch)?.searchButtonText||"Search"]})]})}),O("div",{className:"flex items-center gap-2",children:[s&&O("div",{className:"relative",children:[w(Po,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),w(et,{placeholder:"Global search...",value:a??"",onChange:l=>n(l.target.value),className:"pl-9 max-w-max"})]}),i&&O(g,{variant:"outline",size:"sm",onClick:()=>i(d),className:"rounded-lg",children:[w(Ia,{className:"mr-2 h-4 w-4"}),"Export"]}),p&&O(ye,{children:[w(Ce,{asChild:!0,children:O(g,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[w("span",{children:"Columns"}),w(Oa,{className:"h-4 w-4 opacity-50"})]})}),O(we,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[w(ne,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),w(re,{}),C().length>0&&O(Ut,{children:[w(ne,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),C().map(l=>w(zt,{className:"text-sm",checked:l.getIsVisible(),onCheckedChange:u=>l.toggleVisibility(!!u),children:ee(l.id)},l.id))]}),I().map(l=>O(Ut,{children:[w(re,{}),w(ne,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:l.id}),l.columns?.filter(u=>u.getCanHide?.()!==!1).map(u=>w(zt,{className:"text-sm",checked:u.getIsVisible(),onCheckedChange:E=>u.toggleVisibility(!!E),children:ee(u.id,l.id)},u.id))]},l.id))]})]}),O(ye,{children:[w(Ce,{asChild:!0,children:w(g,{variant:"outline",size:"sm",className:"rounded-lg",children:w(Ba,{className:"h-4 w-4"})})}),O(we,{align:"end",className:"w-[200px] rounded-lg",children:[w(ne,{children:"Table Settings"}),w(re,{}),O(W,{onClick:c,children:[w(Fa,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),O(W,{onClick:fe,children:[w(To,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),D&&O(Ga,{children:[w(re,{}),w(ne,{children:"Column Pinning"}),O(W,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[w(_a,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),O(W,{onClick:()=>{let l=z().filter(u=>u.getCanPin?.()!==!1).map(u=>u.id);e.setColumnPinning({left:[],right:l})},children:[w(La,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),m&&w(g,{variant:"outline",size:"sm",onClick:m,disabled:x,className:"rounded-lg",children:w(Aa,{className:o("h-4 w-4",x&&"animate-spin")})})]})]})})})})}import{jsx as te,jsxs as tt}from"react/jsx-runtime";function Yt({table:e,config:t}){return t.enabled?te("div",{className:"rounded-xl",children:te("div",{children:tt("div",{className:"flex items-center justify-between",children:[te("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&tt("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"]})}),tt("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&tt("div",{className:"flex items-center gap-2",children:[te("span",{className:"text-sm font-medium",children:"Rows per page:"}),tt(Ae,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[te(Be,{className:"h-9 w-[70px] rounded-lg",children:te(Ie,{})}),te(Fe,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>te(he,{value:`${a}`,children:a},a))})]})]}),tt("div",{className:"flex items-center gap-2",children:[te(g,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),te(g,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&te("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,n)=>{let s=e.getState().pagination.pageIndex,i=s+n;return i<1||i>e.getPageCount()?null:te(g,{variant:i===s+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(i-1),children:i},i)})}),te(g,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),te(g,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as Ea}from"radix-ui";import{cva as Ha}from"class-variance-authority";import{jsx as $a}from"react/jsx-runtime";var ja=Ha("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 So({className:e,variant:t,size:a,noBg:n,...s}){return $a(Ea.Root,{"data-slot":"toggle",className:o(ja({className:e,variant:t,size:a,bg:n?"disabled":"enabled"})),...s})}import{Checkbox as Do}from"radix-ui";import{CheckIcon as Ua}from"lucide-react";import{jsx as Zt}from"react/jsx-runtime";function gt({className:e,...t}){return Zt(Do.Root,{"data-slot":"checkbox",className:o("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:Zt(Do.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:Zt(Ua,{className:"size-3.5"})})})}import{useCallback as Ro,useEffect as oo,useMemo as tn,useState as je}from"react";import{Fragment as Mo,jsx as v,jsxs as j}from"react/jsx-runtime";function zo({data:e,columns:t,filters:a=[],pagination:n={enabled:!1},settings:s={},header:i,footer:m,className:x="",maxHeight:p="600px",loading:d=!1,error:c,emptyMessage:N="No data available",onRowSelectionChange:D,onExport:M,onRefresh:k,onTableReady:S,children:z,isRowDisabled:I,isRowSelectable:C,onExternalSearch:ee}){let[y,A]=je([]),[fe,se]=je([]),[ae,l]=je({}),[u,E]=je({}),[Y,Se]=je(""),[Ge,yt]=je([]),[Ne,Ct]=je(s.enableColumnPinning?{left:[],right:[]}:{}),{enableSorting:ge=!0,enableFiltering:We=!0,enableGlobalFilter:De=!0,enableColumnVisibility:Je=!0,enableRowSelection:B=!0,stickyHeader:qe=!0,toolbar:Xe=!1,showSerialNumbers:le=!0,fixedCheckboxColumn:ce=!0,striped:Vt=!0,hoverable:wt=!0,compact:Gt=!0,bordered:H=!0,fullHeight:Nt=!1,enableColumnResizing:Pt=!1,enableColumnPinning:J=!0,hideHeader:Tt=!1}=s,dt=tn(()=>{let R=[...t],b=f=>f.map(h=>{if(h.id==="select"||h.id==="serialNumber")return h;let P={...h,enablePinning:!0};return h.columns&&(P.columns=b(h.columns)),P}),r=b(R);if(B){let f={id:"select",header:({table:h})=>{let P=h.getRowModel().rows.filter(U=>!I?.(U.original)&&(C?C(U.original):!0)),L=P.length>0&&P.every(U=>U.getIsSelected()),q=P.some(U=>U.getIsSelected());return v(gt,{checked:L||q&&"indeterminate",onCheckedChange:U=>{P.forEach(Ke=>Ke.toggleSelected(!!U))},"aria-label":"Select all selectable rows"})},cell:({row:h})=>{let P=I?I(h.original):!1,L=C?C(h.original):!0;return v("div",{className:o("flex items-center justify-center",P&&"opacity-50"),children:v(gt,{checked:h.getIsSelected(),onCheckedChange:q=>L&&h.toggleSelected(!!q),"aria-label":"Select row",disabled:P||!L})})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:10};r.unshift(f)}if(le){let f={id:"serialNumber",header:"No.",cell:({row:h})=>v("div",{className:"text-center font-medium text-muted-foreground",children:h.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};r.unshift(f)}return r},[t,le,B,ce,I,C]),_=Ka({data:e,columns:dt,onSortingChange:ge?A:void 0,onColumnFiltersChange:We?se:void 0,onGlobalFilterChange:De?Se:void 0,getCoreRowModel:Wa(),getPaginationRowModel:n.enabled?qa():void 0,getSortedRowModel:ge?Xa():void 0,getFilteredRowModel:We?Ja():void 0,onColumnVisibilityChange:Je?l:void 0,onRowSelectionChange:B?E:void 0,onColumnOrderChange:yt,onColumnPinningChange:J?Ct:void 0,state:{sorting:ge?y:void 0,columnFilters:We?fe:void 0,columnVisibility:Je?ae:void 0,rowSelection:B?u:{},globalFilter:Y,columnOrder:Ge,columnPinning:J?Ne:{}},initialState:{pagination:n.enabled?{pageSize:n.pageSize||10}:void 0,columnPinning:J?{left:[...le?["serialNumber"]:[],...B?["select"]:[]],right:[]}:void 0},enableRowSelection:B,enableColumnResizing:Pt,enableColumnPinning:J,columnResizeMode:"onChange"});oo(()=>{S&&S(_)},[_,S]),oo(()=>{if(B&&D){let R=_.getFilteredSelectedRowModel().rows.map(b=>b.original);D(R)}},[u,B,D,_]),oo(()=>{if(B&&D){let R=_.getFilteredSelectedRowModel().rows.filter(b=>!I?.(b.original)&&(C?C(b.original):!0)).map(b=>b.original);D(R)}},[u,B,D,_,I,C]);let St=Ro(()=>{A([])},[]),Et=Ro(()=>{se([]),Se("")},[]),ct=(R,b)=>{if(!J)return;let r=[...le?["serialNumber"]:[],...B&&ce?["select"]:[]],f={left:[...(Ne.left??[]).filter(h=>r.includes(h))],right:[...Ne.right??[]]};b===!1?(f.left=f.left.filter(h=>h!==R),f.right=f.right.filter(h=>h!==R)):b==="right"?(f.left=f.left.filter(h=>h!==R),f.right.includes(R)||f.right.push(R)):b==="left"&&(f.right=f.right.filter(h=>h!==R),!f.left.includes(R)&&!r.includes(R)&&f.left.push(R)),_.setColumnPinning(f)},mt=()=>v(go,{className:o(qe&&"sticky top-0 bg-sidebar z-20"),children:_.getHeaderGroups().map((R,b)=>v(pt,{className:"hover:bg-transparent",children:R.headers.map((r,f)=>{let h=r.depth===0&&r.colSpan>1,P=J&&(r.column.getIsPinned()==="left"||r.column.id==="serialNumber"||r.column.id==="select"&&B),L=J&&r.column.getIsPinned()==="right",q=r.column.getCanSort(),U=J&&r.column.columnDef.enablePinning!==!1,Ke=r.column.id==="serialNumber",Ht=r.column.id==="select",fo=Ke||Ht&&ce,Ye=r.column.columnDef.headerAlign||"left",ma={left:"justify-start",center:"justify-center",right:"justify-end"}[Ye];return j(ho,{colSpan:r.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!Gt&&"py-2",H&&f<R.headers.length-1&&"border-r","relative",P&&"sticky left-0 z-15 bg-sidebar",L&&"sticky right-0 z-15 bg-sidebar",(Ke||Ht)&&"sticky left-0 z-15 bg-sidebar",h?"text-center":"text-left"),style:{width:r.getSize()!==150?r.getSize():"auto",minWidth:r.getSize()!==150?r.getSize():"auto",...P&&{left:Ke?0:Ht?le&&_.getColumn("serialNumber")?.getSize()||0:Dt(r.column)},...L&&{right:kt(r.column)},...Ke&&{left:0}},children:[h?v("div",{className:"flex items-center justify-center",children:Qt(r.column.columnDef.header,r.getContext())}):j("div",{className:o("relative flex items-center w-full px-2",ma),children:[j("div",{className:"flex items-center gap-1",children:[q&&Ye==="right"&&v("span",{className:"ml-1 order-2",children:r.column.getIsSorted()&&{asc:v(eo,{className:"h-4 w-4"}),desc:v(to,{className:"h-4 w-4"})}[r.column.getIsSorted()]}),r.isPlaceholder?null:Qt(r.column.columnDef.header,r.getContext()),q&&Ye!=="right"&&r.column.getIsSorted()&&v("span",{className:"ml-1 order-2",children:r.column.getIsSorted()&&{asc:v(eo,{className:"h-4 w-4"}),desc:v(to,{className:"h-4 w-4"})}[r.column.getIsSorted()]})]}),(q||U&&!fo)&&j(ye,{children:[v(Ce,{asChild:!0,className:o("absolute",Ye==="left"&&"right-1",Ye==="center"&&"right-1",Ye==="right"&&"left-1"),children:v(So,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:v(Za,{className:"h-4 w-4"})})}),j(we,{align:"end",className:"w-48",children:[q&&j(Mo,{children:[v(ne,{children:"Sorting"}),j(W,{onClick:()=>r.column.toggleSorting(!1),children:[v(eo,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),j(W,{onClick:()=>r.column.toggleSorting(!0),children:[v(to,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),j(W,{onClick:()=>r.column.clearSorting(),disabled:!r.column.getIsSorted(),children:[v(Ya,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),v(re,{})]}),U&&!fo&&j(Mo,{children:[v(ne,{children:"Pin Column"}),j(W,{onClick:()=>ct(r.column.id,"right"),disabled:r.column.getIsPinned()==="right",children:[v(Qa,{}),"Pin Right"]}),j(W,{onClick:()=>ct(r.column.id,!1),disabled:!r.column.getIsPinned(),children:[v(en,{}),"Unpin"]})]})]})]})]}),Pt&&r.column.getCanResize()&&!h&&r.colSpan===1&&v("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:r.getResizeHandler()})]},r.id)})},R.id))}),Dt=R=>{if(!J)return;let b=0,r=_.getLeftHeaderGroups()[0]?.headers||[],f=[...le?["serialNumber"]:[],...B?["select"]:[]];for(let h of r){if(h.id===R.id)break;if(f.includes(h.id)){let P=_.getColumn(h.id);P&&(b+=P.getSize())}}return b},kt=R=>{if(!J)return;let b=_.getState().columnPinning.right||[],r=b.indexOf(R.id);if(r===-1)return;let f=0;for(let h=r+1;h<b.length;h++){let P=_.getColumn(b[h]);P&&(f+=P.getSize())}return f};return c?v(be,{className:"w-full rounded-xl shadow-sm",children:v(ve,{className:"flex items-center justify-center",children:j("div",{className:"text-center",children:[v("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),v("p",{className:"text-sm text-muted-foreground mb-4",children:c}),k&&j(g,{variant:"outline",size:"sm",onClick:k,className:"rounded-lg",children:[v(ko,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):v(Ee,{children:j("div",{className:o("w-full space-y-2 flex flex-col h-full",x),children:[i&&v(be,{className:"rounded-2xl py-2 sticky top-0 z-20",children:v(ve,{className:"px-2",children:i})}),Xe&&v(Kt,{table:_,filters:a,globalFilter:Y,onGlobalFilterChange:Se,enableGlobalFilter:De,onExport:M,onRefresh:k,loading:d,enableColumnVisibility:Je,enableColumnPinning:J,data:e,onClearSorting:St,onClearFilters:Et,onExternalSearch:ee}),v(be,{className:o("shadow-sm overflow-auto py-0",Nt&&"flex-1"),children:v(ve,{className:"p-0 h-full",children:j("div",{className:"relative flex flex-col h-full justify-between",children:[d&&v("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:j("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[v(ko,{className:"size-5 animate-spin text-primary"}),v("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),v("div",{className:"relative rounded-t-xl overflow-auto border-b",children:j(jt,{className:"border-collapse w-full",children:[!Tt&&mt(),v(bo,{children:_.getRowModel().rows?.length?_.getRowModel().rows.map((R,b)=>v(pt,{"data-state":R.getIsSelected()&&"selected",className:o(wt&&"hover:bg-muted/50",Vt&&b%2===0&&"bg-muted/20",R.getIsSelected()&&"bg-muted","border-b last:border-b-0"),children:R.getVisibleCells().map((r,f)=>{let h=J&&(r.column.getIsPinned()==="left"||r.column.id==="serialNumber"||r.column.id==="select"&&B),P=J&&r.column.getIsPinned()==="right",L=r.column.id==="serialNumber",q=r.column.id==="select",U=L||q&&ce;return v(Mt,{className:o(Gt?"py-2":"py-4",H&&f<R.getVisibleCells().length&&"border-r",h&&"sticky left-0 z-10 bg-sidebar/97",P&&"sticky right-0 z-10 bg-sidebar/97",L&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:r.column.getSize()!==150?r.column.getSize():"auto",minWidth:r.column.getSize()!==150?r.column.getSize():"auto",...h&&{left:L?0:q?le&&_.getColumn("serialNumber")?.getSize()||0:Dt(r.column)},...P&&{right:kt(r.column)},...L&&{left:0}},children:Qt(r.column.columnDef.cell,r.getContext())},r.id)})},R.id)):v(pt,{children:v(Mt,{colSpan:dt.length,className:"h-32 text-center border-0",children:j("div",{className:"flex flex-col items-center gap-3",children:[v("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),v("p",{className:"text-muted-foreground font-medium",children:N})]})})})})]})}),m&&v("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:v(jt,{children:v(vo,{children:v(pt,{className:"bg-sidebar",children:v(Mt,{colSpan:dt.length,className:"p-2",children:m})})})})})]})})}),v(Yt,{table:_,config:n}),z&&z(_)]})})}import{Separator as on}from"radix-ui";import{jsx as an}from"react/jsx-runtime";function bt({className:e,orientation:t="horizontal",decorative:a=!0,...n}){return an(on.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("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),...n})}import{Loader as nn,X as rn}from"lucide-react";import{AnimatePresence as sn,motion as ln}from"framer-motion";import*as Le from"react";import*as Ao from"react-dom";import{jsx as Z,jsxs as vt}from"react/jsx-runtime";function Io({table:e,visible:t,container:a,children:n,className:s,...i}){let[m,x]=Le.useState(!1);Le.useLayoutEffect(()=>{x(!0)},[]),Le.useEffect(()=>{function c(N){N.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=t??e.getFilteredSelectedRowModel().rows.length>0;return Ao.createPortal(Z(sn,{children:d&&Z(ln.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:o("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",s),...i,children:Z(Ee,{children:n})})}),p)}function Bo({size:e="sm",tooltip:t,isPending:a,disabled:n,className:s,children:i,...m}){let x=Z(g,{variant:"secondary",size:e,className:o("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",s),disabled:n||a,...m,children:a?Z(nn,{className:"animate-spin"}):i});return t?vt(Re,{children:[Z(Me,{asChild:!0,children:x}),Z(ze,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:Z("p",{children:t})})]}):x}function Fo({table:e}){let t=Le.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?vt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[vt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),Z(bt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),vt(Re,{children:[Z(Me,{asChild:!0,children:Z(g,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:Z(rn,{className:"size-3.5"})})}),vt(ze,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[Z("p",{children:"Clear selection"}),Z("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:Z("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as ms,EyeOff as ps}from"lucide-react";import{jsx as vs,jsxs as hs}from"react/jsx-runtime";import{ChevronDown as Cs,Eye as ws}from"lucide-react";import{jsx as Ss,jsxs as Ds}from"react/jsx-runtime";import{Slot as Ms}from"radix-ui";import{cva as dn}from"class-variance-authority";import{jsx as Fs}from"react/jsx-runtime";var Is=dn("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"}});import{Command as Zs}from"cmdk";import{SearchIcon as el}from"lucide-react";import{Dialog as Os}from"radix-ui";import{XIcon as Gs}from"lucide-react";import{jsx as js,jsxs as $s}from"react/jsx-runtime";import{jsx as nl,jsxs as rl}from"react/jsx-runtime";import{CheckIcon as wl,PlusCircleIcon as Nl}from"lucide-react";import{Fragment as Dl,jsx as Tl,jsxs as Sl}from"react/jsx-runtime";import{useState as Oe,useEffect as Lo,useMemo as no,useCallback as ot,useRef as Cn}from"react";import{Loader2 as Oo}from"lucide-react";import{Search as cn,Download as mn,RefreshCw as pn,Filter as un,ChevronDown as fn,Settings2 as gn}from"lucide-react";import{Fragment as bn,jsx as T,jsxs as X}from"react/jsx-runtime";function ao({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:n,fieldFilters:s,onFieldFilterChange:i,sortField:m,sortDirection:x,onSortChange:p,selectedCount:d,totalCount:c,visibleCount:N,onExport:D,onRefresh:M,loading:k,onClearFilters:S,onClearSorting:z}){let I=e.filter(y=>y.sortable),C=Object.values(s).some(y=>y!=null&&y!=="")||a!=="",ee=m!=="";return T("div",{className:"rounded-xl p-0.5",children:T("div",{className:"px-2",children:T("div",{className:"flex flex-col gap-6",children:X("div",{className:"flex items-center justify-between",children:[T("div",{className:"flex items-center gap-3",children:t.length>0&&X("div",{className:"flex items-center gap-3 flex-wrap",children:[T("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:T(un,{className:"h-4 w-4"})}),t.map(y=>T("div",{className:"relative min-w-[150px]",children:y.type==="select"?X(Ae,{value:s[y.key]||"all",onValueChange:A=>i(y.key,A),children:[y.icon&&T(y.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),T(Be,{className:o("h-9 rounded-lg w-full",y.icon&&"pl-9"),children:T(Ie,{placeholder:y.placeholder||"Select..."})}),X(Fe,{className:"rounded-lg",children:[T(he,{value:"all",children:"All"}),y.options?.map(A=>T(he,{value:A.value,children:A.label},A.value))]})]}):X("div",{className:"relative",children:[y.icon&&T(y.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),T(et,{type:y.type,placeholder:y.placeholder,value:s[y.key]||"",onChange:A=>i(y.key,A.target.value),className:o("h-9 rounded-lg",y.icon&&"pl-9")})]})},String(y.key)))]})}),X("div",{className:"flex items-center gap-2",children:[X("div",{className:"relative",children:[T(cn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),T(et,{placeholder:"Global search...",value:a,onChange:y=>n(y.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),I.length>0&&X(ye,{children:[T(Ce,{asChild:!0,children:X(g,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[T("span",{children:"Sort"}),T(fn,{className:"h-4 w-4 opacity-50"})]})}),X(we,{align:"end",className:"w-[200px] rounded-lg",children:[T(ne,{children:"Sort By"}),T(re,{}),I.map(y=>X("div",{children:[X(W,{onClick:()=>p(y.key,"asc"),children:[y.label," (A-Z)"]}),X(W,{onClick:()=>p(y.key,"desc"),children:[y.label," (Z-A)"]})]},String(y.key))),ee&&X(bn,{children:[T(re,{}),T(W,{onClick:z,children:"Clear All Sorting"})]})]})]}),X(ye,{children:[T(Ce,{asChild:!0,children:T(g,{variant:"outline",size:"sm",className:"rounded-lg",children:T(gn,{className:"h-4 w-4"})})}),X(we,{align:"end",className:"w-[200px] rounded-lg",children:[T(ne,{children:"Table Settings"}),T(re,{}),T(W,{onClick:z,children:"Clear All Sorting"}),T(W,{onClick:S,children:"Clear All Filters"})]})]}),D&&X(g,{variant:"outline",size:"sm",onClick:D,className:"rounded-lg",children:[T(mn,{className:"mr-2 h-4 w-4"}),"Export"]}),M&&T(g,{variant:"outline",size:"sm",onClick:M,disabled:k,className:"rounded-lg",children:T(pn,{className:o("h-4 w-4",k&&"animate-spin")})})]})]})})})})}import{ChevronLeft as vn,ChevronRight as hn,ChevronsLeft as xn,ChevronsRight as yn}from"lucide-react";import{jsx as V,jsxs as pe}from"react/jsx-runtime";function _o({currentPage:e,totalPages:t,pageSize:a,totalItems:n,onPageChange:s,onPageSizeChange:i,config:m}){if(!m.enabled)return null;let x=m.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,d=Math.min(e*a,n),c=e>1,N=e<t,D=()=>{let k=[],S=[];for(let z=Math.max(2,e-2);z<=Math.min(t-1,e+2);z++)k.push(z);return e-2>2?S.push(1,"..."):S.push(1),S.push(...k),e+2<t-1?S.push("...",t):t>1&&S.push(t),S};return V("div",{className:"rounded-xl",children:pe("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[V("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:m.showInfo!==!1&&pe("span",{children:["Showing ",p," to ",d," of ",n," entries"]})}),pe("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[x&&pe("div",{className:"flex items-center gap-2",children:[V("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),pe(Ae,{value:`${a}`,onValueChange:M=>i(Number(M)),children:[V(Be,{className:"h-9 w-[70px] rounded-lg",children:V(Ie,{})}),V(Fe,{side:"top",className:"rounded-lg",children:x.map(M=>V(he,{value:`${M}`,children:M},M))})]})]}),pe("div",{className:"flex items-center gap-2",children:[pe(g,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:!c,className:"hidden sm:flex rounded-lg",children:[V(xn,{className:"h-4 w-4"}),V("span",{className:"sr-only",children:"Go to first page"})]}),pe(g,{variant:"outline",size:"sm",onClick:()=>s(e-1),disabled:!c,className:"rounded-lg",children:[V(vn,{className:"h-4 w-4 sm:mr-2"}),V("span",{className:"hidden sm:inline",children:"Previous"}),V("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),m.showPageNumbers&&t>1&&V("div",{className:"hidden sm:flex items-center gap-1",children:D().map((M,k)=>{if(M==="...")return V("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${k}`);let S=M;return V(g,{variant:S===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>s(S),children:S},S)})}),pe("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),pe(g,{variant:"outline",size:"sm",onClick:()=>s(e+1),disabled:!N,className:"rounded-lg",children:[V("span",{className:"hidden sm:inline",children:"Next"}),V(hn,{className:"h-4 w-4 sm:ml-2"}),V("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),pe(g,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:!N,className:"hidden sm:flex rounded-lg",children:[V(yn,{className:"h-4 w-4"}),V("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as F,jsxs as $e}from"react/jsx-runtime";function Vo({data:e,template:t,fields:a=[],filters:n=[],pagination:s={enabled:!1},settings:i={},header:m,footer:x,className:p="",loading:d=!1,error:c,emptyMessage:N="No items found",emptyIcon:D,onSelectionChange:M,onExport:k,onRefresh:S,onTemplateReady:z,children:I}){let{enableSorting:C=!0,enableFiltering:ee=!0,enableGlobalSearch:y=!0,enableSelection:A=!1,enableExport:fe=!1,toolbar:se=!0,selectionMode:ae="multiple",gridCols:l={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:u=4,aspectRatio:E="auto",minCardWidth:Y=350,maxCardWidth:Se=350}=i,[Ge,yt]=Oe(""),[Ne,Ct]=Oe({}),[ge,We]=Oe(""),[De,Je]=Oe("asc"),[B,qe]=Oe(new Set),[Xe,le]=Oe(1),[ce,Vt]=Oe(s.pageSize||12),[wt,Gt]=Oe(l.default),H=no(()=>{let b=[...e];if(y&&Ge){let r=a.filter(f=>f.searchable!==!1);b=b.filter(f=>r.some(h=>f[h.key]?.toString().toLowerCase().includes(Ge.toLowerCase())))}if(ee&&Object.keys(Ne).forEach(r=>{let f=Ne[r];if(f!=null&&f!==""){let h=a.find(P=>P.key===r);h&&(b=b.filter(P=>{let L=P[r];return h.type==="boolean"?L===(f==="true"):h.type==="number"?L===Number(f):L?.toString().toLowerCase().includes(String(f).toLowerCase())}))}}),C&&ge){let r=a.find(f=>f.key===ge);r&&b.sort((f,h)=>{let P=f[ge],L=h[ge];if(r.type==="number")return De==="asc"?Number(P)-Number(L):Number(L)-Number(P);if(r.type==="date"){let q=new Date(P),U=new Date(L);return De==="asc"?q.getTime()-U.getTime():U.getTime()-q.getTime()}else{let q=String(P).toLowerCase(),U=String(L).toLowerCase();return De==="asc"?q.localeCompare(U):U.localeCompare(q)}})}return b},[e,Ge,Ne,ge,De,a,y,ee,C]),Nt=no(()=>{if(!s.enabled)return H;let b=(Xe-1)*ce,r=b+ce;return H.slice(b,r)},[H,Xe,ce,s.enabled]),Pt=Math.ceil(H.length/ce),J=ot(b=>{A&&qe(r=>{let f=new Set(r);return ae==="single"?(f.clear(),f.add(b)):f.has(b)?f.delete(b):f.add(b),f})},[A,ae]),Tt=ot(()=>{!A||ae==="single"||(B.size===H.length?qe(new Set):qe(new Set(H.map((b,r)=>r))))},[A,ae,B.size,H.length]),dt=ot((b,r)=>{Ct(f=>({...f,[b]:r})),le(1)},[]),_=ot((b,r)=>{We(b),Je(r)},[]),St=ot(()=>{yt(""),Ct({}),le(1)},[]),Et=ot(()=>{We(""),Je("asc")},[]),ct=no(()=>({getSelectedItems:()=>Array.from(B).map(b=>H[b]),clearSelection:()=>qe(new Set),selectAll:Tt,getFilteredData:()=>H,getTotalCount:()=>e.length,getVisibleCount:()=>H.length,refresh:()=>S?.(),exportData:()=>k?.(H)}),[B,H,e.length,Tt,S,k]),mt=Cn(null);mt.current=ct,Lo(()=>{z&&mt.current&&z(mt.current)},[]),Lo(()=>{if(A&&M){let b=Array.from(B).map(r=>H[r]);M(b)}},[B]);let Dt=o("w-full","overflow-hidden",p),kt=o("grid",`gap-${u}`,"w-full","mx-auto","items-start"),R={gridTemplateColumns:wt===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${Y}px, calc(100%/${wt} - ${u*4}px), ${Se}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return c?F(be,{className:"w-full",children:F(ve,{className:"flex items-center justify-center py-12",children:$e("div",{className:"text-center",children:[F("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),F("p",{className:"text-sm text-muted-foreground mb-4",children:c}),S&&$e(g,{variant:"outline",size:"sm",onClick:S,children:[F(Oo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):$e("div",{className:o("w-full flex gap-2 flex-col h-full",Dt),children:[m&&F(be,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:F(ve,{className:"p-2",children:m})}),se&&F(ao,{fields:a,filters:n,globalFilter:Ge,onGlobalFilterChange:yt,fieldFilters:Ne,onFieldFilterChange:dt,sortField:ge,sortDirection:De,onSortChange:_,selectedCount:B.size,totalCount:e.length,visibleCount:H.length,onExport:fe?()=>k?.(H):void 0,onRefresh:S,loading:d,onClearFilters:St,onClearSorting:Et}),F(be,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:F(ve,{className:"px-0",children:$e("div",{className:"relative",children:[d&&F("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:$e("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[F(Oo,{className:"size-5 animate-spin text-primary"}),F("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),Nt.length>0?F("div",{className:o(kt),style:R,children:Nt.map((b,r)=>{let f=s.enabled?(Xe-1)*ce+r:r,h=B.has(f);return $e("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",E==="square"?"aspect-square":"",E==="video"?"aspect-video":"",A?"cursor-pointer":"",h?"ring-2 ring-primary":""),onClick:()=>A&&J(f),children:[A&&ae==="multiple"&&F("div",{className:"absolute top-2 right-2 z-10",children:F(gt,{checked:h,onCheckedChange:()=>J(f),className:"bg-background/80 backdrop-blur-sm",onClick:P=>P.stopPropagation()})}),t(b,r,h,()=>J(f))]},f)})}):$e("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[F("div",{className:"text-6xl",children:D||"\u{1F4CB}"}),F("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:N}),(Ge||Object.values(Ne).some(b=>b))&&F(g,{variant:"outline",onClick:St,children:"Clear Filters"})]})]})})}),s.enabled&&F("div",{className:"pb-1",children:F(_o,{currentPage:Xe,totalPages:Pt,pageSize:ce,totalItems:H.length,onPageChange:le,onPageSizeChange:b=>{Vt(b),le(1)},config:s})}),x&&F("div",{className:"p-2 m-0.5",children:x}),I&&I(ct)]})}import{Loader as wn,X as Nn}from"lucide-react";import{AnimatePresence as Pn,motion as Tn}from"framer-motion";import*as Ve from"react";import*as Go from"react-dom";import{jsx as Q,jsxs as ht}from"react/jsx-runtime";function Eo({controller:e,visible:t,container:a,children:n,className:s,...i}){let[m,x]=Ve.useState(!1);Ve.useLayoutEffect(()=>{x(!0)},[]),Ve.useEffect(()=>{function N(D){D.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=e.getSelectedItems(),c=t??d.length>0;return Go.createPortal(Q(Pn,{children:c&&Q(Tn.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:o("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-8 ring-primary/5",s),...i,children:Q(Ee,{children:n})})}),p)}function Ho({size:e="sm",variant:t="secondary",tooltip:a,isPending:n,disabled:s,className:i,children:m,onClick:x,...p}){let d=Q(g,{variant:t,size:e,className:o("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",i),disabled:s||n,onClick:x,...p,children:n?Q(wn,{className:"animate-spin"}):m});return a?ht(Re,{children:[Q(Me,{asChild:!0,children:d}),Q(ze,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:Q("p",{children:a})})]}):d}function jo({controller:e}){let t=Ve.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return ht("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[ht("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),Q(bt,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),ht(Re,{children:[Q(Me,{asChild:!0,children:Q(g,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:Q(Nn,{className:"size-3.5"})})}),ht(ze,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[Q("p",{children:"Clear selection"}),Q("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:Q("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as kn}from"react/jsx-runtime";var Sn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},Dn={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},$o=({children:e,className:t,spacing:a="tight",padding:n="none"})=>kn("div",{className:o("flex flex-col h-full",Sn[a],Dn[n],t),children:e});import{ArrowLeftIcon as Uo,ChevronRight as Rn}from"lucide-react";import{NavLink as Mn}from"react-router";import{jsx as oe,jsxs as Ue}from"react/jsx-runtime";var Wo=({className:e,columns:t=[],showBackButton:a=!0,meta:n={title:""}})=>{let s=()=>{if(!n.backAction||!a)return null;let c={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.backAction.href?oe(Mn,{to:n.backAction.href,children:Ue(g,{...c,children:[oe(Uo,{className:"size-6"}),n.backAction.content]})}):Ue(g,{...c,onClick:n.backAction.onClick,children:[oe(Uo,{className:"size-6"}),n.backAction.content]})},i=()=>!n.metadata||n.metadata.length===0?null:oe("div",{className:"flex gap-4",children:n.metadata.map((c,N)=>c.value&&Ue("div",{className:"text-sm",children:[Ue("span",{className:"text-muted-foreground",children:[c.label," "]}),oe("span",{children:c.value})]},N))}),m=()=>n.status?oe("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[n.status.color]),children:n.status.content}):null,x={content:Ue("div",{className:"flex gap-2 items-center",children:[s(),Ue("div",{className:"flex flex-col gap-2 w-max",children:[oe("h1",{className:"text-2xl font-bold tracking-tight",children:n.title}),m(),n.description&&oe("p",{className:"text-muted-foreground",children:n.description}),i(),n.breadcrumbs&&n.breadcrumbs.length>0&&oe("div",{className:"flex items-center text-sm text-muted-foreground",children:n.breadcrumbs.map((c,N)=>Ue("div",{className:"flex items-center",children:[c.href?oe("span",{className:"hover:text-primary hover:underline",children:c.label}):oe("span",{children:c.label}),N<n.breadcrumbs.length-1&&oe(Rn,{className:"mx-2 h-4 w-4"})]},N))})]})]}),align:"left",width:"fill"},p={content:n.primaryActions,align:"right",width:"auto"},d=[x,...t.filter(c=>c!==void 0),p];return oe("div",{className:o("flex items-center w-full gap-4 p-2",e),children:d.map((c,N)=>oe("div",{className:o("flex items-center h-full",c.className,{"justify-start":c.align==="left","justify-center":c.align==="center","justify-end":c.align==="right","flex-1":c.width==="fill"}),children:c.content},N))})};import In,{useState as Bn,createContext as Fn,useContext as _n}from"react";import{Dialog as xt}from"radix-ui";import{XIcon as zn}from"lucide-react";import{jsx as at,jsxs as ro}from"react/jsx-runtime";function Jo({...e}){return at(xt.Root,{"data-slot":"sheet",...e})}function io({...e}){return at(xt.Portal,{"data-slot":"sheet-portal",...e})}function An({className:e,...t}){return at(xt.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function qo({className:e,children:t,side:a="right",...n}){return ro(io,{children:[at(An,{}),ro(xt.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[t,ro(xt.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[at(zn,{className:"size-4"}),at("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as Gn,jsx as $,jsxs as rt}from"react/jsx-runtime";var Xo=Fn(!1),Ft={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},nt={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Ln=(e,t)=>{let[a,n]=Ft[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?n:a,sheetPushClass:e==="right"?a:n}},On="flex flex-col overflow-hidden rounded-2xl relative",Vn={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},Ko=e=>{let{children:t,className:a,variant:n="default",layout:s="full",header:i,footer:m,headerClassName:x,footerClassName:p,parentContainer:d=!1,padding:c=d?"none":"tight"}=e,N=_n(Xo),[D,M]=Bn(!1),k=In.useCallback(z=>$("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",d&&"flex",!d&&nt[c]),children:z}),[c,d]),S=()=>{switch(s){case"split":{let{splitRatio:z="three-fourth",reverse:I=!1}=e;if(!Array.isArray(t)||t.length!==2)return $("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[C,ee]=Ft[z],[y,A]=I?[t[1],t[0]]:[t[0],t[1]],[fe,se]=I?[ee,C]:[C,ee];return rt("div",{className:"flex h-full gap-2",children:[$("div",{className:o(fe,"overflow-auto"),children:k(y)}),$("div",{className:o(se,"overflow-auto"),children:k(A)})]})}case"with-sheet":{let{sheetContent:z,sheetWidth:I="four-fifth",sheetSide:C="right",sheetMode:ee="container",sheetClassName:y,isSheetOpen:A,onSheetOpenChange:fe,disableOverlay:se=!0,showSheetOverlay:ae=!0}=e,l=A!==void 0&&fe,u=l?A:D,E=l?fe:M;if(ee==="container"){let Y=Ln(C,I),Se=Ft[I][0];return se?rt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[$("div",{className:o("h-full overflow-auto transition-all duration-500",u?Y.contentPushClass:"w-full",u&&"overflow-y-auto overflow-x-hidden"),children:$("div",{className:o("h-full",!d&&nt[c]),children:t})}),$("div",{className:o(Y.container,"transition-all duration-500 ease-in-out h-full",Se,u&&["left","right"].includes(C)?o(Y.sheetPushClass,"overflow-y-auto"):u?Y.transformOpen:o(Y.transform,"hidden"),"overflow-y-auto"),children:$("div",{className:o(Y.content,y,"h-full"),children:z})})]}):rt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[$("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:$("div",{className:o("h-full",!d&&nt[c]),children:t})}),rt("div",{className:o("absolute inset-0 z-20",!u&&"pointer-events-none"),children:[ae&&$("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",u?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>E(!1)}),$("div",{className:o(Y.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",Se,u?"translate-x-0 opacity-100":o(C==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[C]:0},children:$("div",{className:o(Y.content,y,"h-full"),children:z})})]})]})}return rt(Gn,{children:[t,$(Jo,{open:u,onOpenChange:E,children:$(io,{children:$(qo,{side:C,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",Ft[I][0],y),children:z})})})]})}default:return k(t)}};return $(Xo.Provider,{value:!0,children:rt("div",{className:o(On,Vn[n],nt[c],N&&"flex-1",d&&"h-full",!d&&"rounded-2xl",a),children:[i&&$("div",{className:o("border-b",x,n==="card"&&!d&&"rounded-t-2xl",n==="border"&&"border-b-2",nt[c]),children:i}),S(),m&&$("div",{className:o("border-t",p,n==="card"&&!d&&"rounded-b-2xl",n==="border"&&"border-t-2",nt[c]),children:m})]})})};import{jsx as so}from"react/jsx-runtime";var Yo=({className:e,columns:t=[],meta:a={title:""}})=>{let n={content:so("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},s=[...t.filter(i=>i!==void 0),n];return so("div",{className:o("flex items-center w-full gap-4",e),children:s.map((i,m)=>so("div",{className:o("flex items-center h-full",i.className,{"justify-start":i.align==="left","justify-center":i.align==="center","justify-end":i.align==="right","flex-1":i.width==="fill"}),children:i.content},m))})};import{jsx as _t}from"react/jsx-runtime";function En({useTypedAppMeta:e}){return{AppHeader:i=>{let{meta:m}=e();return _t(Wo,{...i,meta:m})},AppFooter:i=>{let{meta:m}=e();return _t(Yo,{...i,meta:m})},AppContent:i=>_t(Ko,{...i}),AppContainer:i=>_t($o,{...i})}}import{createContext as Zo,useContext as Hn,useState as Qo,useCallback as Lt,useMemo as ea}from"react";import{jsx as ta}from"react/jsx-runtime";var jn=Zo(void 0),$n=({children:e})=>{let[t,a]=Qo({title:"",description:"",breadcrumbs:[]}),n=Lt(m=>{a(x=>Object.keys(m).some(d=>JSON.stringify(x[d])!==JSON.stringify(m[d]))?{...x,...m}:x)},[]),s=Lt(()=>{a(m=>m.title===""&&m.description===""&&(m.breadcrumbs?.length??0)===0?m:{title:"",description:"",breadcrumbs:[]})},[]),i=ea(()=>({meta:t,setMeta:n,resetMeta:s}),[t,n,s]);return ta(jn.Provider,{value:i,children:e})};function Un(){let e=Zo(void 0);return{TypedAppMetaProvider:({children:n})=>{let[s,i]=Qo({title:"",description:"",breadcrumbs:[]}),m=Lt(d=>{i(c=>Object.keys(d).some(D=>{let M=c[D],k=d[D];return JSON.stringify(M)!==JSON.stringify(k)})?{...c,...d}:c)},[]),x=Lt(()=>{i(d=>d.title===""&&d.description===""&&(d.breadcrumbs?.length??0)===0?d:{title:"",description:"",breadcrumbs:[]})},[]),p=ea(()=>({meta:s,setMeta:m,resetMeta:x}),[s,m,x]);return ta(e.Provider,{value:p,children:n})},useTypedAppMeta:()=>{let n=Hn(e);if(!n)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return n},TypedAppMetaContext:e}}import{useEffect as Wn,useMemo as lo}from"react";function Jn({useTypedAppMeta:e}){function t(a){let{setMeta:n,resetMeta:s}=e(),i=lo(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),m=lo(()=>a.metadata,[JSON.stringify(a.metadata)]),x=lo(()=>({...a,backAction:i,metadata:m}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,i,m]);Wn(()=>(n(x),()=>s()),[x,n,s])}return{usePageTemplate:t}}import{useState as oa}from"react";import{Copy as qn,Check as Xn,Loader2Icon as Kn}from"lucide-react";import{jsx as Pe,jsxs as aa}from"react/jsx-runtime";var co=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:n,size:s="icon",variant:i="ghost"})=>{let[m,x]=oa(!1),[p,d]=oa(!1),c=async()=>{if(!(!t||p)){d(!0);try{await this.copyToClipboard(t),x(!0),setTimeout(()=>x(!1),2e3)}catch(N){console.error("Failed to copy text:",N)}finally{d(!1)}}};return aa(Re,{children:[Pe(Me,{asChild:!0,children:Pe(g,{variant:i,size:s,className:o(s==="icon"&&"size-6",n),onClick:c,disabled:p||!t,children:p?Pe(Kn,{className:"animate-spin"}):m?Pe(Xn,{className:"h-3 w-3"}):a||Pe(qn,{className:"h-3 w-3"})})}),Pe(ze,{children:m?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:n="",suffix:s="",withSymbol:i=!0,compact:m=!1}=a;if(typeof t!="number"||isNaN(t))return`${n}${i?"\u20B9 ":""}0.00${s}`;let x=t<0,p=Math.abs(t),c=(m&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${n}${x?"- ":""}${i?"\u20B9 ":""}${c}${s}`}static formatDate(t,a={}){let{format:n="dd-mm-yyyy",separator:s="-"}=a,i=new Date(t);if(isNaN(i.getTime()))return"";let m=String(i.getDate()).padStart(2,"0"),x=String(i.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[i.getMonth()],d=i.getFullYear();switch(n){case"dd-mmm-yyyy":return`${m}${s}${p}${s}${d}`;case"iso":return i.toISOString().split("T")[0];case"long":return i.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return i.toLocaleDateString("en-IN");default:return`${m}${s}${x}${s}${d}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,n,s)=>["-","'"," "].includes(a)||n>0&&["-","'"].includes(s[n-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:n=!0,capitalize:s=!0,size:i="md",variant:m="outline",customColors:x,icon:p,trueMessage:d="active",falseMessage:c="inactive"})=>{let N=typeof t=="boolean"?t?d:c:typeof t=="number"?t>0?d:c:t.toLowerCase(),D={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},M=D[N.toLowerCase()]||D.inactive,k=x||M[m],S={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},z=s?N.charAt(0).toUpperCase()+N.slice(1):N;return Pe("div",{className:"flex justify-center",children:aa("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",k.bg,k.text,k.border,S[i],a),children:[n&&(p?Pe("span",{className:"flex items-center",children:p}):Pe("span",{className:o("size-2 rounded-full",k.dot),"aria-hidden":"true"})),z]})})}};import{AlertTriangleIcon as Yn}from"lucide-react";import{useRouteError as Zn,isRouteErrorResponse as Qn,useNavigate as er}from"react-router";import{Fragment as mo,jsx as ue,jsxs as it}from"react/jsx-runtime";var na=()=>{let e=Zn(),t=er();return ue("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:it("div",{className:"flex flex-col items-center space-y-4 text-center",children:[ue(Yn,{className:"h-16 w-16 text-destructive"}),Qn(e)?it(mo,{children:[it("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?ue("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&ue("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?it(mo,{children:[ue("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),ue("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&it("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[ue("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),ue("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):it(mo,{children:[ue("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),ue("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),ue(g,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as Te}from"framer-motion";import{jsx as G,jsxs as ie}from"react/jsx-runtime";function tr({size:e=100,strokeWidth:t=2,color:a="currentColor",className:n=""}){return ie(Te.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[G("title",{children:"Animated Checkmark"}),G(Te.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),G(Te.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function ra(){return G(be,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:ie(ve,{className:"space-y-4 flex flex-col items-center justify-center",children:[G(Te.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:ie("div",{className:"relative",children:[G(Te.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),G(tr,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),ie(Te.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[G(Te.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),G("div",{className:"flex items-center gap-4",children:G(Te.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:ie("div",{className:"flex flex-col items-start gap-2",children:[ie("div",{className:"space-y-1.5",children:[ie("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ie("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[G("title",{children:"From"}),G("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),ie("div",{className:"flex items-center gap-2.5 group transition-all",children:[G("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),G("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),G("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),ie("div",{className:"space-y-1.5",children:[ie("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ie("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[G("title",{children:"To"}),G("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),ie("div",{className:"flex items-center gap-2.5 group transition-all",children:[G("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),G("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),G(Te.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as Ot,jsxs as or}from"react/jsx-runtime";var ia=()=>Ot("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:or("div",{className:"flex flex-col items-center space-y-4",children:[Ot("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),Ot("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),Ot("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as ar}from"react-router";import{GhostIcon as nr}from"lucide-react";import{NavLink as rr,useNavigate as ir}from"react-router";import{jsx as st,jsxs as po}from"react/jsx-runtime";var sa=()=>{let e=ar(),t=ir(),a=()=>{window.history.length>2?t(-1):t("/")};return po("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[st(nr,{className:"h-15 w-15 text-destructive mb-4"}),st("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),po("p",{className:"text-xl mb-4",children:["The page ",st("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),po("div",{className:"flex space-x-4",children:[st(g,{variant:"outline",onClick:a,children:"Go Back"}),st(g,{variant:"ghost",children:st(rr,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as sr}from"lucide-react";import{jsx as uo,jsxs as lr}from"react/jsx-runtime";var la=()=>lr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[uo(sr,{className:"h-15 w-15 text-destructive mb-4"}),uo("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),uo("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as dr}from"lucide-react";import{NavLink as cr,useNavigate as mr}from"react-router";import{jsx as lt,jsxs as da}from"react/jsx-runtime";var ca=()=>{let e=mr();return da("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[lt(dr,{className:"h-15 w-15 text-destructive mb-4"}),lt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),lt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),da("div",{className:"flex space-x-4",children:[lt(g,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),lt(g,{variant:"ghost",children:lt(cr,{to:"/",children:"Go to Home"})})]})]})};export{$n as AppMetaProvider,ra as CurrencyTransfer,zo as DataTable,Io as DataTableActionBar,Bo as DataTableActionBarAction,Fo as DataTableActionBarSelection,Vo as DataTemplate,Eo as DataTemplateActionBar,Ho as DataTemplateActionBarAction,jo as DataTemplateActionBarSelection,na as ErrorComponent,co as GeneralHelper,ia as Loader,sa as NotFound,la as OfflineUI,ca as Unauthorized,En as createLayoutComponents,Jn as createPageTemplateHook,Un as createTypedAppMetaContext};
2
+ import{flexRender as ao,getCoreRowModel as Xa,getFilteredRowModel as Ka,getPaginationRowModel as Ya,getSortedRowModel as Za,useReactTable as Qa}from"@tanstack/react-table";import{Loader2 as Ao,ChevronUp as no,ChevronDown as ro,ChevronsUpDown as en,MoreHorizontal as tn,MoveRightIcon as on,PinOffIcon as an}from"lucide-react";import{Slot as va}from"radix-ui";import{cva as ha}from"class-variance-authority";import{clsx as fa}from"clsx";import{twMerge as ba}from"tailwind-merge";function o(...e){return ba(fa(e))}import{jsx as xa}from"react/jsx-runtime";var zt=ha("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 f({className:e,variant:t,size:a,asChild:n=!1,...s}){let r=n?va.Slot:"button";return xa(r,{"data-slot":"button",className:o(zt({variant:t,size:a,className:e}),"transition-none"),...s})}import{jsx as ze}from"react/jsx-runtime";function Jt({className:e,...t}){return ze("div",{"data-slot":"table-container",className:"relative w-full overflow-auto max-h-full",children:ze("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function xo({className:e,...t}){return ze("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function yo({className:e,...t}){return ze("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Co({className:e,...t}){return ze("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function gt({className:e,...t}){return ze("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function wo({className:e,...t}){return ze("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function At({className:e,...t}){return ze("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}import{jsx as No}from"react/jsx-runtime";function xe({className:e,...t}){return No("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ye({className:e,...t}){return No("div",{"data-slot":"card-content",className:o("px-6",e),...t})}import{Tooltip as ot}from"radix-ui";import{jsx as at,jsxs as ya}from"react/jsx-runtime";function $e({delayDuration:e=0,...t}){return at(ot.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ae({...e}){return at($e,{children:at(ot.Root,{"data-slot":"tooltip",...e})})}function Ie({...e}){return at(ot.Trigger,{"data-slot":"tooltip-trigger",...e})}function Be({className:e,sideOffset:t=0,children:a,...n}){return at(ot.Portal,{children:ya(ot.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("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),...n,children:[a,at(ot.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}import{Search as ko,RefreshCw as Fa,Download as _a,Settings2 as La,Filter as Ro,ArrowUpDown as Oa,PinOff as Va,Pin as Ga,ChevronDown as Ea}from"lucide-react";import{jsx as Ca}from"react/jsx-runtime";function nt({className:e,type:t,...a}){return Ca("input",{type:t,"data-slot":"input",className:o("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),...a})}import{Select as ce}from"radix-ui";import{CheckIcon as wa,ChevronDownIcon as Po,ChevronUpIcon as Na}from"lucide-react";import{jsx as K,jsxs as qt}from"react/jsx-runtime";function Fe({...e}){return K(ce.Root,{"data-slot":"select",...e})}function _e({...e}){return K(ce.Value,{"data-slot":"select-value",...e})}function Le({className:e,size:t="default",children:a,...n}){return qt(ce.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("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),...n,children:[a,K(ce.Icon,{asChild:!0,children:K(Po,{className:"size-4 opacity-50"})})]})}function Oe({className:e,children:t,position:a="popper",...n}){return K(ce.Portal,{children:qt(ce.Content,{"data-slot":"select-content",className:o("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",a==="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:a,...n,children:[K(Pa,{}),K(ce.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),K(Ta,{})]})})}function Ce({className:e,children:t,...a}){return qt(ce.Item,{"data-slot":"select-item",className:o("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),...a,children:[K("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:K(ce.ItemIndicator,{children:K(wa,{className:"size-4"})})}),K(ce.ItemText,{children:t})]})}function Pa({className:e,...t}){return K(ce.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:K(Na,{className:"size-4"})})}function Ta({className:e,...t}){return K(ce.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:K(Po,{className:"size-4"})})}import{DropdownMenu as we}from"radix-ui";import{CheckIcon as Sa,ChevronRightIcon as jr,CircleIcon as $r}from"lucide-react";import{jsx as ue,jsxs as Da}from"react/jsx-runtime";function Ne({...e}){return ue(we.Root,{"data-slot":"dropdown-menu",...e})}function Pe({...e}){return ue(we.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Te({className:e,sideOffset:t=4,...a}){return ue(we.Portal,{children:ue(we.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("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),...a})})}function Xt({...e}){return ue(we.Group,{"data-slot":"dropdown-menu-group",...e})}function W({className:e,inset:t,variant:a="default",...n}){return ue(we.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("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),...n})}function It({className:e,children:t,checked:a,...n}){return Da(we.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("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:a,...n,children:[ue("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:ue(we.ItemIndicator,{children:ue(Sa,{className:"size-4"})})}),t]})}function ne({className:e,inset:t,...a}){return ue(we.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function re({className:e,...t}){return ue(we.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}import{useState as Ha}from"react";import{useEffect as Ia,useState as Qt}from"react";import{Calendar as Ba}from"lucide-react";import{format as ft}from"date-fns";import{Popover as Bt}from"radix-ui";import{jsx as Ft}from"react/jsx-runtime";function Kt({...e}){return Ft(Bt.Root,{"data-slot":"popover",...e})}function Yt({...e}){return Ft(Bt.Trigger,{"data-slot":"popover-trigger",...e})}function Zt({className:e,align:t="center",sideOffset:a=4,...n}){return Ft(Bt.Portal,{children:Ft(Bt.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("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),...n})})}import*as _t from"react";import{ChevronDownIcon as ka,ChevronLeftIcon as Ra,ChevronRightIcon as Ma}from"lucide-react";import{DayPicker as za,getDefaultClassNames as To}from"react-day-picker";import{jsx as Ve}from"react/jsx-runtime";function So({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:r,components:m,...h}){let p=To();return Ve(za,{showOutsideDays:a,className:o("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:n,formatters:{formatMonthDropdown:d=>d.toLocaleString("default",{month:"short"}),...r},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(zt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(zt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",n==="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",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("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",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:d,rootRef:c,...w})=>Ve("div",{"data-slot":"calendar",ref:c,className:o(d),...w}),Chevron:({className:d,orientation:c,...w})=>c==="left"?Ve(Ra,{className:o("size-4",d),...w}):c==="right"?Ve(Ma,{className:o("size-4",d),...w}):Ve(ka,{className:o("size-4",d),...w}),DayButton:Aa,WeekNumber:({children:d,...c})=>Ve("td",{...c,children:Ve("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:d})}),...m},...h})}function Aa({className:e,day:t,modifiers:a,...n}){let s=To(),r=_t.useRef(null);return _t.useEffect(()=>{a.focused&&r.current?.focus()},[a.focused]),Ve(f,{ref:r,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("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",s.day,e),...n})}import{jsx as Ue,jsxs as bt}from"react/jsx-runtime";function Do({value:e,onChange:t,placeholder:a,mode:n,externalSearch:s,onExternalChange:r,onlyExternal:m=!1}){let[h,p]=Qt(!1),[d,c]=Qt(e),[w,T]=Qt(e);Ia(()=>{m||T(e)},[e,m]);let z=()=>{m||t(d),T(d),s&&r&&r(d),p(!1)},M=()=>{c(w),p(!1)},k=()=>{let x=n==="single"?null:{from:null,to:null};c(x),m||t(x),T(x),s&&r&&r(x),p(!1)},A=()=>{let x=m?w:e;return x?n==="single"?ft(x,"PPP"):x.from&&x.to?`${ft(x.from,"MMM dd")} - ${ft(x.to,"MMM dd, yyyy")}`:x.from?`From ${ft(x.from,"MMM dd, yyyy")}`:x.to?`To ${ft(x.to,"MMM dd, yyyy")}`:a:a},B=x=>{c(n==="single"?x:x||{from:null,to:null})};return bt(Kt,{open:h,onOpenChange:p,children:[Ue(Yt,{asChild:!0,children:bt(f,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!A()&&"text-muted-foreground"),children:[Ue(Ba,{className:"mr-2 h-4 w-4"}),A()]})}),bt(Zt,{className:"w-auto p-0",align:"start",children:[Ue("div",{className:"p-3",children:Ue(So,{mode:n,selected:d,onSelect:B,numberOfMonths:n==="range"?2:1,className:"rounded-md border",...n==="range"&&{required:!0}})}),bt("div",{className:"flex items-center justify-between p-3 border-t",children:[Ue(f,{variant:"ghost",size:"sm",onClick:k,children:"Clear"}),bt("div",{className:"flex gap-2",children:[Ue(f,{variant:"outline",size:"sm",onClick:M,children:"Cancel"}),Ue(f,{size:"sm",onClick:z,disabled:n==="range"&&(!d?.from||!d?.to),children:"Apply"})]})]})]})]})}import{Fragment as ja,jsx as C,jsxs as V}from"react/jsx-runtime";function eo({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:n,enableGlobalFilter:s=!0,onExport:r,onRefresh:m,loading:h=!1,enableColumnVisibility:p=!0,data:d,onClearSorting:c,onClearFilters:w,enableColumnPinning:T=!1,onExternalSearch:z}){let[M,k]=Ha({}),A=()=>e.getAllLeafColumns().filter(l=>l.getCanHide?.()!==!1),B=()=>e.getAllColumns().filter(l=>!e.getAllLeafColumns().includes(l)&&l.columns?.length&&l.columns.some(g=>g.getCanHide?.()!==!1)),x=()=>{let l=new Set(B().flatMap(g=>g.columns?.filter(H=>H.getCanHide?.()!==!1).map(H=>H.id)||[]));return A().filter(g=>!l.has(g.id))},ee=(l,g)=>g&&l.startsWith(`${g}.`)?l.replace(`${g}.`,"").split("_").map(Y=>Y.slice(1)).join(" "):l.split("_").map(H=>H.charAt(0).toUpperCase()+H.slice(1)).join(" "),y=(l,g)=>{let H={...M,[l]:g};k(H)},F=()=>{z&&z(M)},be=()=>{k({}),w(),z&&z({})},se=l=>e.getColumn(l)?.getFilterValue(),ae=(l,g)=>{e.getColumn(l)?.setFilterValue(g)};return C("div",{className:"rounded-xl",children:C("div",{className:"px-2",children:C("div",{className:"flex flex-col gap-6",children:V("div",{className:"flex items-center justify-between",children:[C("div",{className:"flex items-center gap-3",children:t.length>0&&V("div",{className:"flex items-center gap-3 flex-wrap",children:[C("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:C(Ro,{className:"h-4 w-4"})}),t.map(l=>C("div",{className:o("relative min-w-[150px]",l.width),children:l.type==="select"?V(Fe,{value:se(l.key)??"",onValueChange:g=>{ae(l.key,g==="all"?"":g),l.externalSearch&&y(l.key,g==="all"?"":g)},children:[l.icon&&C("span",{children:C(l.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),C(Le,{className:o("h-9 rounded-lg w-full",l.icon&&"pl-9"),children:C(_e,{placeholder:l.placeholder})}),V(Oe,{className:"rounded-lg",children:[C(Ce,{value:"all",children:"All"}),l.options?.map(g=>C(Ce,{value:g.value,children:g.label},g.label))]})]}):l.type==="date"?C(Do,{value:se(l.key),onChange:g=>{l.onlyExternal||ae(l.key,g)},placeholder:l.placeholder,mode:l.dateMode||"single",externalSearch:l.externalSearch,onlyExternal:l.onlyExternal,onExternalChange:g=>y(l.key,g)}):V("div",{className:"relative",children:[l.icon&&C("span",{children:C(l.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"})}),C(nt,{placeholder:l.placeholder,value:se(l.key)??"",onChange:g=>{ae(l.key,g.target.value),l.externalSearch&&y(l.key,g.target.value)},className:o("h-9 rounded-lg",l.icon&&"pl-9"),type:l.type==="number"?"number":"text"})]})},l.key)),t.some(l=>l.externalSearch)&&V(f,{variant:"default",size:"sm",onClick:F,className:"rounded-lg",children:[C(ko,{className:"mr-2 h-4 w-4"}),t.find(l=>l.externalSearch)?.searchButtonText||"Search"]})]})}),V("div",{className:"flex items-center gap-2",children:[s&&V("div",{className:"relative",children:[C(ko,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),C(nt,{placeholder:"Global search...",value:a??"",onChange:l=>n(l.target.value),className:"pl-9 max-w-max"})]}),r&&V(f,{variant:"outline",size:"sm",onClick:()=>r(d),className:"rounded-lg",children:[C(_a,{className:"mr-2 h-4 w-4"}),"Export"]}),p&&V(Ne,{children:[C(Pe,{asChild:!0,children:V(f,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[C("span",{children:"Columns"}),C(Ea,{className:"h-4 w-4 opacity-50"})]})}),V(Te,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[C(ne,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),C(re,{}),x().length>0&&V(Xt,{children:[C(ne,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),x().map(l=>C(It,{className:"text-sm",checked:l.getIsVisible(),onCheckedChange:g=>l.toggleVisibility(!!g),children:ee(l.id)},l.id))]}),B().map(l=>V(Xt,{children:[C(re,{}),C(ne,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:l.id}),l.columns?.filter(g=>g.getCanHide?.()!==!1).map(g=>C(It,{className:"text-sm",checked:g.getIsVisible(),onCheckedChange:H=>g.toggleVisibility(!!H),children:ee(g.id,l.id)},g.id))]},l.id))]})]}),V(Ne,{children:[C(Pe,{asChild:!0,children:C(f,{variant:"outline",size:"sm",className:"rounded-lg",children:C(La,{className:"h-4 w-4"})})}),V(Te,{align:"end",className:"w-[200px] rounded-lg",children:[C(ne,{children:"Table Settings"}),C(re,{}),V(W,{onClick:c,children:[C(Oa,{className:"mr-2 h-4 w-4"}),"Clear All Sorting"]}),V(W,{onClick:be,children:[C(Ro,{className:"mr-2 h-4 w-4"}),"Clear All Filters"]}),T&&V(ja,{children:[C(re,{}),C(ne,{children:"Column Pinning"}),V(W,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[C(Va,{className:"mr-2 h-4 w-4"}),"Reset All Pinning"]}),V(W,{onClick:()=>{let l=A().filter(g=>g.getCanPin?.()!==!1).map(g=>g.id);e.setColumnPinning({left:[],right:l})},children:[C(Ga,{className:"mr-2 h-4 w-4 -rotate-90"}),"Pin All Right"]})]})]})]}),m&&C(f,{variant:"outline",size:"sm",onClick:m,disabled:h,className:"rounded-lg",children:C(Fa,{className:o("h-4 w-4",h&&"animate-spin")})})]})]})})})})}import{jsx as te,jsxs as rt}from"react/jsx-runtime";function to({table:e,config:t}){return t.enabled?te("div",{className:"rounded-xl",children:te("div",{children:rt("div",{className:"flex items-center justify-between",children:[te("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&rt("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"]})}),rt("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&rt("div",{className:"flex items-center gap-2",children:[te("span",{className:"text-sm font-medium",children:"Rows per page:"}),rt(Fe,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[te(Le,{className:"h-9 w-[70px] rounded-lg",children:te(_e,{})}),te(Oe,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>te(Ce,{value:`${a}`,children:a},a))})]})]}),rt("div",{className:"flex items-center gap-2",children:[te(f,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),te(f,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&te("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,n)=>{let s=e.getState().pagination.pageIndex,r=s+n;return r<1||r>e.getPageCount()?null:te(f,{variant:r===s+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(r-1),children:r},r)})}),te(f,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),te(f,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}import{Toggle as $a}from"radix-ui";import{cva as Ua}from"class-variance-authority";import{jsx as Ja}from"react/jsx-runtime";var Wa=Ua("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 Mo({className:e,variant:t,size:a,noBg:n,...s}){return Ja($a.Root,{"data-slot":"toggle",className:o(Wa({className:e,variant:t,size:a,bg:n?"disabled":"enabled"})),...s})}import{Checkbox as zo}from"radix-ui";import{CheckIcon as qa}from"lucide-react";import{jsx as oo}from"react/jsx-runtime";function vt({className:e,...t}){return oo(zo.Root,{"data-slot":"checkbox",className:o("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:oo(zo.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:oo(qa,{className:"size-3.5"})})})}import{useCallback as io,useEffect as Lt,useMemo as nn,useState as We}from"react";import{Fragment as Io,jsx as b,jsxs as $}from"react/jsx-runtime";function Bo({data:e,columns:t,filters:a=[],pagination:n={enabled:!1},settings:s={},header:r,footer:m,className:h="",maxHeight:p="600px",loading:d=!1,error:c,emptyMessage:w="No data available",onRowSelectionChange:T,onExport:z,onRefresh:M,onTableReady:k,children:A,isRowDisabled:B,isRowSelectable:x,onExternalSearch:ee}){let[y,F]=We([]),[be,se]=We([]),[ae,l]=We({}),[g,H]=We({}),[Y,Re]=We(""),[je,wt]=We([]),[Se,Nt]=We(s.enableColumnPinning?{left:[],right:[]}:{}),{enableSorting:ve=!0,enableFiltering:Xe=!0,enableGlobalFilter:Me=!0,enableColumnVisibility:Ke=!0,enableRowSelection:_=!0,stickyHeader:Ye=!0,toolbar:Ze=!1,showSerialNumbers:le=!0,fixedCheckboxColumn:me=!0,striped:Ht=!0,hoverable:Pt=!0,compact:jt=!0,bordered:j=!0,fullHeight:Tt=!1,enableColumnResizing:St=!1,enableColumnPinning:J=!0,hideHeader:Dt=!1,selectionMode:he="multiple",checkboxColumnPosition:kt=0}=s,Qe=nn(()=>{let u=[...t],N=v=>v.map(P=>{if(P.id==="select"||P.id==="serialNumber")return P;let q={...P,enablePinning:!0};return P.columns&&(q.columns=N(P.columns)),q}),i=N(u),S={id:"select",header:({table:v})=>{if(he==="single")return null;let P=v.getRowModel().rows.filter(de=>!B?.(de.original)&&(x?x(de.original):!0)),q=P.length>0&&P.every(de=>de.getIsSelected()),pe=P.some(de=>de.getIsSelected());return b(vt,{checked:q||pe&&"indeterminate",onCheckedChange:de=>{P.forEach(et=>et.toggleSelected(!!de))},"aria-label":"Select all selectable rows"})},cell:({row:v})=>{let P=B?B(v.original):!1,q=x?x(v.original):!0;return b("div",{className:o("flex items-center justify-center",P&&"opacity-50"),children:he==="multiple"?b(vt,{checked:v.getIsSelected(),onCheckedChange:pe=>q&&v.toggleSelected(!!pe),"aria-label":"Select row",disabled:P||!q}):b("input",{type:"radio",checked:v.getIsSelected(),onChange:()=>q&&v.toggleSelected(!0),disabled:P||!q,className:"h-4 w-4 rounded-full border-primary text-primary focus:ring-primary"})})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:he==="multiple"?40:30};if(_){let v=kt;v<0&&(v=i.length+v+1),v=Math.max(0,Math.min(v,i.length)),i.splice(v,0,S)}if(le){let v={id:"serialNumber",header:"No.",cell:({row:P})=>b("div",{className:"text-center font-medium text-muted-foreground",children:P.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};i.unshift(v)}return i},[t,le,_,me,B,x,he,kt]),L=Qa({data:e,columns:Qe,onSortingChange:ve?F:void 0,onColumnFiltersChange:Xe?se:void 0,onGlobalFilterChange:Me?Re:void 0,getCoreRowModel:Xa(),getPaginationRowModel:n.enabled?Ya():void 0,getSortedRowModel:ve?Za():void 0,getFilteredRowModel:Xe?Ka():void 0,onColumnVisibilityChange:Ke?l:void 0,onRowSelectionChange:_?H:void 0,onColumnOrderChange:wt,onColumnPinningChange:J?Nt:void 0,state:{sorting:ve?y:void 0,columnFilters:Xe?be:void 0,columnVisibility:Ke?ae:void 0,rowSelection:_?g:{},globalFilter:Y,columnOrder:je,columnPinning:J?Se:{}},initialState:{pagination:n.enabled?{pageSize:n.pageSize||10}:void 0,columnPinning:J?{left:[...le?["serialNumber"]:[],..._?["select"]:[]],right:[]}:void 0},enableRowSelection:_,enableColumnResizing:St,enableColumnPinning:J,columnResizeMode:"onChange"});Lt(()=>{if(_&&T){let u=L.getFilteredSelectedRowModel().rows.filter(N=>!B?.(N.original)&&(x?x(N.original):!0)).map(N=>N.original);T(u)}},[g,_,T,L,B,x]);let Rt=io(u=>{he==="single"?(L.resetRowSelection(),u.toggleSelected(!0)):u.toggleSelected()},[he,L]);Lt(()=>{k&&k(L)},[L,k]),Lt(()=>{if(_&&T){let u=L.getFilteredSelectedRowModel().rows.map(N=>N.original);T(u)}},[g,_,T,L]),Lt(()=>{if(_&&T){let u=L.getFilteredSelectedRowModel().rows.filter(N=>!B?.(N.original)&&(x?x(N.original):!0)).map(N=>N.original);T(u)}},[g,_,T,L,B,x]);let ut=io(()=>{F([])},[]),$t=io(()=>{se([]),Re("")},[]),Mt=(u,N)=>{if(!J)return;let i=[...le?["serialNumber"]:[],..._&&me?["select"]:[]],S={left:[...(Se.left??[]).filter(v=>i.includes(v))],right:[...Se.right??[]]};N===!1?(S.left=S.left.filter(v=>v!==u),S.right=S.right.filter(v=>v!==u)):N==="right"?(S.left=S.left.filter(v=>v!==u),S.right.includes(u)||S.right.push(u)):N==="left"&&(S.right=S.right.filter(v=>v!==u),!S.left.includes(u)&&!i.includes(u)&&S.left.push(u)),L.setColumnPinning(S)},Ut=()=>b(xo,{className:o(Ye&&"sticky top-0 bg-sidebar z-20"),children:L.getHeaderGroups().map((u,N)=>b(gt,{className:"hover:bg-transparent",children:u.headers.map((i,S)=>{let v=i.depth===0&&i.colSpan>1,P=J&&(i.column.getIsPinned()==="left"||i.column.id==="serialNumber"||i.column.id==="select"&&_),q=J&&i.column.getIsPinned()==="right",pe=i.column.getCanSort(),de=J&&i.column.columnDef.enablePinning!==!1,et=i.column.id==="serialNumber",Wt=i.column.id==="select",ho=et||Wt&&me,tt=i.column.columnDef.headerAlign||"left",ga={left:"justify-start",center:"justify-center",right:"justify-end"}[tt];return $(wo,{colSpan:i.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!jt&&"py-2",j&&S<u.headers.length-1&&"border-r","relative",P&&"sticky left-0 z-15 bg-sidebar",q&&"sticky right-0 z-15 bg-sidebar",(et||Wt)&&"sticky left-0 z-15 bg-sidebar",v?"text-center":"text-left"),style:{width:i.getSize()!==150?i.getSize():"auto",minWidth:i.getSize()!==150?i.getSize():"auto",...P&&{left:et?0:Wt?le&&L.getColumn("serialNumber")?.getSize()||0:R(i.column)},...q&&{right:I(i.column)},...et&&{left:0}},children:[v?b("div",{className:"flex items-center justify-center",children:ao(i.column.columnDef.header,i.getContext())}):$("div",{className:o("relative flex items-center w-full px-2",ga),children:[$("div",{className:"flex items-center gap-1",children:[pe&&tt==="right"&&b("span",{className:"ml-1 order-2",children:i.column.getIsSorted()&&{asc:b(no,{className:"h-4 w-4"}),desc:b(ro,{className:"h-4 w-4"})}[i.column.getIsSorted()]}),i.isPlaceholder?null:ao(i.column.columnDef.header,i.getContext()),pe&&tt!=="right"&&i.column.getIsSorted()&&b("span",{className:"ml-1 order-2",children:i.column.getIsSorted()&&{asc:b(no,{className:"h-4 w-4"}),desc:b(ro,{className:"h-4 w-4"})}[i.column.getIsSorted()]})]}),(pe||de&&!ho)&&$(Ne,{children:[b(Pe,{asChild:!0,className:o("absolute",tt==="left"&&"right-1",tt==="center"&&"right-1",tt==="right"&&"left-1"),children:b(Mo,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:b(tn,{className:"h-4 w-4"})})}),$(Te,{align:"end",className:"w-48",children:[pe&&$(Io,{children:[b(ne,{children:"Sorting"}),$(W,{onClick:()=>i.column.toggleSorting(!1),children:[b(no,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),$(W,{onClick:()=>i.column.toggleSorting(!0),children:[b(ro,{className:"mr-2 h-4 w-4"}),"Sort Descending"]}),$(W,{onClick:()=>i.column.clearSorting(),disabled:!i.column.getIsSorted(),children:[b(en,{className:"mr-2 h-4 w-4"}),"Clear Sort"]}),b(re,{})]}),de&&!ho&&$(Io,{children:[b(ne,{children:"Pin Column"}),$(W,{onClick:()=>Mt(i.column.id,"right"),disabled:i.column.getIsPinned()==="right",children:[b(on,{}),"Pin Right"]}),$(W,{onClick:()=>Mt(i.column.id,!1),disabled:!i.column.getIsPinned(),children:[b(an,{}),"Unpin"]})]})]})]})]}),St&&i.column.getCanResize()&&!v&&i.colSpan===1&&b("div",{className:"absolute right-0 top-0 h-full w-1 bg-border hover:bg-primary cursor-col-resize opacity-0 hover:opacity-100 transition-opacity",onMouseDown:i.getResizeHandler()})]},i.id)})},u.id))}),R=u=>{if(!J)return;let N=0,i=L.getLeftHeaderGroups()[0]?.headers||[],S=[...le?["serialNumber"]:[],..._?["select"]:[]];for(let v of i){if(v.id===u.id)break;if(S.includes(v.id)){let P=L.getColumn(v.id);P&&(N+=P.getSize())}}return N},I=u=>{if(!J)return;let N=L.getState().columnPinning.right||[],i=N.indexOf(u.id);if(i===-1)return;let S=0;for(let v=i+1;v<N.length;v++){let P=L.getColumn(N[v]);P&&(S+=P.getSize())}return S};return c?b(xe,{className:"w-full rounded-xl shadow-sm",children:b(ye,{className:"flex items-center justify-center",children:$("div",{className:"text-center",children:[b("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),b("p",{className:"text-sm text-muted-foreground mb-4",children:c}),M&&$(f,{variant:"outline",size:"sm",onClick:M,className:"rounded-lg",children:[b(Ao,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):b($e,{children:$("div",{className:o("w-full space-y-2 flex flex-col h-full",h),children:[r&&b(xe,{className:"rounded-2xl py-2 sticky top-0 z-20",children:b(ye,{className:"px-2",children:r})}),Ze&&b(eo,{table:L,filters:a,globalFilter:Y,onGlobalFilterChange:Re,enableGlobalFilter:Me,onExport:z,onRefresh:M,loading:d,enableColumnVisibility:Ke,enableColumnPinning:J,data:e,onClearSorting:ut,onClearFilters:$t,onExternalSearch:ee}),b(xe,{className:o("shadow-sm overflow-auto py-0",Tt&&"flex-1"),children:b(ye,{className:"p-0 h-full",children:$("div",{className:"relative flex flex-col h-full justify-between",children:[d&&b("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl",children:$("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[b(Ao,{className:"size-5 animate-spin text-primary"}),b("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),b("div",{className:"relative rounded-t-xl overflow-auto border-b",children:$(Jt,{className:"border-collapse w-full",children:[!Dt&&Ut(),b(yo,{children:L.getRowModel().rows?.length?L.getRowModel().rows.map((u,N)=>b(gt,{"data-state":u.getIsSelected()&&"selected",className:o(Pt&&"hover:bg-muted/50",Ht&&N%2===0&&"bg-muted/20",u.getIsSelected()&&"bg-muted","border-b last:border-b-0",he==="single"&&"cursor-pointer"),onClick:()=>{he==="single"&&Rt(u)},children:u.getVisibleCells().map((i,S)=>{let v=J&&(i.column.getIsPinned()==="left"||i.column.id==="serialNumber"||i.column.id==="select"&&_),P=J&&i.column.getIsPinned()==="right",q=i.column.id==="serialNumber",pe=i.column.id==="select",de=q||pe&&me;return b(At,{className:o(jt?"py-2":"py-4",j&&S<u.getVisibleCells().length&&"border-r",v&&"sticky left-0 z-10 bg-sidebar/97",P&&"sticky right-0 z-10 bg-sidebar/97",q&&"sticky left-0 z-10 bg-sidebar/97","p-1"),style:{width:i.column.getSize()!==150?i.column.getSize():"auto",minWidth:i.column.getSize()!==150?i.column.getSize():"auto",...v&&{left:q?0:pe?le&&L.getColumn("serialNumber")?.getSize()||0:R(i.column)},...P&&{right:I(i.column)},...q&&{left:0}},children:ao(i.column.columnDef.cell,i.getContext())},i.id)})},u.id)):b(gt,{children:b(At,{colSpan:Qe.length,className:"h-32 text-center border-0",children:$("div",{className:"flex flex-col items-center gap-3",children:[b("div",{className:"text-muted-foreground text-6xl",children:"\u{1F4CB}"}),b("p",{className:"text-muted-foreground font-medium",children:w})]})})})})]})}),m&&b("div",{className:"sticky bottom-0 bg-sidebar w-full z-20",style:{width:"100%",minWidth:"fit-content"},children:b(Jt,{children:b(Co,{children:b(gt,{className:"bg-sidebar",children:b(At,{colSpan:Qe.length,className:"p-2",children:m})})})})})]})})}),b(to,{table:L,config:n}),A&&A(L)]})})}import{Separator as rn}from"radix-ui";import{jsx as sn}from"react/jsx-runtime";function ht({className:e,orientation:t="horizontal",decorative:a=!0,...n}){return sn(rn.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("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),...n})}import{Loader as ln,X as dn}from"lucide-react";import{AnimatePresence as cn,motion as mn}from"framer-motion";import*as Ge from"react";import*as Fo from"react-dom";import{jsx as Z,jsxs as xt}from"react/jsx-runtime";function _o({table:e,visible:t,container:a,children:n,className:s,...r}){let[m,h]=Ge.useState(!1);Ge.useLayoutEffect(()=>{h(!0)},[]),Ge.useEffect(()=>{function c(w){w.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=t??e.getFilteredSelectedRowModel().rows.length>0;return Fo.createPortal(Z(cn,{children:d&&Z(mn.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:o("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",s),...r,children:Z($e,{children:n})})}),p)}function Lo({size:e="sm",tooltip:t,isPending:a,disabled:n,className:s,children:r,...m}){let h=Z(f,{variant:"secondary",size:e,className:o("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",s),disabled:n||a,...m,children:a?Z(ln,{className:"animate-spin"}):r});return t?xt(Ae,{children:[Z(Ie,{asChild:!0,children:h}),Z(Be,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:Z("p",{children:t})})]}):h}function Oo({table:e}){let t=Ge.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?xt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[xt("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),Z(ht,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),xt(Ae,{children:[Z(Ie,{asChild:!0,children:Z(f,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:Z(dn,{className:"size-3.5"})})}),xt(Be,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[Z("p",{children:"Clear selection"}),Z("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:Z("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}import{ArrowUpDown as gs,EyeOff as fs}from"lucide-react";import{jsx as ys,jsxs as Cs}from"react/jsx-runtime";import{ChevronDown as Ps,Eye as Ts}from"lucide-react";import{jsx as Rs,jsxs as Ms}from"react/jsx-runtime";import{Slot as Is}from"radix-ui";import{cva as pn}from"class-variance-authority";import{jsx as Os}from"react/jsx-runtime";var _s=pn("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"}});import{Command as tl}from"cmdk";import{SearchIcon as al}from"lucide-react";import{Dialog as Es}from"radix-ui";import{XIcon as js}from"lucide-react";import{jsx as Ws,jsxs as Js}from"react/jsx-runtime";import{jsx as sl,jsxs as ll}from"react/jsx-runtime";import{CheckIcon as Tl,PlusCircleIcon as Sl}from"lucide-react";import{Fragment as Ml,jsx as kl,jsxs as Rl}from"react/jsx-runtime";import{useState as Ee,useEffect as Go,useMemo as lo,useCallback as it,useRef as Pn}from"react";import{Loader2 as Eo}from"lucide-react";import{Search as un,Download as gn,RefreshCw as fn,Filter as bn,ChevronDown as vn,Settings2 as hn}from"lucide-react";import{Fragment as xn,jsx as D,jsxs as X}from"react/jsx-runtime";function so({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:n,fieldFilters:s,onFieldFilterChange:r,sortField:m,sortDirection:h,onSortChange:p,selectedCount:d,totalCount:c,visibleCount:w,onExport:T,onRefresh:z,loading:M,onClearFilters:k,onClearSorting:A}){let B=e.filter(y=>y.sortable),x=Object.values(s).some(y=>y!=null&&y!=="")||a!=="",ee=m!=="";return D("div",{className:"rounded-xl p-0.5",children:D("div",{className:"px-2",children:D("div",{className:"flex flex-col gap-6",children:X("div",{className:"flex items-center justify-between",children:[D("div",{className:"flex items-center gap-3",children:t.length>0&&X("div",{className:"flex items-center gap-3 flex-wrap",children:[D("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:D(bn,{className:"h-4 w-4"})}),t.map(y=>D("div",{className:"relative min-w-[150px]",children:y.type==="select"?X(Fe,{value:s[y.key]||"all",onValueChange:F=>r(y.key,F),children:[y.icon&&D(y.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),D(Le,{className:o("h-9 rounded-lg w-full",y.icon&&"pl-9"),children:D(_e,{placeholder:y.placeholder||"Select..."})}),X(Oe,{className:"rounded-lg",children:[D(Ce,{value:"all",children:"All"}),y.options?.map(F=>D(Ce,{value:F.value,children:F.label},F.value))]})]}):X("div",{className:"relative",children:[y.icon&&D(y.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),D(nt,{type:y.type,placeholder:y.placeholder,value:s[y.key]||"",onChange:F=>r(y.key,F.target.value),className:o("h-9 rounded-lg",y.icon&&"pl-9")})]})},String(y.key)))]})}),X("div",{className:"flex items-center gap-2",children:[X("div",{className:"relative",children:[D(un,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),D(nt,{placeholder:"Global search...",value:a,onChange:y=>n(y.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),B.length>0&&X(Ne,{children:[D(Pe,{asChild:!0,children:X(f,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[D("span",{children:"Sort"}),D(vn,{className:"h-4 w-4 opacity-50"})]})}),X(Te,{align:"end",className:"w-[200px] rounded-lg",children:[D(ne,{children:"Sort By"}),D(re,{}),B.map(y=>X("div",{children:[X(W,{onClick:()=>p(y.key,"asc"),children:[y.label," (A-Z)"]}),X(W,{onClick:()=>p(y.key,"desc"),children:[y.label," (Z-A)"]})]},String(y.key))),ee&&X(xn,{children:[D(re,{}),D(W,{onClick:A,children:"Clear All Sorting"})]})]})]}),X(Ne,{children:[D(Pe,{asChild:!0,children:D(f,{variant:"outline",size:"sm",className:"rounded-lg",children:D(hn,{className:"h-4 w-4"})})}),X(Te,{align:"end",className:"w-[200px] rounded-lg",children:[D(ne,{children:"Table Settings"}),D(re,{}),D(W,{onClick:A,children:"Clear All Sorting"}),D(W,{onClick:k,children:"Clear All Filters"})]})]}),T&&X(f,{variant:"outline",size:"sm",onClick:T,className:"rounded-lg",children:[D(gn,{className:"mr-2 h-4 w-4"}),"Export"]}),z&&D(f,{variant:"outline",size:"sm",onClick:z,disabled:M,className:"rounded-lg",children:D(fn,{className:o("h-4 w-4",M&&"animate-spin")})})]})]})})})})}import{ChevronLeft as yn,ChevronRight as Cn,ChevronsLeft as wn,ChevronsRight as Nn}from"lucide-react";import{jsx as G,jsxs as ge}from"react/jsx-runtime";function Vo({currentPage:e,totalPages:t,pageSize:a,totalItems:n,onPageChange:s,onPageSizeChange:r,config:m}){if(!m.enabled)return null;let h=m.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,d=Math.min(e*a,n),c=e>1,w=e<t,T=()=>{let M=[],k=[];for(let A=Math.max(2,e-2);A<=Math.min(t-1,e+2);A++)M.push(A);return e-2>2?k.push(1,"..."):k.push(1),k.push(...M),e+2<t-1?k.push("...",t):t>1&&k.push(t),k};return G("div",{className:"rounded-xl",children:ge("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[G("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:m.showInfo!==!1&&ge("span",{children:["Showing ",p," to ",d," of ",n," entries"]})}),ge("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[h&&ge("div",{className:"flex items-center gap-2",children:[G("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),ge(Fe,{value:`${a}`,onValueChange:z=>r(Number(z)),children:[G(Le,{className:"h-9 w-[70px] rounded-lg",children:G(_e,{})}),G(Oe,{side:"top",className:"rounded-lg",children:h.map(z=>G(Ce,{value:`${z}`,children:z},z))})]})]}),ge("div",{className:"flex items-center gap-2",children:[ge(f,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:!c,className:"hidden sm:flex rounded-lg",children:[G(wn,{className:"h-4 w-4"}),G("span",{className:"sr-only",children:"Go to first page"})]}),ge(f,{variant:"outline",size:"sm",onClick:()=>s(e-1),disabled:!c,className:"rounded-lg",children:[G(yn,{className:"h-4 w-4 sm:mr-2"}),G("span",{className:"hidden sm:inline",children:"Previous"}),G("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),m.showPageNumbers&&t>1&&G("div",{className:"hidden sm:flex items-center gap-1",children:T().map((z,M)=>{if(z==="...")return G("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${M}`);let k=z;return G(f,{variant:k===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>s(k),children:k},k)})}),ge("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),ge(f,{variant:"outline",size:"sm",onClick:()=>s(e+1),disabled:!w,className:"rounded-lg",children:[G("span",{className:"hidden sm:inline",children:"Next"}),G(Cn,{className:"h-4 w-4 sm:ml-2"}),G("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),ge(f,{variant:"outline",size:"sm",onClick:()=>s(t),disabled:!w,className:"hidden sm:flex rounded-lg",children:[G(Nn,{className:"h-4 w-4"}),G("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}import{jsx as O,jsxs as Je}from"react/jsx-runtime";function Ho({data:e,template:t,fields:a=[],filters:n=[],pagination:s={enabled:!1},settings:r={},header:m,footer:h,className:p="",loading:d=!1,error:c,emptyMessage:w="No items found",emptyIcon:T,onSelectionChange:z,onExport:M,onRefresh:k,onTemplateReady:A,children:B}){let{enableSorting:x=!0,enableFiltering:ee=!0,enableGlobalSearch:y=!0,enableSelection:F=!1,enableExport:be=!1,toolbar:se=!0,selectionMode:ae="multiple",gridCols:l={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:g=4,aspectRatio:H="auto",minCardWidth:Y=350,maxCardWidth:Re=350}=r,[je,wt]=Ee(""),[Se,Nt]=Ee({}),[ve,Xe]=Ee(""),[Me,Ke]=Ee("asc"),[_,Ye]=Ee(new Set),[Ze,le]=Ee(1),[me,Ht]=Ee(s.pageSize||12),[Pt,jt]=Ee(l.default),j=lo(()=>{let R=[...e];if(y&&je){let I=a.filter(u=>u.searchable!==!1);R=R.filter(u=>I.some(N=>u[N.key]?.toString().toLowerCase().includes(je.toLowerCase())))}if(ee&&Object.keys(Se).forEach(I=>{let u=Se[I];if(u!=null&&u!==""){let N=a.find(i=>i.key===I);N&&(R=R.filter(i=>{let S=i[I];return N.type==="boolean"?S===(u==="true"):N.type==="number"?S===Number(u):S?.toString().toLowerCase().includes(String(u).toLowerCase())}))}}),x&&ve){let I=a.find(u=>u.key===ve);I&&R.sort((u,N)=>{let i=u[ve],S=N[ve];if(I.type==="number")return Me==="asc"?Number(i)-Number(S):Number(S)-Number(i);if(I.type==="date"){let v=new Date(i),P=new Date(S);return Me==="asc"?v.getTime()-P.getTime():P.getTime()-v.getTime()}else{let v=String(i).toLowerCase(),P=String(S).toLowerCase();return Me==="asc"?v.localeCompare(P):P.localeCompare(v)}})}return R},[e,je,Se,ve,Me,a,y,ee,x]),Tt=lo(()=>{if(!s.enabled)return j;let R=(Ze-1)*me,I=R+me;return j.slice(R,I)},[j,Ze,me,s.enabled]),St=Math.ceil(j.length/me),J=it(R=>{F&&Ye(I=>{let u=new Set(I);return ae==="single"?(u.clear(),u.add(R)):u.has(R)?u.delete(R):u.add(R),u})},[F,ae]),Dt=it(()=>{!F||ae==="single"||(_.size===j.length?Ye(new Set):Ye(new Set(j.map((R,I)=>I))))},[F,ae,_.size,j.length]),he=it((R,I)=>{Nt(u=>({...u,[R]:I})),le(1)},[]),kt=it((R,I)=>{Xe(R),Ke(I)},[]),Qe=it(()=>{wt(""),Nt({}),le(1)},[]),L=it(()=>{Xe(""),Ke("asc")},[]),Rt=lo(()=>({getSelectedItems:()=>Array.from(_).map(R=>j[R]),clearSelection:()=>Ye(new Set),selectAll:Dt,getFilteredData:()=>j,getTotalCount:()=>e.length,getVisibleCount:()=>j.length,refresh:()=>k?.(),exportData:()=>M?.(j)}),[_,j,e.length,Dt,k,M]),ut=Pn(null);ut.current=Rt,Go(()=>{A&&ut.current&&A(ut.current)},[]),Go(()=>{if(F&&z){let R=Array.from(_).map(I=>j[I]);z(R)}},[_]);let $t=o("w-full","overflow-hidden",p),Mt=o("grid",`gap-${g}`,"w-full","mx-auto","items-start"),Ut={gridTemplateColumns:Pt===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${Y}px, calc(100%/${Pt} - ${g*4}px), ${Re}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return c?O(xe,{className:"w-full",children:O(ye,{className:"flex items-center justify-center py-12",children:Je("div",{className:"text-center",children:[O("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),O("p",{className:"text-sm text-muted-foreground mb-4",children:c}),k&&Je(f,{variant:"outline",size:"sm",onClick:k,children:[O(Eo,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):Je("div",{className:o("w-full flex gap-2 flex-col h-full",$t),children:[m&&O(xe,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:O(ye,{className:"p-2",children:m})}),se&&O(so,{fields:a,filters:n,globalFilter:je,onGlobalFilterChange:wt,fieldFilters:Se,onFieldFilterChange:he,sortField:ve,sortDirection:Me,onSortChange:kt,selectedCount:_.size,totalCount:e.length,visibleCount:j.length,onExport:be?()=>M?.(j):void 0,onRefresh:k,loading:d,onClearFilters:Qe,onClearSorting:L}),O(xe,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:O(ye,{className:"px-0",children:Je("div",{className:"relative",children:[d&&O("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:Je("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[O(Eo,{className:"size-5 animate-spin text-primary"}),O("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),Tt.length>0?O("div",{className:o(Mt),style:Ut,children:Tt.map((R,I)=>{let u=s.enabled?(Ze-1)*me+I:I,N=_.has(u);return Je("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",H==="square"?"aspect-square":"",H==="video"?"aspect-video":"",F?"cursor-pointer":"",N?"ring-2 ring-primary":""),onClick:()=>F&&J(u),children:[F&&ae==="multiple"&&O("div",{className:"absolute top-2 right-2 z-10",children:O(vt,{checked:N,onCheckedChange:()=>J(u),className:"bg-background/80 backdrop-blur-sm",onClick:i=>i.stopPropagation()})}),t(R,I,N,()=>J(u))]},u)})}):Je("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[O("div",{className:"text-6xl",children:T||"\u{1F4CB}"}),O("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:w}),(je||Object.values(Se).some(R=>R))&&O(f,{variant:"outline",onClick:Qe,children:"Clear Filters"})]})]})})}),s.enabled&&O("div",{className:"pb-1",children:O(Vo,{currentPage:Ze,totalPages:St,pageSize:me,totalItems:j.length,onPageChange:le,onPageSizeChange:R=>{Ht(R),le(1)},config:s})}),h&&O("div",{className:"p-2 m-0.5",children:h}),B&&B(Rt)]})}import{Loader as Tn,X as Sn}from"lucide-react";import{AnimatePresence as Dn,motion as kn}from"framer-motion";import*as He from"react";import*as jo from"react-dom";import{jsx as Q,jsxs as yt}from"react/jsx-runtime";function $o({controller:e,visible:t,container:a,children:n,className:s,...r}){let[m,h]=He.useState(!1);He.useLayoutEffect(()=>{h(!0)},[]),He.useEffect(()=>{function w(T){T.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[e]);let p=a??(m?globalThis.document?.body:null);if(!p||!e)return null;let d=e.getSelectedItems(),c=t??d.length>0;return jo.createPortal(Q(Dn,{children:c&&Q(kn.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:o("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-8 ring-primary/5",s),...r,children:Q($e,{children:n})})}),p)}function Uo({size:e="sm",variant:t="secondary",tooltip:a,isPending:n,disabled:s,className:r,children:m,onClick:h,...p}){let d=Q(f,{variant:t,size:e,className:o("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",r),disabled:s||n,onClick:h,...p,children:n?Q(Tn,{className:"animate-spin"}):m});return a?yt(Ae,{children:[Q(Ie,{asChild:!0,children:d}),Q(Be,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:Q("p",{children:a})})]}):d}function Wo({controller:e}){let t=He.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return yt("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[yt("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),Q(ht,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),yt(Ae,{children:[Q(Ie,{asChild:!0,children:Q(f,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:Q(Sn,{className:"size-3.5"})})}),yt(Be,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[Q("p",{children:"Clear selection"}),Q("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:Q("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}import{jsx as zn}from"react/jsx-runtime";var Rn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},Mn={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Jo=({children:e,className:t,spacing:a="tight",padding:n="none"})=>zn("div",{className:o("flex flex-col h-full",Rn[a],Mn[n],t),children:e});import{ArrowLeftIcon as qo,ChevronRight as An}from"lucide-react";import{NavLink as In}from"react-router";import{jsx as oe,jsxs as qe}from"react/jsx-runtime";var Xo=({className:e,columns:t=[],showBackButton:a=!0,meta:n={title:""}})=>{let s=()=>{if(!n.backAction||!a)return null;let c={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return n.backAction.href?oe(In,{to:n.backAction.href,children:qe(f,{...c,children:[oe(qo,{className:"size-6"}),n.backAction.content]})}):qe(f,{...c,onClick:n.backAction.onClick,children:[oe(qo,{className:"size-6"}),n.backAction.content]})},r=()=>!n.metadata||n.metadata.length===0?null:oe("div",{className:"flex gap-4",children:n.metadata.map((c,w)=>c.value&&qe("div",{className:"text-sm",children:[qe("span",{className:"text-muted-foreground",children:[c.label," "]}),oe("span",{children:c.value})]},w))}),m=()=>n.status?oe("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[n.status.color]),children:n.status.content}):null,h={content:qe("div",{className:"flex gap-2 items-center",children:[s(),qe("div",{className:"flex flex-col gap-2 w-max",children:[oe("h1",{className:"text-2xl font-bold tracking-tight",children:n.title}),m(),n.description&&oe("p",{className:"text-muted-foreground",children:n.description}),r(),n.breadcrumbs&&n.breadcrumbs.length>0&&oe("div",{className:"flex items-center text-sm text-muted-foreground",children:n.breadcrumbs.map((c,w)=>qe("div",{className:"flex items-center",children:[c.href?oe("span",{className:"hover:text-primary hover:underline",children:c.label}):oe("span",{children:c.label}),w<n.breadcrumbs.length-1&&oe(An,{className:"mx-2 h-4 w-4"})]},w))})]})]}),align:"left",width:"fill"},p={content:n.primaryActions,align:"right",width:"auto"},d=[h,...t.filter(c=>c!==void 0),p];return oe("div",{className:o("flex items-center w-full gap-4 p-2",e),children:d.map((c,w)=>oe("div",{className:o("flex items-center h-full",c.className,{"justify-start":c.align==="left","justify-center":c.align==="center","justify-end":c.align==="right","flex-1":c.width==="fill"}),children:c.content},w))})};import _n,{useState as Ln,createContext as On,useContext as Vn}from"react";import{Dialog as Ct}from"radix-ui";import{XIcon as Bn}from"lucide-react";import{jsx as st,jsxs as co}from"react/jsx-runtime";function Ko({...e}){return st(Ct.Root,{"data-slot":"sheet",...e})}function mo({...e}){return st(Ct.Portal,{"data-slot":"sheet-portal",...e})}function Fn({className:e,...t}){return st(Ct.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Yo({className:e,children:t,side:a="right",...n}){return co(mo,{children:[st(Fn,{}),co(Ct.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[t,co(Ct.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[st(Bn,{className:"size-4"}),st("span",{className:"sr-only",children:"Close"})]})]})]})}import{Fragment as jn,jsx as U,jsxs as dt}from"react/jsx-runtime";var Zo=On(!1),Ot={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},lt={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Gn=(e,t)=>{let[a,n]=Ot[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?n:a,sheetPushClass:e==="right"?a:n}},En="flex flex-col overflow-hidden rounded-2xl relative",Hn={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},Qo=e=>{let{children:t,className:a,variant:n="default",layout:s="full",header:r,footer:m,headerClassName:h,footerClassName:p,parentContainer:d=!1,padding:c=d?"none":"tight"}=e,w=Vn(Zo),[T,z]=Ln(!1),M=_n.useCallback(A=>U("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",d&&"flex",!d&&lt[c]),children:A}),[c,d]),k=()=>{switch(s){case"split":{let{splitRatio:A="three-fourth",reverse:B=!1}=e;if(!Array.isArray(t)||t.length!==2)return U("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[x,ee]=Ot[A],[y,F]=B?[t[1],t[0]]:[t[0],t[1]],[be,se]=B?[ee,x]:[x,ee];return dt("div",{className:"flex h-full gap-2",children:[U("div",{className:o(be,"overflow-auto"),children:M(y)}),U("div",{className:o(se,"overflow-auto"),children:M(F)})]})}case"with-sheet":{let{sheetContent:A,sheetWidth:B="four-fifth",sheetSide:x="right",sheetMode:ee="container",sheetClassName:y,isSheetOpen:F,onSheetOpenChange:be,disableOverlay:se=!0,showSheetOverlay:ae=!0}=e,l=F!==void 0&&be,g=l?F:T,H=l?be:z;if(ee==="container"){let Y=Gn(x,B),Re=Ot[B][0];return se?dt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[U("div",{className:o("h-full overflow-auto transition-all duration-500",g?Y.contentPushClass:"w-full",g&&"overflow-y-auto overflow-x-hidden"),children:U("div",{className:o("h-full",!d&&lt[c]),children:t})}),U("div",{className:o(Y.container,"transition-all duration-500 ease-in-out h-full",Re,g&&["left","right"].includes(x)?o(Y.sheetPushClass,"overflow-y-auto"):g?Y.transformOpen:o(Y.transform,"hidden"),"overflow-y-auto"),children:U("div",{className:o(Y.content,y,"h-full"),children:A})})]}):dt("div",{className:o("flex relative flex-1 overflow-hidden"),children:[U("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:U("div",{className:o("h-full",!d&&lt[c]),children:t})}),dt("div",{className:o("absolute inset-0 z-20",!g&&"pointer-events-none"),children:[ae&&U("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",g?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>H(!1)}),U("div",{className:o(Y.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",Re,g?"translate-x-0 opacity-100":o(x==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[x]:0},children:U("div",{className:o(Y.content,y,"h-full"),children:A})})]})]})}return dt(jn,{children:[t,U(Ko,{open:g,onOpenChange:H,children:U(mo,{children:U(Yo,{side:x,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",Ot[B][0],y),children:A})})})]})}default:return M(t)}};return U(Zo.Provider,{value:!0,children:dt("div",{className:o(En,Hn[n],lt[c],w&&"flex-1",d&&"h-full",!d&&"rounded-2xl",a),children:[r&&U("div",{className:o("border-b",h,n==="card"&&!d&&"rounded-t-2xl",n==="border"&&"border-b-2",lt[c]),children:r}),k(),m&&U("div",{className:o("border-t",p,n==="card"&&!d&&"rounded-b-2xl",n==="border"&&"border-t-2",lt[c]),children:m})]})})};import{jsx as po}from"react/jsx-runtime";var ea=({className:e,columns:t=[],meta:a={title:""}})=>{let n={content:po("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},s=[...t.filter(r=>r!==void 0),n];return po("div",{className:o("flex items-center w-full gap-4",e),children:s.map((r,m)=>po("div",{className:o("flex items-center h-full",r.className,{"justify-start":r.align==="left","justify-center":r.align==="center","justify-end":r.align==="right","flex-1":r.width==="fill"}),children:r.content},m))})};import{jsx as Vt}from"react/jsx-runtime";function $n({useTypedAppMeta:e}){return{AppHeader:r=>{let{meta:m}=e();return Vt(Xo,{...r,meta:m})},AppFooter:r=>{let{meta:m}=e();return Vt(ea,{...r,meta:m})},AppContent:r=>Vt(Qo,{...r}),AppContainer:r=>Vt(Jo,{...r})}}import{createContext as ta,useContext as Un,useState as oa,useCallback as Gt,useMemo as aa}from"react";import{jsx as na}from"react/jsx-runtime";var Wn=ta(void 0),Jn=({children:e})=>{let[t,a]=oa({title:"",description:"",breadcrumbs:[]}),n=Gt(m=>{a(h=>Object.keys(m).some(d=>JSON.stringify(h[d])!==JSON.stringify(m[d]))?{...h,...m}:h)},[]),s=Gt(()=>{a(m=>m.title===""&&m.description===""&&(m.breadcrumbs?.length??0)===0?m:{title:"",description:"",breadcrumbs:[]})},[]),r=aa(()=>({meta:t,setMeta:n,resetMeta:s}),[t,n,s]);return na(Wn.Provider,{value:r,children:e})};function qn(){let e=ta(void 0);return{TypedAppMetaProvider:({children:n})=>{let[s,r]=oa({title:"",description:"",breadcrumbs:[]}),m=Gt(d=>{r(c=>Object.keys(d).some(T=>{let z=c[T],M=d[T];return JSON.stringify(z)!==JSON.stringify(M)})?{...c,...d}:c)},[]),h=Gt(()=>{r(d=>d.title===""&&d.description===""&&(d.breadcrumbs?.length??0)===0?d:{title:"",description:"",breadcrumbs:[]})},[]),p=aa(()=>({meta:s,setMeta:m,resetMeta:h}),[s,m,h]);return na(e.Provider,{value:p,children:n})},useTypedAppMeta:()=>{let n=Un(e);if(!n)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return n},TypedAppMetaContext:e}}import{useEffect as Xn,useMemo as uo}from"react";function Kn({useTypedAppMeta:e}){function t(a){let{setMeta:n,resetMeta:s}=e(),r=uo(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),m=uo(()=>a.metadata,[JSON.stringify(a.metadata)]),h=uo(()=>({...a,backAction:r,metadata:m}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,r,m]);Xn(()=>(n(h),()=>s()),[h,n,s])}return{usePageTemplate:t}}import{useState as ra}from"react";import{Copy as Yn,Check as Zn,Loader2Icon as Qn}from"lucide-react";import{jsx as De,jsxs as ia}from"react/jsx-runtime";var go=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:n,size:s="icon",variant:r="ghost"})=>{let[m,h]=ra(!1),[p,d]=ra(!1),c=async()=>{if(!(!t||p)){d(!0);try{await this.copyToClipboard(t),h(!0),setTimeout(()=>h(!1),2e3)}catch(w){console.error("Failed to copy text:",w)}finally{d(!1)}}};return ia(Ae,{children:[De(Ie,{asChild:!0,children:De(f,{variant:r,size:s,className:o(s==="icon"&&"size-6",n),onClick:c,disabled:p||!t,children:p?De(Qn,{className:"animate-spin"}):m?De(Zn,{className:"h-3 w-3"}):a||De(Yn,{className:"h-3 w-3"})})}),De(Be,{children:m?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:n="",suffix:s="",withSymbol:r=!0,compact:m=!1}=a;if(typeof t!="number"||isNaN(t))return`${n}${r?"\u20B9 ":""}0.00${s}`;let h=t<0,p=Math.abs(t),c=(m&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${n}${h?"- ":""}${r?"\u20B9 ":""}${c}${s}`}static formatDate(t,a={}){let{format:n="dd-mm-yyyy",separator:s="-"}=a,r=new Date(t);if(isNaN(r.getTime()))return"";let m=String(r.getDate()).padStart(2,"0"),h=String(r.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[r.getMonth()],d=r.getFullYear();switch(n){case"dd-mmm-yyyy":return`${m}${s}${p}${s}${d}`;case"iso":return r.toISOString().split("T")[0];case"long":return r.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return r.toLocaleDateString("en-IN");default:return`${m}${s}${h}${s}${d}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,n,s)=>["-","'"," "].includes(a)||n>0&&["-","'"].includes(s[n-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:n=!0,capitalize:s=!0,size:r="md",variant:m="outline",customColors:h,icon:p,trueMessage:d="active",falseMessage:c="inactive"})=>{let w=typeof t=="boolean"?t?d:c:typeof t=="number"?t>0?d:c:t.toLowerCase(),T={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},z=T[w.toLowerCase()]||T.inactive,M=h||z[m],k={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},A=s?w.charAt(0).toUpperCase()+w.slice(1):w;return De("div",{className:"flex justify-center",children:ia("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",M.bg,M.text,M.border,k[r],a),children:[n&&(p?De("span",{className:"flex items-center",children:p}):De("span",{className:o("size-2 rounded-full",M.dot),"aria-hidden":"true"})),A]})})}};import{AlertTriangleIcon as er}from"lucide-react";import{useRouteError as tr,isRouteErrorResponse as or,useNavigate as ar}from"react-router";import{Fragment as fo,jsx as fe,jsxs as ct}from"react/jsx-runtime";var sa=()=>{let e=tr(),t=ar();return fe("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:ct("div",{className:"flex flex-col items-center space-y-4 text-center",children:[fe(er,{className:"h-16 w-16 text-destructive"}),or(e)?ct(fo,{children:[ct("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?fe("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&fe("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?ct(fo,{children:[fe("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),fe("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&ct("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[fe("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),fe("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):ct(fo,{children:[fe("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),fe("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),fe(f,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};import{motion as ke}from"framer-motion";import{jsx as E,jsxs as ie}from"react/jsx-runtime";function nr({size:e=100,strokeWidth:t=2,color:a="currentColor",className:n=""}){return ie(ke.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:n,children:[E("title",{children:"Animated Checkmark"}),E(ke.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),E(ke.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function la(){return E(xe,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:ie(ye,{className:"space-y-4 flex flex-col items-center justify-center",children:[E(ke.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:ie("div",{className:"relative",children:[E(ke.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),E(nr,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),ie(ke.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[E(ke.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),E("div",{className:"flex items-center gap-4",children:E(ke.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:ie("div",{className:"flex flex-col items-start gap-2",children:[ie("div",{className:"space-y-1.5",children:[ie("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ie("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E("title",{children:"From"}),E("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),ie("div",{className:"flex items-center gap-2.5 group transition-all",children:[E("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),E("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),E("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),ie("div",{className:"space-y-1.5",children:[ie("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[ie("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E("title",{children:"To"}),E("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),ie("div",{className:"flex items-center gap-2.5 group transition-all",children:[E("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),E("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),E(ke.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}import{jsx as Et,jsxs as rr}from"react/jsx-runtime";var da=()=>Et("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:rr("div",{className:"flex flex-col items-center space-y-4",children:[Et("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),Et("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),Et("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});import{useLocation as ir}from"react-router";import{GhostIcon as sr}from"lucide-react";import{NavLink as lr,useNavigate as dr}from"react-router";import{jsx as mt,jsxs as bo}from"react/jsx-runtime";var ca=()=>{let e=ir(),t=dr(),a=()=>{window.history.length>2?t(-1):t("/")};return bo("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[mt(sr,{className:"h-15 w-15 text-destructive mb-4"}),mt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),bo("p",{className:"text-xl mb-4",children:["The page ",mt("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),bo("div",{className:"flex space-x-4",children:[mt(f,{variant:"outline",onClick:a,children:"Go Back"}),mt(f,{variant:"ghost",children:mt(lr,{to:"/",children:"Return Home"})})]})]})};import{WifiOffIcon as cr}from"lucide-react";import{jsx as vo,jsxs as mr}from"react/jsx-runtime";var ma=()=>mr("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[vo(cr,{className:"h-15 w-15 text-destructive mb-4"}),vo("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),vo("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});import{ShieldOffIcon as pr}from"lucide-react";import{NavLink as ur,useNavigate as gr}from"react-router";import{jsx as pt,jsxs as pa}from"react/jsx-runtime";var ua=()=>{let e=gr();return pa("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[pt(pr,{className:"h-15 w-15 text-destructive mb-4"}),pt("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),pt("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),pa("div",{className:"flex space-x-4",children:[pt(f,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),pt(f,{variant:"ghost",children:pt(ur,{to:"/",children:"Go to Home"})})]})]})};export{Jn as AppMetaProvider,la as CurrencyTransfer,Bo as DataTable,_o as DataTableActionBar,Lo as DataTableActionBarAction,Oo as DataTableActionBarSelection,Ho as DataTemplate,$o as DataTemplateActionBar,Uo as DataTemplateActionBarAction,Wo as DataTemplateActionBarSelection,sa as ErrorComponent,go as GeneralHelper,da as Loader,ca as NotFound,ma as OfflineUI,ua as Unauthorized,$n as createLayoutComponents,Kn as createPageTemplateHook,qn as createTypedAppMetaContext};
3
3
  //# sourceMappingURL=index.js.map