@ferdiunal/refinedev-shadcn-ui
Version:
theme for refine.dev with shadcn-ui
1 lines • 73.9 kB
JavaScript
(()=>{var zi=Object.create;var Wo=Object.defineProperty;var Oi=Object.getOwnPropertyDescriptor;var Ui=Object.getOwnPropertyNames;var _i=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty;var r=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Ot=(e,t)=>{for(var o in t)Wo(e,o,{get:t[o],enumerable:!0})},Gi=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ui(t))!Wi.call(e,n)&&n!==o&&Wo(e,n,{get:()=>t[n],enumerable:!(a=Oi(t,n))||a.enumerable});return e};var h=(e,t,o)=>(o=e!=null?zi(_i(e)):{},Gi(t||!e||!e.__esModule?Wo(o,"default",{value:e,enumerable:!0}):o,e));var Be=r("@refinedev/core"),Fa=r("lucide-react");var Ea={};Ot(Ea,{Avatar:()=>Br,AvatarFallback:()=>Lr,AvatarImage:()=>Ar,Badge:()=>Xe,Button:()=>p,Calendar:()=>fo,Card:()=>tt,CardContent:()=>ot,CardDescription:()=>jr,CardFooter:()=>qt,CardHeader:()=>Kr,CardTitle:()=>Jr,Checkbox:()=>lo,Command:()=>be,CommandDialog:()=>ji,CommandEmpty:()=>Ee,CommandGroup:()=>he,CommandInput:()=>lt,CommandItem:()=>Ke,CommandList:()=>mo,CommandSeparator:()=>co,CommandShortcut:()=>Ra,Dialog:()=>Ct,DialogClose:()=>qo,DialogContent:()=>it,DialogDescription:()=>to,DialogFooter:()=>jt,DialogHeader:()=>Jt,DialogOverlay:()=>Yo,DialogPortal:()=>ia,DialogTitle:()=>eo,DialogTrigger:()=>Ki,DropdownMenu:()=>qe,DropdownMenuCheckboxItem:()=>Wt,DropdownMenuContent:()=>Se,DropdownMenuGroup:()=>$i,DropdownMenuItem:()=>Me,DropdownMenuLabel:()=>Gt,DropdownMenuPortal:()=>Qi,DropdownMenuRadioGroup:()=>Yi,DropdownMenuRadioItem:()=>_r,DropdownMenuSeparator:()=>$t,DropdownMenuShortcut:()=>Wr,DropdownMenuSub:()=>qi,DropdownMenuSubContent:()=>Ur,DropdownMenuSubTrigger:()=>Or,DropdownMenuTrigger:()=>ht,FormControl:()=>ke,FormDescription:()=>io,FormField:()=>Ko,FormItem:()=>ro,FormLabel:()=>ao,FormMessage:()=>no,FormUI:()=>Xo,Input:()=>so,Label:()=>oo,Link:()=>F,Popover:()=>ae,PopoverContent:()=>ee,PopoverTrigger:()=>ie,ScrollArea:()=>vo,ScrollBar:()=>tr,Select:()=>wt,SelectContent:()=>ct,SelectGroup:()=>en,SelectItem:()=>pt,SelectLabel:()=>Ma,SelectSeparator:()=>ka,SelectTrigger:()=>dt,SelectValue:()=>Nt,Separator:()=>ye,Sheet:()=>Go,SheetClose:()=>Zi,SheetContent:()=>Qt,SheetDescription:()=>Xr,SheetFooter:()=>Yr,SheetHeader:()=>qr,SheetOverlay:()=>Qo,SheetPortal:()=>Qr,SheetTitle:()=>Zr,SheetTrigger:()=>$o,Table:()=>Yt,TableBody:()=>Xt,TableCaption:()=>ra,TableCell:()=>xt,TableFooter:()=>oa,TableHead:()=>Kt,TableHeader:()=>Zt,TableRow:()=>at,Textarea:()=>Da,badgeVariants:()=>ha,buttonVariants:()=>bt,useFormField:()=>Tt});var ue=h(r("@radix-ui/react-avatar")),Ut=h(r("react"));var Fr={};Ot(Fr,{cn:()=>i});var kr=r("clsx"),Er=r("tailwind-merge");function i(...e){return(0,Er.twMerge)((0,kr.clsx)(e))}var _t=r("react/jsx-runtime"),Br=Ut.forwardRef(({className:e,...t},o)=>(0,_t.jsx)(ue.Root,{ref:o,className:i("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Br.displayName=ue.Root.displayName;var Ar=Ut.forwardRef(({className:e,...t},o)=>(0,_t.jsx)(ue.Image,{ref:o,className:i("aspect-square h-full w-full",e),...t}));Ar.displayName=ue.Image.displayName;var Lr=Ut.forwardRef(({className:e,...t},o)=>(0,_t.jsx)(ue.Fallback,{ref:o,className:i("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Lr.displayName=ue.Fallback.displayName;var Ir=r("@radix-ui/react-slot"),Hr=r("class-variance-authority"),Vr=h(r("react"));var zr=r("react/jsx-runtime"),bt=(0,Hr.cva)("select-none inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),p=Vr.forwardRef(({className:e,variant:t,size:o,asChild:a=!1,...n},s)=>(0,zr.jsx)(a?Ir.Slot:"button",{className:i(bt({variant:t,size:o,className:e})),ref:s,...n}));p.displayName="Button";var fe=h(r("react")),u=h(r("@radix-ui/react-dropdown-menu")),et=r("@radix-ui/react-icons");var E=r("react/jsx-runtime"),qe=u.Root,ht=u.Trigger,$i=u.Group,Qi=u.Portal,qi=u.Sub,Yi=u.RadioGroup,Or=fe.forwardRef(({className:e,inset:t,children:o,...a},n)=>(0,E.jsxs)(u.SubTrigger,{ref:n,className:i("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...a,children:[o,(0,E.jsx)(et.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));Or.displayName=u.SubTrigger.displayName;var Ur=fe.forwardRef(({className:e,...t},o)=>(0,E.jsx)(u.SubContent,{ref:o,className:i("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));Ur.displayName=u.SubContent.displayName;var Se=fe.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,E.jsx)(u.Portal,{children:(0,E.jsx)(u.Content,{ref:a,sideOffset:t,className:i("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","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",e),...o})}));Se.displayName=u.Content.displayName;var Me=fe.forwardRef(({className:e,inset:t,...o},a)=>(0,E.jsx)(u.Item,{ref:a,className:i("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));Me.displayName=u.Item.displayName;var Wt=fe.forwardRef(({className:e,children:t,checked:o,...a},n)=>(0,E.jsxs)(u.CheckboxItem,{ref:n,className:i("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...a,children:[(0,E.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,E.jsx)(u.ItemIndicator,{children:(0,E.jsx)(et.CheckIcon,{className:"h-4 w-4"})})}),t]}));Wt.displayName=u.CheckboxItem.displayName;var _r=fe.forwardRef(({className:e,children:t,...o},a)=>(0,E.jsxs)(u.RadioItem,{ref:a,className:i("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,E.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,E.jsx)(u.ItemIndicator,{children:(0,E.jsx)(et.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));_r.displayName=u.RadioItem.displayName;var Gt=fe.forwardRef(({className:e,inset:t,...o},a)=>(0,E.jsx)(u.Label,{ref:a,className:i("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Gt.displayName=u.Label.displayName;var $t=fe.forwardRef(({className:e,...t},o)=>(0,E.jsx)(u.Separator,{ref:o,className:i("-mx-1 my-1 h-px bg-muted",e),...t}));$t.displayName=u.Separator.displayName;var Wr=({className:e,...t})=>(0,E.jsx)("span",{className:i("ml-auto text-xs tracking-widest opacity-60",e),...t});Wr.displayName="DropdownMenuShortcut";var w=h(r("@radix-ui/react-dialog")),Gr=r("@radix-ui/react-icons"),$r=r("class-variance-authority"),yt=h(r("react"));var X=r("react/jsx-runtime"),Go=w.Root,$o=w.Trigger,Zi=w.Close,Qr=w.Portal,Qo=yt.forwardRef(({className:e,...t},o)=>(0,X.jsx)(w.Overlay,{className:i("fixed inset-0 z-50 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));Qo.displayName=w.Overlay.displayName;var Xi=(0,$r.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-border border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Qt=yt.forwardRef(({side:e="right",className:t,children:o,...a},n)=>(0,X.jsxs)(Qr,{children:[(0,X.jsx)(Qo,{}),(0,X.jsxs)(w.Content,{ref:n,className:i(Xi({side:e}),t),...a,children:[o,(0,X.jsxs)(w.Close,{className:"absolute right-4 top-4 text-foreground rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,X.jsx)(Gr.Cross2Icon,{className:"h-4 w-4"}),(0,X.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Qt.displayName=w.Content.displayName;var qr=({className:e,...t})=>(0,X.jsx)("div",{className:i("flex flex-col space-y-2 text-center sm:text-left",e),...t});qr.displayName="SheetHeader";var Yr=({className:e,...t})=>(0,X.jsx)("div",{className:i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yr.displayName="SheetFooter";var Zr=yt.forwardRef(({className:e,...t},o)=>(0,X.jsx)(w.Title,{ref:o,className:i("text-lg font-semibold text-foreground",e),...t}));Zr.displayName=w.Title.displayName;var Xr=yt.forwardRef(({className:e,...t},o)=>(0,X.jsx)(w.Description,{ref:o,className:i("text-sm text-muted-foreground",e),...t}));Xr.displayName=w.Description.displayName;var Ye=h(r("react"));var Ze=r("react/jsx-runtime"),tt=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:i("border border-border bg-card text-card-foreground shadow",e),...t}));tt.displayName="Card";var Kr=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:i("flex flex-col space-y-1.5 p-6",e),...t}));Kr.displayName="CardHeader";var Jr=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("h3",{ref:o,className:i("font-semibold leading-none tracking-tight",e),...t}));Jr.displayName="CardTitle";var jr=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("p",{ref:o,className:i("text-sm text-muted-foreground",e),...t}));jr.displayName="CardDescription";var ot=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:i("p-6 pt-0",e),...t}));ot.displayName="CardContent";var qt=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:i("flex items-center p-6 pt-0",e),...t}));qt.displayName="CardFooter";var rt=r("@refinedev/core"),ea=r("react"),ta=r("react/jsx-runtime"),F=(0,ea.forwardRef)(({children:e,...t},o)=>{let a=(0,rt.useRouterType)(),n=(0,rt.useLink)(),{Link:s}=(0,rt.useRouterContext)();return(0,ta.jsx)(a==="legacy"?s:n,{ref:o,...t,children:e})});F.displayName="Link";var ve=h(r("react"));var ne=r("react/jsx-runtime"),Yt=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("div",{className:"relative w-full overflow-auto",children:(0,ne.jsx)("table",{ref:o,className:i("w-full caption-bottom text-sm",e),...t})}));Yt.displayName="Table";var Zt=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("thead",{ref:o,className:i("[&_tr]:border-b border-border",e),...t}));Zt.displayName="TableHeader";var Xt=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("tbody",{ref:o,className:i("[&_tr:last-child]:border-0",e),...t}));Xt.displayName="TableBody";var oa=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("tfoot",{ref:o,className:i("bg-primary font-medium text-primary-foreground",e),...t}));oa.displayName="TableFooter";var at=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("tr",{ref:o,className:i("border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));at.displayName="TableRow";var Kt=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("th",{ref:o,className:i("h-10 [&:has([role=checkbox])]:leading-[0] px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:pl-4 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Kt.displayName="TableHead";var xt=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("td",{ref:o,className:i("p-2 [&:has([role=checkbox])]:leading-[0] align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:pl-4 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xt.displayName="TableCell";var ra=ve.forwardRef(({className:e,...t},o)=>(0,ne.jsx)("caption",{ref:o,className:i("mt-4 text-sm text-muted-foreground",e),...t}));ra.displayName="TableCaption";var Rt=h(r("react")),N=h(r("@radix-ui/react-dialog")),aa=r("@radix-ui/react-icons");var K=r("react/jsx-runtime"),Ct=N.Root,Ki=N.Trigger,ia=N.Portal,qo=N.Close,Yo=Rt.forwardRef(({className:e,...t},o)=>(0,K.jsx)(N.Overlay,{ref:o,className:i("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Yo.displayName=N.Overlay.displayName;var it=Rt.forwardRef(({className:e,children:t,...o},a)=>(0,K.jsxs)(ia,{children:[(0,K.jsx)(Yo,{}),(0,K.jsxs)(N.Content,{ref:a,className:i("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border text-card-foreground bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...o,children:[t,(0,K.jsxs)(N.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,K.jsx)(aa.Cross2Icon,{className:"h-4 w-4"}),(0,K.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));it.displayName=N.Content.displayName;var Jt=({className:e,...t})=>(0,K.jsx)("div",{className:i("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jt.displayName="DialogHeader";var jt=({className:e,...t})=>(0,K.jsx)("div",{className:i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jt.displayName="DialogFooter";var eo=Rt.forwardRef(({className:e,...t},o)=>(0,K.jsx)(N.Title,{ref:o,className:i("text-lg font-semibold leading-none tracking-tight",e),...t}));eo.displayName=N.Title.displayName;var to=Rt.forwardRef(({className:e,...t},o)=>(0,K.jsx)(N.Description,{ref:o,className:i("text-sm text-muted-foreground",e),...t}));to.displayName=N.Description.displayName;var $=h(r("react")),ma=r("@radix-ui/react-slot"),nt=r("react-hook-form");var na=h(r("react")),Zo=h(r("@radix-ui/react-label")),sa=r("class-variance-authority");var la=r("react/jsx-runtime"),Ji=(0,sa.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),oo=na.forwardRef(({className:e,...t},o)=>(0,la.jsx)(Zo.Root,{ref:o,className:i(Ji(),e),...t}));oo.displayName=Zo.Root.displayName;var ge=r("react/jsx-runtime"),Xo=nt.FormProvider,da=$.createContext({}),Ko=({...e})=>(0,ge.jsx)(da.Provider,{value:{name:e.name},children:(0,ge.jsx)(nt.Controller,{...e})}),Tt=()=>{let e=$.useContext(da),t=$.useContext(ca),{getFieldState:o,formState:a}=(0,nt.useFormContext)(),n=o(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...n}},ca=$.createContext({}),ro=$.forwardRef(({className:e,...t},o)=>{let a=$.useId();return(0,ge.jsx)(ca.Provider,{value:{id:a},children:(0,ge.jsx)("div",{ref:o,className:i("space-y-2",e),...t})})});ro.displayName="FormItem";var ao=$.forwardRef(({className:e,...t},o)=>{let{error:a,formItemId:n}=Tt();return(0,ge.jsx)(oo,{ref:o,className:i(a&&"text-destructive",e),htmlFor:n,...t})});ao.displayName="FormLabel";var ke=$.forwardRef(({...e},t)=>{let{error:o,formItemId:a,formDescriptionId:n,formMessageId:s}=Tt();return(0,ge.jsx)(ma.Slot,{ref:t,id:a,"aria-describedby":o?`${n} ${s}`:`${n}`,"aria-invalid":!!o,...e})});ke.displayName="FormControl";var io=$.forwardRef(({className:e,...t},o)=>{let{formDescriptionId:a}=Tt();return(0,ge.jsx)("p",{ref:o,id:a,className:i("text-[0.8rem] text-muted-foreground",e),...t})});io.displayName="FormDescription";var no=$.forwardRef(({className:e,children:t,...o},a)=>{let{error:n,formMessageId:s}=Tt(),l=n?String(n?.message):t;return l?(0,ge.jsx)("p",{ref:a,id:s,className:i("text-[0.8rem] font-medium text-destructive",e),...o,children:l}):null});no.displayName="FormMessage";var pa=h(r("react"));var ua=r("react/jsx-runtime"),so=pa.forwardRef(({className:e,type:t,...o},a)=>(0,ua.jsx)("input",{type:t,className:i("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));so.displayName="Input";var fa=h(r("react")),Pt=h(r("@radix-ui/react-checkbox")),va=r("lucide-react");var ga=r("@radix-ui/react-icons"),st=r("react/jsx-runtime"),lo=fa.forwardRef(({className:e,...t},o)=>(0,st.jsx)(Pt.Root,{ref:o,className:i("peer relative h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:(0,st.jsxs)(Pt.Indicator,{className:i("flex items-center justify-center text-current absolute top-0 left-0 right-0 bottom-0"),children:[t.checked==="indeterminate"&&(0,st.jsx)(ga.DividerHorizontalIcon,{}),t.checked===!0&&(0,st.jsx)(va.CheckIcon,{className:"h-4 w-4"})]})}));lo.displayName=Pt.Root.displayName;var ba=r("class-variance-authority");var ya=r("react/jsx-runtime"),ha=(0,ba.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Xe({className:e,variant:t,...o}){return(0,ya.jsx)("div",{className:i(ha({variant:t}),e),...o})}var j=h(r("react")),xa=r("@radix-ui/react-icons"),V=r("cmdk");var H=r("react/jsx-runtime"),be=j.forwardRef(({className:e,...t},o)=>(0,H.jsx)(V.Command,{ref:o,className:i("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));be.displayName=V.Command.displayName;var ji=({children:e,...t})=>(0,H.jsx)(Ct,{...t,children:(0,H.jsx)(it,{className:"overflow-hidden p-0",children:(0,H.jsx)(be,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),lt=j.forwardRef(({className:e,...t},o)=>{let a=j.useRef(null);return j.useEffect(()=>{a.current&&a.current.setAttribute("cmdk-input-wrapper","")},[a]),(0,H.jsxs)("div",{className:"flex items-center border-border border-b px-3",ref:a,children:[(0,H.jsx)(xa.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,H.jsx)(V.Command.Input,{ref:o,className:i("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})});lt.displayName=V.Command.Input.displayName;var mo=j.forwardRef(({className:e,...t},o)=>(0,H.jsx)(V.Command.List,{ref:o,className:i("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));mo.displayName=V.Command.List.displayName;var Ee=j.forwardRef((e,t)=>(0,H.jsx)(V.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ee.displayName=V.Command.Empty.displayName;var he=j.forwardRef(({className:e,...t},o)=>(0,H.jsx)(V.Command.Group,{ref:o,className:i("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));he.displayName=V.Command.Group.displayName;var co=j.forwardRef(({className:e,...t},o)=>(0,H.jsx)(V.Command.Separator,{ref:o,className:i("-mx-1 h-px bg-border",e),...t}));co.displayName=V.Command.Separator.displayName;var Ke=j.forwardRef(({className:e,...t},o)=>(0,H.jsx)(V.Command.Item,{ref:o,className:i("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Ke.displayName=V.Command.Item.displayName;var Ra=({className:e,...t})=>(0,H.jsx)("span",{className:i("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Ra.displayName="CommandShortcut";var Ca=h(r("react")),Jo=h(r("@radix-ui/react-separator"));var Ta=r("react/jsx-runtime"),ye=Ca.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...a},n)=>(0,Ta.jsx)(Jo.Root,{ref:n,decorative:o,orientation:t,className:i("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));ye.displayName=Jo.Root.displayName;var Pa=h(r("react")),xe=h(r("@radix-ui/react-popover"));var jo=r("react/jsx-runtime"),ae=xe.Root,ie=xe.Trigger,ee=Pa.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},n)=>(0,jo.jsx)(xe.Portal,{children:(0,jo.jsx)(xe.Content,{ref:n,align:t,sideOffset:o,className:i("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...a})}));ee.displayName=xe.Content.displayName;var uo=r("@radix-ui/react-icons"),wa=r("react-day-picker");var po=r("react/jsx-runtime");function fo({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,po.jsx)(wa.DayPicker,{showOutsideDays:o,className:i("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:i(bt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:i("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:i(bt({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>(0,po.jsx)(uo.ChevronLeftIcon,{className:"h-4 w-4"}),IconRight:()=>(0,po.jsx)(uo.ChevronRightIcon,{className:"h-4 w-4"})},...a})}fo.displayName="Calendar";var Na=h(r("react"));var Sa=r("react/jsx-runtime"),Da=Na.forwardRef(({className:e,...t},o)=>(0,Sa.jsx)("textarea",{className:i("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Da.displayName="Textarea";var te=h(r("@radix-ui/react-scroll-area")),er=h(r("react"));var Fe=r("react/jsx-runtime"),vo=er.forwardRef(({className:e,children:t,...o},a)=>(0,Fe.jsxs)(te.Root,{ref:a,className:i("relative overflow-hidden",e),...o,children:[(0,Fe.jsx)(te.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Fe.jsx)(tr,{}),(0,Fe.jsx)(te.Corner,{})]}));vo.displayName=te.Root.displayName;var tr=er.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Fe.jsx)(te.ScrollAreaScrollbar,{ref:a,orientation:t,className:i("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Fe.jsx)(te.ScrollAreaThumb,{className:i("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));tr.displayName=te.ScrollAreaScrollbar.displayName;var mt=h(r("react")),go=r("@radix-ui/react-icons"),g=h(r("@radix-ui/react-select"));var z=r("react/jsx-runtime"),wt=g.Root,en=g.Group,Nt=g.Value,dt=mt.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(g.Trigger,{ref:a,className:i("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...o,children:[t,(0,z.jsx)(g.Icon,{asChild:!0,children:(0,z.jsx)(go.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));dt.displayName=g.Trigger.displayName;var ct=mt.forwardRef(({className:e,children:t,position:o="popper",...a},n)=>(0,z.jsx)(g.Portal,{children:(0,z.jsx)(g.Content,{ref:n,className:i("relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md 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",o==="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:o,...a,children:(0,z.jsx)(g.Viewport,{className:i("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ct.displayName=g.Content.displayName;var Ma=mt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(g.Label,{ref:o,className:i("px-2 py-1.5 text-sm font-semibold",e),...t}));Ma.displayName=g.Label.displayName;var pt=mt.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(g.Item,{ref:a,className:i("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,z.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,z.jsx)(g.ItemIndicator,{children:(0,z.jsx)(go.CheckIcon,{className:"h-4 w-4"})})}),(0,z.jsx)(g.ItemText,{children:t})]}));pt.displayName=g.Item.displayName;var ka=mt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(g.Separator,{ref:o,className:i("-mx-1 my-1 h-px bg-muted",e),...t}));ka.displayName=g.Separator.displayName;var O=r("react/jsx-runtime"),Ae=({showHome:e=!0,hideIcons:t=!1,meta:o})=>{let{breadcrumbs:a}=(0,Be.useBreadcrumb)({meta:o}),{hasDashboard:n}=(0,Be.useRefineContext)(),{resources:s}=(0,Be.useResource)(),l=(0,Be.matchResourceFromRoute)("/",s),m=()=>t?null:(0,O.jsx)("svg",{className:"h-5 w-5 flex-shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,O.jsx)("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),d=a.map(({label:c,href:f},b)=>(0,O.jsx)("li",{children:(0,O.jsxs)("div",{className:"flex items-center",children:[m(),f?(0,O.jsx)(F,{to:f,title:c,className:"ml-4 text-sm font-medium",children:c}):(0,O.jsx)("span",{className:"ml-4",children:c})]})},b));return(0,O.jsx)("nav",{className:"flex","aria-label":"Breadcrumb",children:(0,O.jsxs)("ol",{role:"list",className:"flex items-center space-x-4",children:[e||n||l.found?(0,O.jsx)("li",{children:(0,O.jsx)("div",{children:(0,O.jsxs)(F,{to:"/",title:"Home",children:[l?.resource?.meta?.icon??(0,O.jsx)(Fa.HomeIcon,{size:16}),(0,O.jsx)("span",{className:"sr-only",children:"Home"})]})})}):null,d]})})};var Le=r("@refinedev/core");var J=r("react/jsx-runtime"),tn=({title:e,resource:t,breadcrumb:o,extra:a,children:n})=>{let s=(0,Le.useTranslate)(),{options:{breadcrumb:l}={}}=(0,Le.useRefineContext)(),m=(0,Le.useUserFriendlyName)(),{resource:d,identifier:c}=(0,Le.useResource)(t),f=typeof o>"u"?l:o;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ie,{title:e??s(`${c}.titles.List`,`Create ${m(d?.meta?.label??d?.options?.label??d?.label??c,"singular")}`),isBack:!0,breadcrumb:typeof f<"u"?(0,J.jsx)(J.Fragment,{children:f})??void 0:(0,J.jsx)(Ae,{}),extra:a??(0,J.jsx)(J.Fragment,{children:(0,J.jsx)(or,{resource:t})})}),(0,J.jsx)("div",{className:"relative pt-4 !mt-0",children:n})]})};var ze=r("@refinedev/core");var Ya={};Ot(Ya,{DeleteContext:()=>ft,DeleteProvider:()=>Je,ViteDarkModeProvider:()=>on,notificationProvider:()=>qa,useNotificationProvider:()=>mn});var Ro=r("react");var _a=r("@refinedev/core"),yo=r("lucide-react"),xo=r("react");var Ba=r("@radix-ui/react-icons");var U=r("react/jsx-runtime"),He=e=>(0,U.jsx)(Me,{disabled:e.disabled,asChild:!(!e.to||!e.to&&!e.children),onClick:e.onClick,children:e.asChild?e.children:e.to?(0,U.jsxs)(F,{disabled:e.disabled,replace:!1,to:e.to,title:e.title,children:[e.icon?(0,U.jsx)("span",{className:"mr-2",children:e.icon}):null,e.title]}):(0,U.jsxs)(U.Fragment,{children:[e.icon?(0,U.jsx)("span",{className:"mr-2",children:e.icon}):null,e.title]})});function Aa({children:e}){return(0,U.jsxs)(qe,{children:[(0,U.jsx)(ht,{asChild:!0,children:(0,U.jsxs)(p,{variant:"ghost",className:"flex h-8 w-8 p-0 data-[state=open]:bg-muted",children:[(0,U.jsx)(Ba.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,U.jsx)("span",{className:"sr-only",children:"Open menu"})]})}),(0,U.jsx)(Se,{align:"end",className:"w-[160px]",children:e})]})}var Ua={};Ot(Ua,{useDarkMode:()=>nr,useDeleteHelper:()=>ut,useGetEditUrl:()=>rr,useGetShowUrl:()=>ar,useOnBack:()=>ir});var se=r("@refinedev/core"),La=r("react"),rr=(e,t,o)=>{let a=(0,La.useContext)(se.AccessControlContext),n=a.options.buttons.enableAccessControl,s=a.options.buttons.hideIfUnauthorized,{editUrl:l}=(0,se.useNavigation)(),{id:m,resource:d}=(0,se.useResource)(e),{data:c}=(0,se.useCan)({resource:e,action:"edit",params:{id:t,resource:d},queryOptions:{enabled:n}}),f=(0,se.useTranslate)(),b=()=>c?.can?"":c?.reason?c.reason:f("buttons.notAccessTitle","You don't have permission to access"),S=e&&(t??m)?l(e,t??m,o):"";return{can:!(n&&s&&!c?.can),reason:b(),url:S}};var le=r("@refinedev/core"),Ia=r("react"),ar=(e,t,o)=>{let a=(0,Ia.useContext)(le.AccessControlContext),n=a.options.buttons.enableAccessControl,s=a.options.buttons.hideIfUnauthorized,{showUrl:l}=(0,le.useNavigation)(),{id:m,resource:d}=(0,le.useResource)(e),{data:c}=(0,le.useCan)({resource:e,action:"show",params:{id:t,resource:d},queryOptions:{enabled:n}}),f=(0,le.useTranslate)(),b=()=>c?.can?"":c?.reason?c.reason:f("buttons.notAccessTitle","You don't have permission to access"),S=e&&(t||m)?l(e,t??m,o):"";return{can:!(n&&s&&!c?.can),reason:b(),url:S}};var B=r("@refinedev/core"),Ha=r("react"),ut=(e,t,o)=>{let a=(0,Ha.useContext)(B.AccessControlContext),n=a.options.buttons.enableAccessControl,s=a.options.buttons.hideIfUnauthorized,l=(0,B.useTranslate)(),{id:m,resource:d,identifier:c}=(0,B.useResource)(e),{mutationMode:f}=(0,B.useMutationMode)(),{mutate:b,isLoading:S}=(0,B.useDelete)(),{data:y}=(0,B.useCan)({resource:d?.name,action:"delete",params:{id:t??m,resource:d},queryOptions:{enabled:n}}),T=()=>y?.can?"":y?.reason?y.reason:l("buttons.notAccessTitle","You don't have permission to access"),{setWarnWhen:L}=(0,B.useWarnAboutChange)(),R=G=>{if(!(n&&s&&!y?.can)&&(t??m)&&c)return L(!1),b({id:t??m??"",resource:c,mutationMode:f,meta:(0,B.pickNotDeprecated)(o),metaData:(0,B.pickNotDeprecated)(o)},G)};return{can:!(n&&s&&!y?.can),reason:T(),mutate:R,isLoading:S}};var Ve=r("@refinedev/core"),ir=()=>{let e=(0,Ve.useRouterType)(),t=(0,Ve.useBack)(),{goBack:o}=(0,Ve.useNavigation)(),{action:a}=(0,Ve.useResource)();return a!=="list"||typeof a<"u"?e==="legacy"?o:t:void 0};var za=r("react");var bo=r("react");var Va=r("react/jsx-runtime");function on({children:e,defaultDarkMode:t="system",storageKey:o="vite-ui-theme",...a}){let[n,s]=(0,bo.useState)(()=>localStorage.getItem(o)||t);(0,bo.useEffect)(()=>{let m=window.document.documentElement,d=window.matchMedia("(prefers-color-scheme: dark)");(()=>{if(m.classList.remove("light","dark"),n==="system"){let b=d.matches?"dark":"light";m.classList.add(b);return}m.classList.add(n)})();let f=b=>{if(n==="system"&&(m.classList.remove("light","dark"),b.matches)){let S=b.matches?"dark":"light";m.classList.add(S)}};return d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[n]);let l={theme:n,setDarkMode:m=>{localStorage.setItem(o,m),s(m)}};return(0,Va.jsx)(ho.Provider,{...a,value:l,children:e})}var rn={theme:"system",setDarkMode:()=>null},ho=(0,za.createContext)(rn);var Oa=r("react"),nr=()=>{let e=(0,Oa.useContext)(ho);if(e===void 0)throw new Error("useDarkMode must be used within a DarkModeProvider");return e};var Wa=r("@radix-ui/react-icons"),I=r("react/jsx-runtime");function Ga(e){let t=ir(),{can:o,isLoading:a,mutate:n}=ut(e.data?.resource,e.data?.row?.id),s=(0,_a.useTranslate)(),l=(0,xo.useCallback)(()=>{if(o)return n({onSuccess(){let m=e?.data?.redirectBack??!1;e?.updateData({toogle:!1,row:void 0,resource:"",redirectBack:!1}),m&&t?.()}})},[n,o]);return(0,I.jsx)(Ct,{open:o&&e?.data?.toogle,onOpenChange:()=>{a||e?.updateData({toogle:!1,row:void 0,resource:""})},children:(0,I.jsxs)(it,{onPointerDownOutside:m=>m.preventDefault(),children:[(0,I.jsxs)(Jt,{children:[(0,I.jsxs)(eo,{className:"inline-flex flex-row items-center gap-x-2",children:[(0,I.jsx)(yo.AlertTriangleIcon,{}),s("actions.delete.title","Are you sure absolutely sure?")]}),(0,I.jsx)(to,{children:s("actions.delete.title","If this action can be undone later, this data will be temporarily deleted.")})]}),(0,I.jsx)(jt,{className:"sm:justify-end",children:(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row gap-x-3",children:[(0,I.jsx)(qo,{asChild:!0,children:(0,I.jsx)(p,{disabled:a,type:"button",variant:"secondary",children:"Cancel"})}),(0,I.jsxs)(p,{type:"button",variant:"destructive",onClick:l,disabled:a,children:[a?(0,I.jsx)(Wa.ReloadIcon,{className:"mr-2 h-4 w-4 animate-spin"}):(0,I.jsx)(yo.Trash2,{size:16,className:"mr-2"}),"Delete"]})]})})]})})}function sr({row:e,resource:t,title:o,disabled:a,withForceDelete:n,...s}){let{can:l,reason:m}=ut(t,e.id),d=(0,xo.useContext)(ft);return(0,I.jsx)(He,{...s,disabled:!l,title:l?o:m,onClick:()=>d?.updateData({row:e,resource:t,toogle:!0})})}sr.displayName="DeleteAction";var Co=r("react/jsx-runtime"),ft=(0,Ro.createContext)(void 0),Je=({children:e})=>{let[t,o]=(0,Ro.useState)({row:void 0,resource:"",toogle:!1}),a=n=>{o(n)};return(0,Co.jsxs)(ft.Provider,{value:{data:t,updateData:a},children:[e,(0,Co.jsx)(Ga,{data:t,updateData:a})]})};var No=h(r("react")),an=5,nn=3e3;var lr=0;function sn(){return lr=(lr+1)%Number.MAX_VALUE,lr.toString()}var mr=new Map,$a=e=>{if(mr.has(e))return;let t=setTimeout(()=>{mr.delete(e),Dt({type:"REMOVE_TOAST",toastId:e})},nn);mr.set(e,t)},ln=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,an)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case"DISMISS_TOAST":{let{toastId:o}=t;return o?$a(o):e.toasts.forEach(a=>{$a(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===o||o===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)}}},To=[],Po={toasts:[]};function Dt(e){Po=ln(Po,e),To.forEach(t=>{t(Po)})}var wo=e=>Dt({type:"DISMISS_TOAST",toastId:e});function dr({...e}){let t=e.id+"_"+sn(),o=a=>Dt({type:"UPDATE_TOAST",toast:{...a,id:t}});return Dt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||wo(t)}}}),{id:t,dismiss:wo,update:o}}function Qa(){let[e,t]=No.useState(Po);return No.useEffect(()=>(To.push(t),()=>{let o=To.indexOf(t);o>-1&&To.splice(o,1)}),[e]),{...e,toast:dr,dismiss:o=>Dt({type:"DISMISS_TOAST",toastId:o})}}var qa={open:({key:e,message:t,description:o,type:a})=>dr({id:e,description:o,title:t,variant:a==="error"?"destructive":"default"}),close:e=>wo(e)},mn=()=>qa;var oe=r("react/jsx-runtime"),dn=({title:e,resource:t,extra:o,breadcrumb:a,children:n})=>{let s=(0,ze.useTranslate)(),{options:{breadcrumb:l}={}}=(0,ze.useRefineContext)(),m=(0,ze.useUserFriendlyName)(),{resource:d,action:c,identifier:f}=(0,ze.useResource)(t),b=typeof a>"u"?l:a;return(0,oe.jsxs)(Je,{children:[(0,oe.jsx)(Ie,{title:e??s(`${f}.titles.List`,`Edit ${m(d?.meta?.label??d?.options?.label??d?.label??f,"plural")}`),isBack:!0,breadcrumb:typeof b<"u"?(0,oe.jsx)(oe.Fragment,{children:b})??void 0:(0,oe.jsx)(Ae,{}),extra:o??(0,oe.jsxs)("div",{className:"inline-flex flex-row items-center gap-x-2",children:[(0,oe.jsx)(cr,{resource:t}),(0,oe.jsx)(St,{resource:t})]})}),(0,oe.jsx)("div",{className:"relative pt-4",children:n})]})};var Oe=r("@refinedev/core");var Re=r("react/jsx-runtime"),Za=({title:e,content:t})=>(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsx)("dl",{className:"flex flex-wrap",children:(0,Re.jsxs)("div",{className:"flex-auto pl-6 pt-6",children:[(0,Re.jsx)("dt",{className:"scroll-m-20 text-lg font-semibold tracking-tight",children:e}),(0,Re.jsx)("dd",{className:"mt-1 text-base font-normal text-foreground leading-7",children:t})]})})});var Q=r("react/jsx-runtime"),Xa=({title:e,resource:t,breadcrumb:o,extra:a,children:n})=>{let s=(0,Oe.useTranslate)(),{options:{breadcrumb:l}={}}=(0,Oe.useRefineContext)(),m=(0,Oe.useUserFriendlyName)(),{resource:d,identifier:c}=(0,Oe.useResource)(t),f=typeof o>"u"?l:o;return(0,Q.jsxs)(Je,{children:[(0,Q.jsx)(Ie,{title:e??s(`${c}.titles.List`,`Show ${m(d?.meta?.label??d?.options?.label??d?.label??c,"singular")}`),breadcrumb:typeof f<"u"?(0,Q.jsx)(Q.Fragment,{children:f})??void 0:(0,Q.jsx)(Ae,{}),isBack:!0,extra:a??(0,Q.jsxs)("div",{className:"inline-flex items-center gap-x-2",children:[(0,Q.jsx)(pr,{resource:t}),(0,Q.jsx)(St,{resource:t})]})}),(0,Q.jsx)("div",{className:"relative pt-4 !mt-0",children:(0,Q.jsx)(tt,{children:(0,Q.jsx)(ot,{children:n})})})]})};Xa.Row=Za;var Ue=r("@refinedev/core");var _=r("react/jsx-runtime"),cn=({title:e,resource:t,breadcrumb:o,createButtonProps:a,extra:n,children:s})=>{let l=(0,Ue.useTranslate)(),{options:{breadcrumb:m}={}}=(0,Ue.useRefineContext)(),d=(0,Ue.useUserFriendlyName)(),{resource:c,identifier:f}=(0,Ue.useResource)(t),b=typeof o>"u"?m:o;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Ie,{title:e??l(`${f}.titles.List`,`List ${d(c?.meta?.label??c?.options?.label??c?.label??f,"plural")}`),breadcrumb:typeof b<"u"?(0,_.jsx)(_.Fragment,{children:b})??void 0:(0,_.jsx)(Ae,{}),extra:n??(0,_.jsx)(_.Fragment,{children:(0,_.jsx)("div",{className:"inline-flex flex-row gap-4",children:(0,_.jsx)(ur,{...a,resource:a?.resource??f})})})}),(0,_.jsx)(Je,{children:(0,_.jsx)("div",{className:"relative pt-2 sm:pt-4 !mt-0",children:s})})]})};var me=r("@refinedev/core"),Ka=r("react"),Do=r("@refinedev/ui-types"),Ja=r("lucide-react");var Mt=r("react/jsx-runtime"),ur=({resource:e,resourceNameOrRouteName:t,hideText:o=!1,accessControl:a,meta:n,children:s,onClick:l,...m})=>{let d=(0,Ka.useContext)(me.AccessControlContext),c=a?.enabled??d.options.buttons.enableAccessControl,f=a?.hideIfUnauthorized??d.options.buttons.hideIfUnauthorized,b=(0,me.useTranslate)(),{createUrl:S}=(0,me.useNavigation)(),{resource:y}=(0,me.useResource)(e??t),{data:T}=(0,me.useCan)({resource:y?.name,action:"create",queryOptions:{enabled:c},params:{resource:y}}),L=()=>T?.can?"":T?.reason?T.reason:b("buttons.notAccessTitle","You don't have permission to access"),R=y?S(y,n):"";return c&&f&&!T?.can?null:(0,Mt.jsx)(p,{asChild:!0,disabled:T?.can===!1,"data-testid":Do.RefineButtonTestIds.CreateButton,className:Do.RefineButtonClassNames.CreateButton,...m,children:(0,Mt.jsxs)(F,{onClick:G=>{if(T?.can===!1){G.preventDefault();return}l&&(G.preventDefault(),l(G))},to:R,replace:!1,title:L(),children:[(0,Mt.jsx)(Ja.PlusSquare,{className:i(o?"":"mr-2"),size:16}),!o&&(s??b("buttons.create","Create"))]})})};var de=r("@refinedev/core"),So=r("@refinedev/ui-types"),ja=r("react");var ei=r("lucide-react"),kt=r("react/jsx-runtime"),pr=({resource:e,resourceNameOrRouteName:t,recordItemId:o,hideText:a=!1,accessControl:n,meta:s,children:l,onClick:m,...d})=>{let c=(0,ja.useContext)(de.AccessControlContext),f=n?.enabled??c.options.buttons.enableAccessControl,b=n?.hideIfUnauthorized??c.options.buttons.hideIfUnauthorized,S=(0,de.useTranslate)(),{editUrl:y}=(0,de.useNavigation)(),{id:T,resource:L}=(0,de.useResource)(e??t),{data:R}=(0,de.useCan)({resource:L?.name,action:"edit",params:{id:o??T,resource:L},queryOptions:{enabled:f}}),G=()=>R?.can?"":R?.reason?R.reason:S("buttons.notAccessTitle","You don't have permission to access"),De=L&&(o??T)?y(L,o??T,s):"";return f&&b&&!R?.can?null:(0,kt.jsx)(p,{asChild:!0,disabled:R?.can===!1,title:G(),"data-testid":So.RefineButtonTestIds.EditButton,className:So.RefineButtonClassNames.EditButton,size:a?"icon":d.size??"default",onClick:Z=>{if(R?.can===!1){Z.preventDefault();return}m&&(Z.preventDefault(),m(Z))},...d,children:(0,kt.jsxs)(F,{to:De,replace:!1,children:[(0,kt.jsx)(ei.Edit,{className:i(a?"":"mr-2"),size:16}),!a&&(l??S("buttons.edit","Edit"))]})})};var Mo=r("@refinedev/core"),ko=r("@refinedev/ui-types"),fr=r("react"),ti=r("lucide-react");var Eo=r("react/jsx-runtime"),St=({resource:e,resourceNameOrRouteName:t,recordItemId:o,onSuccess:a,mutationMode:n,children:s,successNotification:l,errorNotification:m,hideText:d=!1,accessControl:c,metaData:f,meta:b,dataProviderName:S,confirmTitle:y,confirmOkText:T,confirmCancelText:L,invalidates:R,...G})=>{let De=(0,fr.useContext)(Mo.AccessControlContext),Z=c?.enabled??De.options.buttons.enableAccessControl,Li=c?.hideIfUnauthorized??De.options.buttons.hideIfUnauthorized,Ii=(0,Mo.useTranslate)(),{can:Mr,reason:Hi}=ut(e,o),Vi=(0,fr.useContext)(ft);return Z&&Li&&Mr?null:(0,Eo.jsxs)(p,{title:Hi,disabled:Mr===!1,"data-testid":ko.RefineButtonTestIds.DeleteButton,variant:"destructive",className:ko.RefineButtonClassNames.DeleteButton,size:d?"icon":G.size??"default",onClick:()=>{Vi?.updateData({toogle:!0,row:{id:o},redirectBack:!0,resource:e})},...G,children:[(0,Eo.jsx)(ti.Trash2,{className:i(d?"":"mr-2"),size:16}),!d&&(s??Ii("buttons.delete","Delete"))]})};var ce=r("@refinedev/core"),Fo=r("@refinedev/ui-types"),oi=r("react");var ri=r("lucide-react"),Et=r("react/jsx-runtime"),cr=({resource:e,resourceNameOrRouteName:t,recordItemId:o,hideText:a=!1,accessControl:n,meta:s,children:l,onClick:m,...d})=>{let c=(0,oi.useContext)(ce.AccessControlContext),f=n?.enabled??c.options.buttons.enableAccessControl,b=n?.hideIfUnauthorized??c.options.buttons.hideIfUnauthorized,{showUrl:S}=(0,ce.useNavigation)(),y=(0,ce.useTranslate)(),{id:T,resource:L}=(0,ce.useResource)(e??t),{data:R}=(0,ce.useCan)({resource:L?.name,action:"show",params:{id:o??T,resource:L},queryOptions:{enabled:f}}),G=()=>R?.can?"":R?.reason?R.reason:y("buttons.notAccessTitle","You don't have permission to access"),De=L&&(o||T)?S(L,o??T,s):"";return f&&b&&!R?.can?null:(0,Et.jsx)(p,{asChild:!0,disabled:R?.can===!1,title:G(),"data-testid":Fo.RefineButtonTestIds.ShowButton,className:Fo.RefineButtonClassNames.ShowButton,...d,children:(0,Et.jsxs)(F,{to:De,replace:!1,onClick:Z=>{if(R?.can===!1){Z.preventDefault();return}m&&(Z.preventDefault(),m(Z))},children:[(0,Et.jsx)(ri.EyeIcon,{size:16,className:"mr-2"}),!a&&(l??y("buttons.show","Show"))]})})};var q=r("@refinedev/core"),Bo=r("@refinedev/ui-types"),ai=r("react"),ii=r("lucide-react");var Ft=r("react/jsx-runtime"),or=({resource:e,resourceNameOrRouteName:t,hideText:o=!1,accessControl:a,meta:n,children:s,onClick:l,...m})=>{let d=(0,ai.useContext)(q.AccessControlContext),c=a?.enabled??d.options.buttons.enableAccessControl,f=a?.hideIfUnauthorized??d.options.buttons.hideIfUnauthorized,{listUrl:b}=(0,q.useNavigation)(),S=(0,q.useTranslate)(),{resource:y,identifier:T}=(0,q.useResource)(e??t),L=(0,q.useUserFriendlyName)(),{data:R}=(0,q.useCan)({resource:y?.name,action:"list",queryOptions:{enabled:c},params:{resource:y}}),G=()=>R?.can?"":R?.reason?R.reason:S("buttons.notAccessTitle","You don't have permission to access"),De=y?b(y,n):"";return c&&f&&!R?.can?null:(0,Ft.jsx)(p,{disabled:R?.can===!1,asChild:!0,title:G(),"data-testid":Bo.RefineButtonTestIds.ListButton,className:Bo.RefineButtonClassNames.ListButton,...m,children:(0,Ft.jsxs)(F,{to:De,replace:!1,onClick:Z=>{if(R?.can===!1){Z.preventDefault();return}l&&(Z.preventDefault(),l(Z))},children:[(0,Ft.jsx)(ii.List,{size:16,className:"mr-2"}),!o&&(s??S(`${T??e??t}.titles.list`,L(y?.meta?.label??y?.label??T??(0,q.pickNotDeprecated)(e,t),"plural")))]})})};var ni=r("@refinedev/core"),Ao=r("@refinedev/ui-types"),si=r("lucide-react");var li=r("@radix-ui/react-icons"),Bt=r("react/jsx-runtime"),vr=({hideText:e=!1,children:t,loading:o,...a})=>{let n=(0,ni.useTranslate)();return(0,Bt.jsxs)(p,{"data-testid":Ao.RefineButtonTestIds.SaveButton,className:Ao.RefineButtonClassNames.SaveButton,size:e?"icon":a.size??"default",...a,children:[o?(0,Bt.jsx)(li.ReloadIcon,{className:"mr-2 h-4 w-4 animate-spin"}):(0,Bt.jsx)(si.Save,{className:"mr-2",size:16}),!e&&(t??n("buttons.save","Save"))]})};var Ce=r("react/jsx-runtime"),Ie=({extra:e,...t})=>(0,Ce.jsxs)("div",{className:i("flex h-20 items-end lg:justify-between",t.className),children:[(0,Ce.jsxs)("div",{className:"min-w-0 flex-1",children:[t.breadcrumb,(0,Ce.jsx)("div",{className:"inline-flex flex-row items-center gap-x-4 mt-3",children:(0,Ce.jsxs)("div",{className:"inline-flex flex-col",children:[(0,Ce.jsx)("h2",{className:"text-2xl font-bold leading-7 text-black dark:text-white sm:truncate sm:text-3xl sm:tracking-tight",children:t.title}),t.subTitle&&(0,Ce.jsx)("div",{className:"mt-2 flex items-center text-sm text-gray-300",children:t.subTitle})]})})]}),(0,Ce.jsx)("div",{className:"flex lg:ml-4 lg:mt-0",children:e})]});var bi=r("react");var Lo=r("lucide-react");var re=r("react/jsx-runtime"),mi=()=>{let{setDarkMode:e}=nr();return(0,re.jsxs)(qe,{children:[(0,re.jsx)(ht,{asChild:!0,children:(0,re.jsxs)(p,{variant:"outline",size:"icon",children:[(0,re.jsx)(Lo.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,re.jsx)(Lo.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,re.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,re.jsxs)(Se,{align:"end",children:[(0,re.jsx)(Me,{onClick:()=>e("light"),children:"Light"}),(0,re.jsx)(Me,{onClick:()=>e("dark"),children:"Dark"}),(0,re.jsx)(Me,{onClick:()=>e("sys