shadboard 0.0.4 → 0.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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import*as N from'react';import {useState,useEffect}from'react';import {createSlot,Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {ArrowLeft,Loader2,PlusSquare,FolderDown,Trash,RefreshCcw,Eye,List,FolderUp,Save,Copy,Check,Minus,Home,RotateCcwSquare,CheckCircle,FileExclamationPoint,Dot,ChevronRight,CirclePlus,Mail,UserCircle,CreditCard,Bell,LogOut,PanelLeftIcon,XIcon,ListIcon}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as ot from'@radix-ui/react-separator';import*as T from'@radix-ui/react-dialog';import*as k from'@radix-ui/react-tooltip';import {useRefineOptions,useLink,useTranslate,useRefineContext,useUserFriendlyName,useResourceParams,useBack,useCreateButton,useEditButton,useDeleteButton,useRefreshButton,useShowButton,useListButton,useExportButton,useSaveButton,useCloneButton,useImportButton,useGo,useBreadcrumb,matchResourceFromRoute,AutoSaveIndicator,useGetIdentity,useMenu,CanAccess}from'@refinedev/core';import'react-dom';import*as re from'@radix-ui/react-avatar';import*as y from'@radix-ui/react-dropdown-menu';import {ThemeProvider}from'next-themes';import*as U from'@radix-ui/react-popover';import {toast}from'sonner';var Ie=768;function tt(){let[e,t]=useState(void 0);return useEffect(()=>{let o=window.matchMedia(`(max-width: ${Ie-1}px)`),r=()=>{t(window.innerWidth<Ie);};return o.addEventListener("change",r),t(window.innerWidth<Ie),()=>o.removeEventListener("change",r)},[]),!!e}function l(...e){return twMerge(clsx(e))}var yo=cva("inline-flex gap-2 items-center justify-center 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 hover:bg-primary/90",destructive:"bg-destructive text-white 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 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","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function v({className:e,variant:t,size:o,asChild:r=false,...n}){return jsx(r?Slot:"button",{"data-slot":"button",className:l(yo({variant:t,size:o,className:e})),...n})}function rt({className:e,orientation:t="horizontal",decorative:o=true,...r}){return jsx(ot.Root,{"data-slot":"separator",decorative:o,orientation:t,className:l("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),...r})}function nt({...e}){return jsx(T.Root,{"data-slot":"sheet",...e})}function Bo({...e}){return jsx(T.Portal,{"data-slot":"sheet-portal",...e})}function No({className:e,...t}){return jsx(T.Overlay,{"data-slot":"sheet-overlay",className:l("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 at({className:e,children:t,side:o="right",...r}){return jsxs(Bo,{children:[jsx(No,{}),jsxs(T.Content,{"data-slot":"sheet-content",className:l("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",o==="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",o==="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",o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",o==="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),...r,children:[t,jsxs(T.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:[jsx(XIcon,{className:"size-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function it({className:e,...t}){return jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",e),...t})}function st({className:e,...t}){return jsx(T.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",e),...t})}function dt({className:e,...t}){return jsx(T.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",e),...t})}function Le({delayDuration:e=0,...t}){return jsx(k.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ce({...e}){return jsx(Le,{children:jsx(k.Root,{"data-slot":"tooltip",...e})})}function lt({...e}){return jsx(k.Trigger,{"data-slot":"tooltip-trigger",...e})}function ut({className:e,sideOffset:t=0,children:o,...r}){return jsx(k.Portal,{children:jsxs(k.Content,{"data-slot":"tooltip-content",sideOffset:t,className:l("bg-foreground text-background 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),...r,children:[o,jsx(k.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var ko="sidebar_state",Lo=3600*24*7,Eo="16rem",zo="18rem",Oo="3rem",Ao="b",ct=N.createContext(null);function _(){let e=N.useContext(ct);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function pt({defaultOpen:e=true,open:t,onOpenChange:o,className:r,style:n,children:a,...i}){let s=tt(),[u,d]=N.useState(false),[c,p]=N.useState(e),f=t??c,m=N.useCallback(C=>{let x=typeof C=="function"?C(f):C;o?o(x):p(x),document.cookie=`${ko}=${x}; path=/; max-age=${Lo}`;},[o,f]),b=N.useCallback(()=>s?d(C=>!C):m(C=>!C),[s,m,d]);N.useEffect(()=>{let C=x=>{x.key===Ao&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),b());};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);let g=f?"expanded":"collapsed",h=N.useMemo(()=>({state:g,open:f,setOpen:m,isMobile:s,openMobile:u,setOpenMobile:d,toggleSidebar:b}),[g,f,m,s,u,d,b]);return jsx(ct.Provider,{value:h,children:jsx(Le,{delayDuration:0,children:jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Eo,"--sidebar-width-icon":Oo,...n},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...i,children:a})})})}function mt({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:r,children:n,...a}){let{isMobile:i,state:s,openMobile:u,setOpenMobile:d}=_();return o==="none"?jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...a,children:n}):i?jsx(nt,{open:u,onOpenChange:d,...a,children:jsxs(at,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":zo},side:e,children:[jsxs(it,{className:"sr-only",children:[jsx(st,{children:"Sidebar"}),jsx(dt,{children:"Displays the mobile sidebar."})]}),jsx("div",{className:"flex h-full w-full flex-col",children:n})]})}):jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":s,"data-collapsible":s==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n})})]})}function ft({className:e,onClick:t,...o}){let{toggleSidebar:r}=_();return jsxs(v,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",e),onClick:n=>{t?.(n),r();},...o,children:[jsx(PanelLeftIcon,{}),jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function bt({className:e,...t}){return jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function vt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",e),...t})}function gt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",e),...t})}function ht({className:e,...t}){return jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function xt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Pt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",e),...t})}function Q({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",e),...t})}function K({className:e,...t}){return jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",e),...t})}var _o=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function W({asChild:e=false,isActive:t=false,variant:o="default",size:r="default",tooltip:n,className:a,...i}){let s=e?Slot:"button",{isMobile:u,state:d}=_(),c=jsx(s,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:l(_o({variant:o,size:r}),a),...i});return n?(typeof n=="string"&&(n={children:n}),jsxs(ce,{children:[jsx(lt,{asChild:true,children:c}),jsx(ut,{side:"right",align:"center",hidden:d!=="collapsed"||u,...n})]})):c}function Ct({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}var yt=({sticky:e})=>{let{data:t}=useGetIdentity();return jsx(Fragment,{children:jsx("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[jsx(ft,{className:"-ml-1"}),jsx(rt,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),jsx("h1",{className:"text-base font-medium",children:"Documents"}),jsx("div",{className:"ml-auto flex items-center gap-2",children:jsx(v,{variant:"ghost",asChild:true,size:"sm",className:"hidden sm:flex",children:jsx("a",{href:"https://github.com/shadcn-ui/ui/tree/main/apps/v4/app/(examples)/dashboard",rel:"noopener noreferrer",target:"_blank",className:"dark:text-foreground",children:"GitHub"})})})]})})})};var wt=({collapsed:e,icon:t,text:o})=>{let{title:{icon:r,text:n}={}}=useRefineOptions(),a=typeof t>"u"?r:t,i=typeof o>"u"?n:o,s=useLink(),{state:u,isMobile:d}=_();return jsxs(s,{to:"/",className:"flex items-center justify-center gap-2 text-inherit no-underline hover:no-underline",children:[jsx("div",{className:"size-6 [&>img]:size-6 [&>svg]:size-6",children:a}),(d||!e&&u==="expanded")&&jsx("h6",{className:"text-base font-semibold",children:i})]})};function St(e,t,{checkForDefaultPrevented:o=true}={}){return function(n){if(e?.(n),o===false||!n.defaultPrevented)return t?.(n)}}function Bt(e,t=[]){let o=[];function r(a,i){let s=N.createContext(i),u=o.length;o=[...o,i];let d=p=>{let{scope:f,children:m,...b}=p,g=f?.[e]?.[u]||s,h=N.useMemo(()=>b,Object.values(b));return jsx(g.Provider,{value:h,children:m})};d.displayName=a+"Provider";function c(p,f){let m=f?.[e]?.[u]||s,b=N.useContext(m);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return [d,c]}let n=()=>{let a=o.map(i=>N.createContext(i));return function(s){let u=s?.[e]||a;return N.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return n.scopeName=e,[r,Wo(n,...t)]}function Wo(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let i=r.reduce((s,{useScope:u,scopeName:d})=>{let p=u(a)[`__scope${d}`];return {...s,...p}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return o.scopeName=t.scopeName,o}var F=globalThis?.document?N.useLayoutEffect:()=>{};var qo=N[" useInsertionEffect ".trim().toString()]||F;function Tt({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[n,a,i]=Yo({defaultProp:t,onChange:o}),s=e!==void 0,u=s?e:n;{let c=N.useRef(e!==void 0);N.useEffect(()=>{let p=c.current;p!==s&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s;},[s,r]);}let d=N.useCallback(c=>{if(s){let p=Xo(c)?c(e):c;p!==e&&i.current?.(p);}else a(c);},[s,e,a,i]);return [u,d]}function Yo({defaultProp:e,onChange:t}){let[o,r]=N.useState(e),n=N.useRef(o),a=N.useRef(t);return qo(()=>{a.current=t;},[t]),N.useEffect(()=>{n.current!==o&&(a.current?.(o),n.current=o);},[o,n]),[o,r,a]}function Xo(e){return typeof e=="function"}function Mt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function Qo(...e){return t=>{let o=false,r=e.map(n=>{let a=Mt(n,t);return !o&&typeof a=="function"&&(o=true),a});if(o)return ()=>{for(let n=0;n<r.length;n++){let a=r[n];typeof a=="function"?a():Mt(e[n],null);}}}}function me(...e){return N.useCallback(Qo(...e),e)}var er=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fe=er.reduce((e,t)=>{let o=createSlot(`Primitive.${t}`),r=N.forwardRef((n,a)=>{let{asChild:i,...s}=n,u=i?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=true),jsx(u,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tr(e,t){return N.useReducer((o,r)=>t[o][r]??o,e)}var Ee=e=>{let{present:t,children:o}=e,r=or(t),n=typeof o=="function"?o({present:r.isPresent}):N.Children.only(o),a=me(r.ref,rr(n));return typeof o=="function"||r.isPresent?N.cloneElement(n,{ref:a}):null};Ee.displayName="Presence";function or(e){let[t,o]=N.useState(),r=N.useRef(null),n=N.useRef(e),a=N.useRef("none"),i=e?"mounted":"unmounted",[s,u]=tr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{let d=be(r.current);a.current=s==="mounted"?d:"none";},[s]),F(()=>{let d=r.current,c=n.current;if(c!==e){let f=a.current,m=be(d);e?u("MOUNT"):m==="none"||d?.display==="none"?u("UNMOUNT"):u(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),n.current=e;}},[e,u]),F(()=>{if(t){let d,c=t.ownerDocument.defaultView??window,p=m=>{let g=be(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(u("ANIMATION_END"),!n.current)){let h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h);});}},f=m=>{m.target===t&&(a.current=be(r.current));};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{c.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p);}}else u("ANIMATION_END");},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:N.useCallback(d=>{r.current=d?getComputedStyle(d):null,o(d);},[])}}function be(e){return e?.animationName||"none"}function rr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var nr=N[" useId ".trim().toString()]||(()=>{}),ar=0;function Lt(e){let[t,o]=N.useState(nr());return F(()=>{o(r=>r??String(ar++));},[e]),e||(t?`radix-${t}`:"")}var ve="Collapsible",[ir]=Bt(ve),[sr,Oe]=ir(ve),Et=N.forwardRef((e,t)=>{let{__scopeCollapsible:o,open:r,defaultOpen:n,disabled:a,onOpenChange:i,...s}=e,[u,d]=Tt({prop:r,defaultProp:n??false,onChange:i,caller:ve});return jsx(sr,{scope:o,disabled:a,contentId:Lt(),open:u,onOpenToggle:N.useCallback(()=>d(c=>!c),[d]),children:jsx(fe.div,{"data-state":Fe(u),"data-disabled":a?"":void 0,...s,ref:t})})});Et.displayName=ve;var zt="CollapsibleTrigger",Ae=N.forwardRef((e,t)=>{let{__scopeCollapsible:o,...r}=e,n=Oe(zt,o);return jsx(fe.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||false,"data-state":Fe(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:t,onClick:St(e.onClick,n.onOpenToggle)})});Ae.displayName=zt;var _e="CollapsibleContent",He=N.forwardRef((e,t)=>{let{forceMount:o,...r}=e,n=Oe(_e,e.__scopeCollapsible);return jsx(Ee,{present:o||n.open,children:({present:a})=>jsx(dr,{...r,ref:t,present:a})})});He.displayName=_e;var dr=N.forwardRef((e,t)=>{let{__scopeCollapsible:o,present:r,children:n,...a}=e,i=Oe(_e,o),[s,u]=N.useState(r),d=N.useRef(null),c=me(t,d),p=N.useRef(0),f=p.current,m=N.useRef(0),b=m.current,g=i.open||s,h=N.useRef(g),C=N.useRef(void 0);return N.useEffect(()=>{let x=requestAnimationFrame(()=>h.current=false);return ()=>cancelAnimationFrame(x)},[]),F(()=>{let x=d.current;if(x){C.current=C.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";let O=x.getBoundingClientRect();p.current=O.height,m.current=O.width,h.current||(x.style.transitionDuration=C.current.transitionDuration,x.style.animationName=C.current.animationName),u(r);}},[i.open,r]),jsx(fe.div,{"data-state":Fe(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...a,ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:g&&n})});function Fe(e){return e?"open":"closed"}var Ot=Et;function At({...e}){return jsx(Ot,{"data-slot":"collapsible",...e})}function _t({...e}){return jsx(Ae,{"data-slot":"collapsible-trigger",...e})}function Ht({className:e,children:t,...o}){return jsx(He,{"data-slot":"collapsible-content",className:l("data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden transition-all",e),...o,children:t})}function Ut({item:e,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:n=false}){let{label:a,route:i,name:s,icon:u,children:d}=e,c=e.key===t,p=d&&d.length>0,f=o.includes(e.key||""),[m,b]=useState(f);return p?jsx(CanAccess,{resource:s,action:"list",params:{resource:e},children:jsx(At,{open:m,onOpenChange:b,className:"group/collapsible",children:jsxs(K,{children:[jsx(_t,{asChild:true,children:jsxs(W,{tooltip:a,isActive:c,children:[u??jsx(ListIcon,{className:"h-4 w-4"}),jsx("span",{children:a}),jsx(ChevronRight,{className:l("ml-auto h-4 w-4 transition-transform duration-200",m&&"rotate-90")})]})}),jsx(Ht,{children:jsx(Ct,{children:d.map(g=>jsx(Ut,{item:g,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:n},g.key))})})]})})},e.key):jsx(CanAccess,{resource:s,action:"list",params:{resource:e},children:jsx(K,{children:jsx(W,{asChild:!c||!n,tooltip:a,isActive:c,disabled:c&&n,children:jsxs(r,{to:i,children:[u??jsx(ListIcon,{className:"h-4 w-4"}),jsx("span",{children:a})]})})})},e.key)}function Vt({meta:e,activeItemDisabled:t=false}){let o=useLink(),{menuItems:r,selectedKey:n,defaultOpenKeys:a}=useMenu({meta:e});return jsx(xt,{children:jsxs(Pt,{className:"flex flex-col gap-2",children:[jsx(Q,{children:jsxs(K,{className:"flex items-center gap-2",children:[jsxs(W,{tooltip:"Quick Create",className:"bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground active:bg-primary/90 active:text-primary-foreground min-w-8 duration-200 ease-linear",children:[jsx(CirclePlus,{}),jsx("span",{children:"Quick Create"})]}),jsxs(v,{size:"icon",className:"size-8 group-data-[collapsible=icon]:opacity-0",variant:"outline",children:[jsx(Mail,{}),jsx("span",{className:"sr-only",children:"Inbox"})]})]})}),jsx(Q,{children:r.map(i=>jsx(Ut,{item:i,selectedKey:n,defaultOpenKeys:a,Link:o,activeItemDisabled:t},i.key))})]})})}function Ue({className:e,...t}){return jsx(re.Root,{"data-slot":"avatar",className:l("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Ve({className:e,...t}){return jsx(re.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",e),...t})}function Ge({className:e,...t}){return jsx(re.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Gt({...e}){return jsx(y.Root,{"data-slot":"dropdown-menu",...e})}function Kt({...e}){return jsx(y.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Wt({className:e,sideOffset:t=4,...o}){return jsx(y.Portal,{children:jsx(y.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:l("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) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...o})})}function qt({...e}){return jsx(y.Group,{"data-slot":"dropdown-menu-group",...e})}function de({className:e,inset:t,variant:o="default",...r}){return jsx(y.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:l("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 cursor-default 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),...r})}function Yt({className:e,inset:t,...o}){return jsx(y.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function We({className:e,...t}){return jsx(y.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function Xt({user:e}){let{isMobile:t}=_();return jsx(Q,{children:jsx(K,{children:jsxs(Gt,{children:[jsx(Kt,{asChild:true,children:jsxs(W,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[jsxs(Ue,{className:"h-8 w-8 rounded-lg grayscale",children:[jsx(Ve,{src:e.avatar,alt:e.name}),jsx(Ge,{className:"rounded-lg",children:"CN"})]}),jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsx("span",{className:"truncate font-medium",children:e.name}),jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]}),jsx(Dot,{className:"ml-auto size-4"})]})}),jsxs(Wt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",align:"end",sideOffset:4,children:[jsx(Yt,{className:"p-0 font-normal",children:jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[jsxs(Ue,{className:"h-8 w-8 rounded-lg",children:[jsx(Ve,{src:e.avatar,alt:e.name}),jsx(Ge,{className:"rounded-lg",children:"CN"})]}),jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsx("span",{className:"truncate font-medium",children:e.name}),jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}),jsx(We,{}),jsxs(qt,{children:[jsxs(de,{children:[jsx(UserCircle,{}),"Account"]}),jsxs(de,{children:[jsx(CreditCard,{}),"Billing"]}),jsxs(de,{children:[jsx(Bell,{}),"Notifications"]})]}),jsx(We,{}),jsxs(de,{children:[jsx(LogOut,{}),"Log out"]})]})]})})})}var Cr={user:{name:"shadcn",email:"m@example.com",avatar:"/avatars/shadcn.jpg"}};function Qt({Title:e,render:t,meta:o,activeItemDisabled:r=false,siderItemsAreCollapsed:n=true,...a}){let i=e??wt,{state:s}=_();return jsxs(mt,{collapsible:"icon",...a,children:[jsx(vt,{children:jsx(Q,{children:jsx(K,{children:jsx(W,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:jsx(i,{collapsed:s==="collapsed"})})})})}),jsx(ht,{children:jsx(Vt,{meta:o,activeItemDisabled:r})}),jsx(gt,{children:jsx(Xt,{user:Cr.user})})]})}function Jt({children:e,...t}){return jsx(ThemeProvider,{...t,children:e})}var qe=({children:e,...t})=>jsx(Jt,{attribute:"data-theme",defaultTheme:"system",enableSystem:true,disableTransitionOnChange:true,...t,children:e});var ls=({Sider:e,Header:t,Title:o,Footer:r,OffLayoutArea:n,children:a,initialSiderCollapsed:i,onSiderCollapsed:s})=>jsx(qe,{children:jsxs(pt,{defaultOpen:i!==void 0?!i:true,onOpenChange:s?c=>s(!c):void 0,style:{"--sidebar-width":"calc(var(--spacing) * 72)","--header-height":"calc(var(--spacing) * 12)"},children:[jsx(e??Qt,{Title:o}),jsxs(bt,{children:[jsx(t??yt,{}),jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:a})]})]})});var w={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"},ne={Title:"refine-pageHeader-title"},S={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"};var gs=e=>{let{canCreate:t,children:o,createButtonProps:r,resource:n,wrapperProps:a,contentProps:i,headerProps:s,headerButtonProps:u,headerButtons:d,breadcrumb:c,title:p}=e,f=useTranslate(),{options:{breadcrumb:m}={}}=useRefineContext(),b=useUserFriendlyName(),{resource:g,identifier:h}=useResourceParams({resource:n}),C=t??(!!g?.create||r),x=typeof c>"u"?m:c,O=C?{resource:h,...r}:void 0,X=C?jsx(Xe,{...O}):null,j=d?typeof d=="function"?d({defaultButtons:X,createButtonProps:O}):d:X,ee=()=>p===false?null:p?typeof p=="string"||typeof p=="number"?jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:p}):p:jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:f(`${h}.titles.list`,b(g?.meta?.label??h,"plural"))});return jsxs("div",{className:l("bg-background rounded-md px-4 py-3"),...a,children:[jsxs("div",{className:l("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...s,children:[jsxs("div",{className:"min-w-[200px]",children:[typeof x<"u"?jsx(Fragment,{children:x}):jsx(he,{}),ee()]}),jsx("div",{className:l("flex flex-wrap justify-start gap-2 md:justify-end"),...u,children:j})]}),jsx("div",{...i,children:o})]})};var Bs=e=>{let{children:t,saveButtonProps:o,isLoading:r,resource:n,footerButtons:a,footerButtonProps:i,headerButtons:s,headerButtonProps:u,wrapperProps:d,contentProps:c,headerProps:p,goBack:f,breadcrumb:m,title:b}=e,g=useTranslate(),{options:{breadcrumb:h}={}}=useRefineContext(),C=useBack(),x=useUserFriendlyName(),{resource:O,action:X,identifier:j}=useResourceParams(),ee=typeof m>"u"?h:m,Ne={...r?{disabled:true}:{},...o},ue=jsx(Qe,{...Ne}),Te=f===null?null:jsx(v,{variant:"ghost",size:"sm",onClick:X!=="list"||typeof X<"u"?C:void 0,children:typeof f<"u"?f:jsx(ArrowLeft,{className:"h-4 w-4"})}),Me=s?typeof s=="function"?s({defaultButtons:null}):s:null,De=a?typeof a=="function"?a({defaultButtons:ue,saveButtonProps:Ne}):a:ue,et=()=>b===false?null:b?typeof b=="string"||typeof b=="number"?jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:b}):b:jsx("h3",{className:l("text-2xl font-semibold",ne.Title),children:g(`${j}.titles.create`,`Create ${x(O?.meta?.label??j,"singular")}`)});return jsxs("div",{className:l("bg-background relative rounded-md px-4 py-3"),...d,children:[r&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:jsx(Loader2,{className:"h-6 w-6 animate-spin"})}),jsxs("div",{className:l("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...p,children:[jsxs("div",{className:"min-w-[200px]",children:[typeof ee<"u"?jsx(Fragment,{children:ee}):jsx(he,{}),jsxs("div",{className:"flex items-center gap-2",children:[Te,et()]})]}),jsx("div",{className:l("flex flex-wrap justify-start gap-2 md:justify-end"),...u,children:Me})]}),jsx("div",{className:l(r&&"opacity-50"),...c,children:t}),jsx("div",{className:l("mt-8 flex justify-end gap-2"),...i,children:De})]})};var Xe=({resource:e,hideText:t=false,accessControl:o,meta:r,children:n,onClick:a,...i})=>{let{hidden:s,disabled:u,label:d,title:c,LinkComponent:p,to:f}=useCreateButton({resource:e,meta:r,accessControl:o}),m=u||i.disabled;return s||i.hidden?null:jsx(p,{to:f,replace:false,onClick:g=>{if(m){g.preventDefault();return}a&&(g.preventDefault(),a(g));},children:jsxs(v,{disabled:m,title:c,"data-testid":w.CreateButton,className:S.CreateButton,...i,children:[jsx(PlusSquare,{})," ",!t&&(n??d)]})})};var Gr=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=useEditButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxs(v,{disabled:b,title:p,"data-testid":w.EditButton,className:S.EditButton,...s,children:[jsx(FolderDown,{})," ",!o&&(a??c)]})})};function to({...e}){return jsx(U.Root,{"data-slot":"popover",...e})}function oo({...e}){return jsx(U.Trigger,{"data-slot":"popover-trigger",...e})}function ro({className:e,align:t="center",sideOffset:o=4,...r}){return jsx(U.Portal,{children:jsx(U.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:l("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),...r})})}var Xr=({resource:e,recordItemId:t,onSuccess:o,mutationMode:r,children:n,successNotification:a,errorNotification:i,hideText:s=false,accessControl:u,meta:d,invalidates:c,dataProviderName:p,confirmTitle:f,confirmOkText:m,confirmCancelText:b,...g})=>{let[h,C]=useState(false),{onConfirm:x,label:O,title:X,disabled:j,hidden:ee,loading:Ne,confirmTitle:ue,confirmOkLabel:Te,cancelLabel:Me}=useDeleteButton({resource:e,id:t,onSuccess:o,mutationMode:r,successNotification:a,errorNotification:i,accessControl:u,meta:d,dataProviderName:p,invalidates:c}),De=j||g.disabled;return ee||g.hidden?null:jsxs(to,{open:h,onOpenChange:C,children:[jsx(oo,{asChild:true,children:jsxs(v,{disabled:De,title:X,"data-testid":w.DeleteButton,className:S.DeleteButton,...g,children:[jsx(Trash,{})," ",!s&&(n??O)]})}),jsxs(ro,{children:[f??ue,jsxs("div",{className:"gap-x-2",children:[jsx(v,{onClick:()=>C(false),children:b??Me}),jsx(v,{onClick:()=>{x(),C(false);},children:m??Te})]})]})]})};var Zr=({resource:e,recordItemId:t,hideText:o=false,dataProviderName:r,children:n,...a})=>{let{onClick:i,label:s,loading:u}=useRefreshButton({resource:e,id:t,dataProviderName:r}),d=u||a.disabled;return jsxs(v,{onClick:i,disabled:d,"data-testid":w.RefreshButton,className:S.RefreshButton,...a,children:[jsx(RefreshCcw,{})," ",!o&&(n??s)]})};var rn=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=useShowButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxs(v,{disabled:b,title:p,"data-testid":w.ShowButton,className:S.ShowButton,...s,children:[jsx(Eye,{})," ",!o&&(a??c)]})})};var dn=({resource:e,hideText:t=false,accessControl:o,meta:r,children:n,onClick:a,...i})=>{let{hidden:s,disabled:u,label:d,title:c,LinkComponent:p,to:f}=useListButton({resource:e,meta:r,accessControl:o}),m=u||i.disabled;return s||i.hidden?null:jsx(p,{to:f,replace:false,onClick:g=>{if(m){g.preventDefault();return}a&&(g.preventDefault(),a(g));},children:jsxs(v,{disabled:m,title:c,"data-testid":w.ListButton,className:S.ListButton,...i,children:[jsx(List,{})," ",!t&&(n??d)]})})};var pn=({hideText:e=false,loading:t=false,children:o,...r})=>{let{label:n}=useExportButton(),a=t||r.disabled;return jsxs(v,{disabled:a,"data-testid":w.ExportButton,className:S.ExportButton,...r,children:[jsx(FolderUp,{})," ",!e&&(o??n)]})};var Qe=({hideText:e=false,children:t,...o})=>{let{label:r}=useSaveButton();return jsxs(v,{"data-testid":w.SaveButton,className:S.SaveButton,...o,children:[jsx(Save,{})," ",!e&&(t??r)]})};var Cn=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:n,children:a,onClick:i,...s})=>{let{hidden:u,disabled:d,label:c,title:p,LinkComponent:f,to:m}=useCloneButton({resource:e,id:t,meta:n,accessControl:r}),b=d||s.disabled;return u||s.hidden?null:jsx(f,{to:m,replace:false,onClick:h=>{if(b){h.preventDefault();return}i&&(h.preventDefault(),i(h));},children:jsxs(v,{disabled:b,title:p,"data-testid":w.CloneButton,className:S.CloneButton,...s,children:[jsx(Copy,{})," ",!o&&(a??c)]})})};var Sn=({inputProps:e,hideText:t=false,loading:o=false,children:r,...n})=>{let{label:a}=useImportButton(),i=o||n.disabled;return jsxs(v,{disabled:i,"data-testid":w.ImportButton,className:S.ImportButton,...n,children:[jsx(PlusSquare,{})," ",!t&&(r??a)]})};var Dn=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),V=N.forwardRef(({className:e,size:t,asChild:o,...r},n)=>jsx(o?Slot:"span",{ref:n,className:l(Dn({size:t}),e),...r}));V.displayName="Text";var dl=({value:e,...t})=>jsx(V,{...t,children:e});var ml=({value:e,valueLabelTrue:t="true",valueLabelFalse:o="false",trueIcon:r,falseIcon:n,svgIconProps:a,...i})=>jsx(ce,{...i,children:jsx("span",{children:e?r??jsx(Check,{size:20,...a,className:`icon-check${a?.className?` ${a.className}`:""}`}):n??jsx(Minus,{size:20,...a,className:`icon-minus${a?.className?` ${a.className}`:""}`})})});function zn(){return !!(typeof Intl=="object"&&Intl&&typeof Intl.NumberFormat=="function")}var gl=({value:e,locale:t,options:o,...r})=>{let n=Number(e);return jsx(V,{...r,children:zn()?n.toLocaleString(t,o):n})};var Rl=()=>{let[e,t]=useState(null),[o,r]=useState(false),n=useTranslate(),a=useGo(),{action:i,resource:s}=useResourceParams();return useEffect(()=>{s&&i&&t(n("pages.error.info",{resource:s.name,action:i},`You attempted to perform the "${i}" action on the "${s.name}" resource, but an error occurred.`));},[s,i,n]),jsxs("div",{children:[jsx("h1",{children:"404"}),jsx("p",{children:n("pages.error.404","Sorry, the page you visited does not exist.")}),e&&jsx("p",{children:e}),s&&i&&["create","edit","show"].includes(i)&&jsxs("div",{children:[jsx("span",{"data-testid":"error-component-tooltip",onMouseOver:()=>r(true),onMouseOut:()=>r(false)}),o&&jsx("p",{children:n("pages.error.tipKnownActionMissing",{resource:s.name,action:i},`You may have forgotten to add the "${i}" component to "${s.name}" resource.`)})]}),jsx(v,{onClick:()=>{a({to:"/"});},children:n("pages.error.backHome","Back Home")})]})};function co({...e}){return jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function po({className:e,...t}){return jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Je({className:e,...t}){return jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",e),...t})}function Ze({asChild:e,className:t,...o}){return jsx(e?Slot:"a",{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",t),...o})}function je({children:e,className:t,...o}){return jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...o,children:e??jsx(ChevronRight,{})})}var he=({breadcrumbProps:e,showHome:t=true,hideIcons:o=false,meta:r,minItems:n=2})=>{let{breadcrumbs:a}=useBreadcrumb({meta:r}),i=useLink();if(a.length<n)return null;let{resources:s}=useResourceParams(),u=matchResourceFromRoute("/",s);return jsx(co,{...e,children:jsxs(po,{children:[t&&u?.found&&jsxs(Fragment,{children:[jsx(Je,{children:jsx(i,{to:"/",children:u?.resource?.meta?.icon??jsx(Home,{size:20})})}),a.length>0&&jsx(je,{})]}),a.map(({label:d,icon:c,href:p},f)=>jsxs(Fragment,{children:[jsxs(Je,{children:[!o&&c,p?jsx(Ze,{asChild:true,children:jsx(i,{to:p,children:d})}):jsx(Ze,{children:d})]},d),f<a.length-1&&jsx(je,{})]}))]})})};var bo=({notificationKey:e="",message:t,cancelMutation:o,undoableTimeout:r=0})=>jsxs("div",{className:"bg-background flex min-w-[320px] items-center justify-between gap-2 p-2 shadow-md",children:[jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:"inline-flex h-6 min-w-6 items-center justify-center rounded-md border px-2 text-xs",children:[r,"s"]})}),jsx(V,{children:t}),jsx(v,{"aria-label":"undo",variant:"outline",onClick:()=>{o?.(),e&&toast.dismiss(e);},size:"icon",children:jsx(RotateCcwSquare,{size:18})})]});var ql=({status:e,elements:{success:t=jsx(Be,{translationKey:"autoSave.success",defaultMessage:"saved",icon:jsx(CheckCircle,{size:"18px"})}),error:o=jsx(Be,{translationKey:"autoSave.error",defaultMessage:"auto save failure",icon:jsx(FileExclamationPoint,{size:"18px"})}),loading:r=jsx(Be,{translationKey:"autoSave.loading",defaultMessage:"saving...",icon:jsx(RefreshCcw,{size:"18px"})}),idle:n=jsx(Be,{translationKey:"autoSave.idle",defaultMessage:"waiting for changes",icon:jsx(Dot,{size:"18px"})})}={}})=>jsx(AutoSaveIndicator,{status:e,elements:{success:t,error:o,loading:r,idle:n}}),Be=({translationKey:e,defaultMessage:t,icon:o})=>{let r=useTranslate();return jsxs(V,{color:"gray.700",className:"color-muted mr-2 flex flex-wrap items-center text-sm",children:[r(e,t),jsx("span",{style:{marginLeft:"3px"},children:o})]})};var Zl=()=>({open:({key:e,message:t,type:o,description:r,undoableTimeout:n,cancelMutation:a})=>{if(o==="progress"){toast.custom(()=>jsx(bo,{notificationKey:e,message:t,cancelMutation:a,undoableTimeout:n}),{id:e,duration:1/0});return}let i={};e!==void 0&&(i.id=e),r&&(i.description=r),o==="success"?toast.success(t,i):o==="error"?toast.error(t,i):toast(t,i);},close:e=>toast.dismiss(e)});function nu(e={}){return `Hola, ${e.name??"mundo"}!`}
|
|
2
|
-
export{
|
|
1
|
+
import*as T from'react';import {useState,useEffect}from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {ArrowLeft,Loader2,PlusSquare,FolderDown,Trash,RefreshCcw,Eye,List,FolderUp,Save,Copy,Check,Minus,Home,RotateCcwSquare,CheckCircle,FileExclamationPoint,Dot,ChevronRight,CirclePlus,Mail,UserCircle,CreditCard,Bell,LogOut,PanelLeftIcon,XIcon,ListIcon}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as _e from'@radix-ui/react-separator';import*as N from'@radix-ui/react-dialog';import*as k from'@radix-ui/react-tooltip';import {useRefineOptions,useLink,useTranslate,useRefineContext,useUserFriendlyName,useResourceParams,useBack,useCreateButton,useEditButton,useDeleteButton,useRefreshButton,useShowButton,useListButton,useExportButton,useSaveButton,useCloneButton,useImportButton,useGo,useBreadcrumb,matchResourceFromRoute,AutoSaveIndicator,useGetIdentity,useMenu,CanAccess}from'@refinedev/core';import*as J from'@radix-ui/react-collapsible';import*as Z from'@radix-ui/react-avatar';import*as x from'@radix-ui/react-dropdown-menu';import {ThemeProvider}from'next-themes';import*as O from'@radix-ui/react-popover';import {toast}from'sonner';var Ce=768;function He(){let[e,t]=useState(void 0);return useEffect(()=>{let o=window.matchMedia(`(max-width: ${Ce-1}px)`),r=()=>{t(window.innerWidth<Ce);};return o.addEventListener("change",r),t(window.innerWidth<Ce),()=>o.removeEventListener("change",r)},[]),!!e}function s(...e){return twMerge(clsx(e))}var qt=cva("inline-flex gap-2 items-center justify-center 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 hover:bg-primary/90",destructive:"bg-destructive text-white 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 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","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function u({className:e,variant:t,size:o,asChild:r=false,...a}){return jsx(r?Slot:"button",{"data-slot":"button",className:s(qt({variant:t,size:o,className:e})),...a})}function Fe({className:e,orientation:t="horizontal",decorative:o=true,...r}){return jsx(_e.Root,{"data-slot":"separator",decorative:o,orientation:t,className:s("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),...r})}function Ge({...e}){return jsx(N.Root,{"data-slot":"sheet",...e})}function Xt({...e}){return jsx(N.Portal,{"data-slot":"sheet-portal",...e})}function Jt({className:e,...t}){return jsx(N.Overlay,{"data-slot":"sheet-overlay",className:s("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 Ve({className:e,children:t,side:o="right",...r}){return jsxs(Xt,{children:[jsx(Jt,{}),jsxs(N.Content,{"data-slot":"sheet-content",className:s("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",o==="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",o==="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",o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",o==="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),...r,children:[t,jsxs(N.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:[jsx(XIcon,{className:"size-4"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ke({className:e,...t}){return jsx("div",{"data-slot":"sheet-header",className:s("flex flex-col gap-1.5 p-4",e),...t})}function $e({className:e,...t}){return jsx(N.Title,{"data-slot":"sheet-title",className:s("text-foreground font-semibold",e),...t})}function Ue({className:e,...t}){return jsx(N.Description,{"data-slot":"sheet-description",className:s("text-muted-foreground text-sm",e),...t})}function Be({delayDuration:e=0,...t}){return jsx(k.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function ie({...e}){return jsx(Be,{children:jsx(k.Root,{"data-slot":"tooltip",...e})})}function qe({...e}){return jsx(k.Trigger,{"data-slot":"tooltip-trigger",...e})}function We({className:e,sideOffset:t=0,children:o,...r}){return jsx(k.Portal,{children:jsxs(k.Content,{"data-slot":"tooltip-content",sideOffset:t,className:s("bg-foreground text-background 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),...r,children:[o,jsx(k.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var oo="sidebar_state",ro=3600*24*7,ao="16rem",no="18rem",io="3rem",so="b",Ye=T.createContext(null);function z(){let e=T.useContext(Ye);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Qe({defaultOpen:e=true,open:t,onOpenChange:o,className:r,style:a,children:n,...i}){let d=He(),[p,l]=T.useState(false),[m,f]=T.useState(e),b=t??m,v=T.useCallback(w=>{let R=typeof w=="function"?w(b):w;o?o(R):f(R),document.cookie=`${oo}=${R}; path=/; max-age=${ro}`;},[o,b]),c=T.useCallback(()=>d?l(w=>!w):v(w=>!w),[d,v,l]);T.useEffect(()=>{let w=R=>{R.key===so&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),c());};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[c]);let g=b?"expanded":"collapsed",C=T.useMemo(()=>({state:g,open:b,setOpen:v,isMobile:d,openMobile:p,setOpenMobile:l,toggleSidebar:c}),[g,b,v,d,p,l,c]);return jsx(Ye.Provider,{value:C,children:jsx(Be,{delayDuration:0,children:jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ao,"--sidebar-width-icon":io,...a},className:s("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...i,children:n})})})}function Xe({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:r,children:a,...n}){let{isMobile:i,state:d,openMobile:p,setOpenMobile:l}=z();return o==="none"?jsx("div",{"data-slot":"sidebar",className:s("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...n,children:a}):i?jsx(Ge,{open:p,onOpenChange:l,...n,children:jsxs(Ve,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":no},side:e,children:[jsxs(Ke,{className:"sr-only",children:[jsx($e,{children:"Sidebar"}),jsx(Ue,{children:"Displays the mobile sidebar."})]}),jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[jsx("div",{"data-slot":"sidebar-gap",className:s("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),jsx("div",{"data-slot":"sidebar-container",className:s("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...n,children:jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function Je({className:e,onClick:t,...o}){let{toggleSidebar:r}=z();return jsxs(u,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:s("size-7",e),onClick:a=>{t?.(a),r();},...o,children:[jsx(PanelLeftIcon,{}),jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ze({className:e,...t}){return jsx("main",{"data-slot":"sidebar-inset",className:s("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function je({className:e,...t}){return jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:s("flex flex-col gap-2 p-2",e),...t})}function et({className:e,...t}){return jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s("flex flex-col gap-2 p-2",e),...t})}function tt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ot({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s("relative flex w-full min-w-0 flex-col p-2",e),...t})}function rt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s("w-full text-sm",e),...t})}function $({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s("flex w-full min-w-0 flex-col gap-1",e),...t})}function _({className:e,...t}){return jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s("group/menu-item relative",e),...t})}var lo=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function F({asChild:e=false,isActive:t=false,variant:o="default",size:r="default",tooltip:a,className:n,...i}){let d=e?Slot:"button",{isMobile:p,state:l}=z(),m=jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:s(lo({variant:o,size:r}),n),...i});return a?(typeof a=="string"&&(a={children:a}),jsxs(ie,{children:[jsx(qe,{asChild:true,children:m}),jsx(We,{side:"right",align:"center",hidden:l!=="collapsed"||p,...a})]})):m}function at({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:s("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}var nt=({sticky:e})=>{let{data:t}=useGetIdentity();return jsx(Fragment,{children:jsx("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[jsx(Je,{className:"-ml-1"}),jsx(Fe,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),jsx("h1",{className:"text-base font-medium",children:"Documents"}),jsx("div",{className:"ml-auto flex items-center gap-2",children:jsx(u,{variant:"ghost",asChild:true,size:"sm",className:"hidden sm:flex",children:jsx("a",{href:"https://github.com/shadcn-ui/ui/tree/main/apps/v4/app/(examples)/dashboard",rel:"noopener noreferrer",target:"_blank",className:"dark:text-foreground",children:"GitHub"})})})]})})})};var st=({collapsed:e,icon:t,text:o})=>{let{title:{icon:r,text:a}={}}=useRefineOptions(),n=typeof t>"u"?r:t,i=typeof o>"u"?a:o,d=useLink(),{state:p,isMobile:l}=z();return jsxs(d,{to:"/",className:"flex items-center justify-center gap-2 text-inherit no-underline hover:no-underline",children:[jsx("div",{className:"size-6 [&>img]:size-6 [&>svg]:size-6",children:n}),(l||!e&&p==="expanded")&&jsx("h6",{className:"text-base font-semibold",children:i})]})};function dt({...e}){return jsx(J.Root,{"data-slot":"collapsible",...e})}function lt({...e}){return jsx(J.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function pt({className:e,children:t,...o}){return jsx(J.CollapsibleContent,{"data-slot":"collapsible-content",className:s("data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden transition-all",e),...o,children:t})}function ct({item:e,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:a=false}){let{label:n,route:i,name:d,icon:p,children:l}=e,m=e.key===t,f=l&&l.length>0,b=o.includes(e.key||""),[v,c]=useState(b);return f?jsx(CanAccess,{resource:d,action:"list",params:{resource:e},children:jsx(dt,{open:v,onOpenChange:c,className:"group/collapsible",children:jsxs(_,{children:[jsx(lt,{asChild:true,children:jsxs(F,{tooltip:n,isActive:m,children:[p??jsx(ListIcon,{className:"h-4 w-4"}),jsx("span",{children:n}),jsx(ChevronRight,{className:s("ml-auto h-4 w-4 transition-transform duration-200",v&&"rotate-90")})]})}),jsx(pt,{children:jsx(at,{children:l.map(g=>jsx(ct,{item:g,selectedKey:t,defaultOpenKeys:o,Link:r,activeItemDisabled:a},g.key))})})]})})},e.key):jsx(CanAccess,{resource:d,action:"list",params:{resource:e},children:jsx(_,{children:jsx(F,{asChild:!m||!a,tooltip:n,isActive:m,disabled:m&&a,children:jsxs(r,{to:i,children:[p??jsx(ListIcon,{className:"h-4 w-4"}),jsx("span",{children:n})]})})})},e.key)}function ft({meta:e,activeItemDisabled:t=false}){let o=useLink(),{menuItems:r,selectedKey:a,defaultOpenKeys:n}=useMenu({meta:e});return jsx(ot,{children:jsxs(rt,{className:"flex flex-col gap-2",children:[jsx($,{children:jsxs(_,{className:"flex items-center gap-2",children:[jsxs(F,{tooltip:"Quick Create",className:"bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground active:bg-primary/90 active:text-primary-foreground min-w-8 duration-200 ease-linear",children:[jsx(CirclePlus,{}),jsx("span",{children:"Quick Create"})]}),jsxs(u,{size:"icon",className:"size-8 group-data-[collapsible=icon]:opacity-0",variant:"outline",children:[jsx(Mail,{}),jsx("span",{className:"sr-only",children:"Inbox"})]})]})}),jsx($,{children:r.map(i=>jsx(ct,{item:i,selectedKey:a,defaultOpenKeys:n,Link:o,activeItemDisabled:t},i.key))})]})})}function Se({className:e,...t}){return jsx(Z.Root,{"data-slot":"avatar",className:s("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Re({className:e,...t}){return jsx(Z.Image,{"data-slot":"avatar-image",className:s("aspect-square size-full",e),...t})}function Ne({className:e,...t}){return jsx(Z.Fallback,{"data-slot":"avatar-fallback",className:s("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function bt({...e}){return jsx(x.Root,{"data-slot":"dropdown-menu",...e})}function vt({...e}){return jsx(x.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function gt({className:e,sideOffset:t=4,...o}){return jsx(x.Portal,{children:jsx(x.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:s("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) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...o})})}function ht({...e}){return jsx(x.Group,{"data-slot":"dropdown-menu-group",...e})}function re({className:e,inset:t,variant:o="default",...r}){return jsx(x.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:s("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 cursor-default 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),...r})}function xt({className:e,inset:t,...o}){return jsx(x.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function Me({className:e,...t}){return jsx(x.Separator,{"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function Pt({user:e}){let{isMobile:t}=z();return jsx($,{children:jsx(_,{children:jsxs(bt,{children:[jsx(vt,{asChild:true,children:jsxs(F,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[jsxs(Se,{className:"h-8 w-8 rounded-lg grayscale",children:[jsx(Re,{src:e.avatar,alt:e.name}),jsx(Ne,{className:"rounded-lg",children:"CN"})]}),jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsx("span",{className:"truncate font-medium",children:e.name}),jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]}),jsx(Dot,{className:"ml-auto size-4"})]})}),jsxs(gt,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",align:"end",sideOffset:4,children:[jsx(xt,{className:"p-0 font-normal",children:jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[jsxs(Se,{className:"h-8 w-8 rounded-lg",children:[jsx(Re,{src:e.avatar,alt:e.name}),jsx(Ne,{className:"rounded-lg",children:"CN"})]}),jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[jsx("span",{className:"truncate font-medium",children:e.name}),jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}),jsx(Me,{}),jsxs(ht,{children:[jsxs(re,{children:[jsx(UserCircle,{}),"Account"]}),jsxs(re,{children:[jsx(CreditCard,{}),"Billing"]}),jsxs(re,{children:[jsx(Bell,{}),"Notifications"]})]}),jsx(Me,{}),jsxs(re,{children:[jsx(LogOut,{}),"Log out"]})]})]})})})}var No={user:{name:"shadcn",email:"m@example.com",avatar:"/avatars/shadcn.jpg"}};function Ct({Title:e,render:t,meta:o,activeItemDisabled:r=false,siderItemsAreCollapsed:a=true,...n}){let i=e??st,{state:d}=z();return jsxs(Xe,{collapsible:"icon",...n,children:[jsx(je,{children:jsx($,{children:jsx(_,{children:jsx(F,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:jsx(i,{collapsed:d==="collapsed"})})})})}),jsx(tt,{children:jsx(ft,{meta:o,activeItemDisabled:r})}),jsx(et,{children:jsx(Pt,{user:No.user})})]})}function yt({children:e,...t}){return jsx(ThemeProvider,{...t,children:e})}var ke=({children:e,...t})=>jsx(yt,{attribute:"data-theme",defaultTheme:"system",enableSystem:true,disableTransitionOnChange:true,...t,children:e});var Kn=({Sider:e,Header:t,Title:o,Footer:r,OffLayoutArea:a,children:n,initialSiderCollapsed:i,onSiderCollapsed:d})=>jsx(ke,{children:jsxs(Qe,{defaultOpen:i!==void 0?!i:true,onOpenChange:d?m=>d(!m):void 0,style:{"--sidebar-width":"calc(var(--spacing) * 72)","--header-height":"calc(var(--spacing) * 12)"},children:[jsx(e??Ct,{Title:o}),jsxs(Ze,{children:[jsx(t??nt,{}),jsx("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:n})]})]})});var y={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"},j={Title:"refine-pageHeader-title"},B={CloneButton:"refine-clone-button",DeleteButton:"refine-delete-button",EditButton:"refine-edit-button",SaveButton:"refine-save-button",CreateButton:"refine-create-button",ImportButton:"refine-import-button",ExportButton:"refine-export-button",ListButton:"refine-list-button",RefreshButton:"refine-refresh-button",ShowButton:"refine-show-button"};var Jn=e=>{let{canCreate:t,children:o,createButtonProps:r,resource:a,wrapperProps:n,contentProps:i,headerProps:d,headerButtonProps:p,headerButtons:l,breadcrumb:m,title:f}=e,b=useTranslate(),{options:{breadcrumb:v}={}}=useRefineContext(),c=useUserFriendlyName(),{resource:g,identifier:C}=useResourceParams({resource:a}),w=t??(!!g?.create||r),R=typeof m>"u"?v:m,W=w?{resource:C,...r}:void 0,K=w?jsx(Ie,{...W}):null,Y=l?typeof l=="function"?l({defaultButtons:K,createButtonProps:W}):l:K,Q=()=>f===false?null:f?typeof f=="string"||typeof f=="number"?jsx("h3",{className:s("text-2xl font-semibold",j.Title),children:f}):f:jsx("h3",{className:s("text-2xl font-semibold",j.Title),children:b(`${C}.titles.list`,c(g?.meta?.label??C,"plural"))});return jsxs("div",{className:s("bg-background rounded-md px-4 py-3"),...n,children:[jsxs("div",{className:s("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...d,children:[jsxs("div",{className:"min-w-[200px]",children:[typeof R<"u"?jsx(Fragment,{children:R}):jsx(de,{}),Q()]}),jsx("div",{className:s("flex flex-wrap justify-start gap-2 md:justify-end"),...p,children:Y})]}),jsx("div",{...i,children:o})]})};var ii=e=>{let{children:t,saveButtonProps:o,isLoading:r,resource:a,footerButtons:n,footerButtonProps:i,headerButtons:d,headerButtonProps:p,wrapperProps:l,contentProps:m,headerProps:f,goBack:b,breadcrumb:v,title:c}=e,g=useTranslate(),{options:{breadcrumb:C}={}}=useRefineContext(),w=useBack(),R=useUserFriendlyName(),{resource:W,action:K,identifier:Y}=useResourceParams(),Q=typeof v>"u"?C:v,ge={...r?{disabled:true}:{},...o},ne=jsx(Le,{...ge}),he=b===null?null:jsx(u,{variant:"ghost",size:"sm",onClick:K!=="list"||typeof K<"u"?w:void 0,children:typeof b<"u"?b:jsx(ArrowLeft,{className:"h-4 w-4"})}),xe=d?typeof d=="function"?d({defaultButtons:null}):d:null,Pe=n?typeof n=="function"?n({defaultButtons:ne,saveButtonProps:ge}):n:ne,Ae=()=>c===false?null:c?typeof c=="string"||typeof c=="number"?jsx("h3",{className:s("text-2xl font-semibold",j.Title),children:c}):c:jsx("h3",{className:s("text-2xl font-semibold",j.Title),children:g(`${Y}.titles.create`,`Create ${R(W?.meta?.label??Y,"singular")}`)});return jsxs("div",{className:s("bg-background relative rounded-md px-4 py-3"),...l,children:[r&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:jsx(Loader2,{className:"h-6 w-6 animate-spin"})}),jsxs("div",{className:s("mb-3 flex flex-wrap items-center justify-between gap-3 md:flex-nowrap"),...f,children:[jsxs("div",{className:"min-w-[200px]",children:[typeof Q<"u"?jsx(Fragment,{children:Q}):jsx(de,{}),jsxs("div",{className:"flex items-center gap-2",children:[he,Ae()]})]}),jsx("div",{className:s("flex flex-wrap justify-start gap-2 md:justify-end"),...p,children:xe})]}),jsx("div",{className:s(r&&"opacity-50"),...m,children:t}),jsx("div",{className:s("mt-8 flex justify-end gap-2"),...i,children:Pe})]})};var Ie=({resource:e,hideText:t=false,accessControl:o,meta:r,children:a,onClick:n,...i})=>{let{hidden:d,disabled:p,label:l,title:m,LinkComponent:f,to:b}=useCreateButton({resource:e,meta:r,accessControl:o}),v=p||i.disabled;return d||i.hidden?null:jsx(f,{to:b,replace:false,onClick:g=>{if(v){g.preventDefault();return}n&&(g.preventDefault(),n(g));},children:jsxs(u,{disabled:v,title:m,"data-testid":y.CreateButton,className:B.CreateButton,...i,children:[jsx(PlusSquare,{})," ",!t&&(a??l)]})})};var Xo=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:a,children:n,onClick:i,...d})=>{let{hidden:p,disabled:l,label:m,title:f,LinkComponent:b,to:v}=useEditButton({resource:e,id:t,meta:a,accessControl:r}),c=l||d.disabled;return p||d.hidden?null:jsx(b,{to:v,replace:false,onClick:C=>{if(c){C.preventDefault();return}i&&(C.preventDefault(),i(C));},children:jsxs(u,{disabled:c,title:f,"data-testid":y.EditButton,className:B.EditButton,...d,children:[jsx(FolderDown,{})," ",!o&&(n??m)]})})};function Rt({...e}){return jsx(O.Root,{"data-slot":"popover",...e})}function Nt({...e}){return jsx(O.Trigger,{"data-slot":"popover-trigger",...e})}function Tt({className:e,align:t="center",sideOffset:o=4,...r}){return jsx(O.Portal,{children:jsx(O.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:s("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),...r})})}var tr=({resource:e,recordItemId:t,onSuccess:o,mutationMode:r,children:a,successNotification:n,errorNotification:i,hideText:d=false,accessControl:p,meta:l,invalidates:m,dataProviderName:f,confirmTitle:b,confirmOkText:v,confirmCancelText:c,...g})=>{let[C,w]=useState(false),{onConfirm:R,label:W,title:K,disabled:Y,hidden:Q,loading:ge,confirmTitle:ne,confirmOkLabel:he,cancelLabel:xe}=useDeleteButton({resource:e,id:t,onSuccess:o,mutationMode:r,successNotification:n,errorNotification:i,accessControl:p,meta:l,dataProviderName:f,invalidates:m}),Pe=Y||g.disabled;return Q||g.hidden?null:jsxs(Rt,{open:C,onOpenChange:w,children:[jsx(Nt,{asChild:true,children:jsxs(u,{disabled:Pe,title:K,"data-testid":y.DeleteButton,className:B.DeleteButton,...g,children:[jsx(Trash,{})," ",!d&&(a??W)]})}),jsxs(Tt,{children:[b??ne,jsxs("div",{className:"gap-x-2",children:[jsx(u,{onClick:()=>w(false),children:c??xe}),jsx(u,{onClick:()=>{R(),w(false);},children:v??he})]})]})]})};var ar=({resource:e,recordItemId:t,hideText:o=false,dataProviderName:r,children:a,...n})=>{let{onClick:i,label:d,loading:p}=useRefreshButton({resource:e,id:t,dataProviderName:r}),l=p||n.disabled;return jsxs(u,{onClick:i,disabled:l,"data-testid":y.RefreshButton,className:B.RefreshButton,...n,children:[jsx(RefreshCcw,{})," ",!o&&(a??d)]})};var lr=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:a,children:n,onClick:i,...d})=>{let{hidden:p,disabled:l,label:m,title:f,LinkComponent:b,to:v}=useShowButton({resource:e,id:t,meta:a,accessControl:r}),c=l||d.disabled;return p||d.hidden?null:jsx(b,{to:v,replace:false,onClick:C=>{if(c){C.preventDefault();return}i&&(C.preventDefault(),i(C));},children:jsxs(u,{disabled:c,title:f,"data-testid":y.ShowButton,className:B.ShowButton,...d,children:[jsx(Eye,{})," ",!o&&(n??m)]})})};var cr=({resource:e,hideText:t=false,accessControl:o,meta:r,children:a,onClick:n,...i})=>{let{hidden:d,disabled:p,label:l,title:m,LinkComponent:f,to:b}=useListButton({resource:e,meta:r,accessControl:o}),v=p||i.disabled;return d||i.hidden?null:jsx(f,{to:b,replace:false,onClick:g=>{if(v){g.preventDefault();return}n&&(g.preventDefault(),n(g));},children:jsxs(u,{disabled:v,title:m,"data-testid":y.ListButton,className:B.ListButton,...i,children:[jsx(List,{})," ",!t&&(a??l)]})})};var gr=({hideText:e=false,loading:t=false,children:o,...r})=>{let{label:a}=useExportButton(),n=t||r.disabled;return jsxs(u,{disabled:n,"data-testid":y.ExportButton,className:B.ExportButton,...r,children:[jsx(FolderUp,{})," ",!e&&(o??a)]})};var Le=({hideText:e=false,children:t,...o})=>{let{label:r}=useSaveButton();return jsxs(u,{"data-testid":y.SaveButton,className:B.SaveButton,...o,children:[jsx(Save,{})," ",!e&&(t??r)]})};var Rr=({resource:e,recordItemId:t,hideText:o=false,accessControl:r,meta:a,children:n,onClick:i,...d})=>{let{hidden:p,disabled:l,label:m,title:f,LinkComponent:b,to:v}=useCloneButton({resource:e,id:t,meta:a,accessControl:r}),c=l||d.disabled;return p||d.hidden?null:jsx(b,{to:v,replace:false,onClick:C=>{if(c){C.preventDefault();return}i&&(C.preventDefault(),i(C));},children:jsxs(u,{disabled:c,title:f,"data-testid":y.CloneButton,className:B.CloneButton,...d,children:[jsx(Copy,{})," ",!o&&(n??m)]})})};var kr=({inputProps:e,hideText:t=false,loading:o=false,children:r,...a})=>{let{label:n}=useImportButton(),i=o||a.disabled;return jsxs(u,{disabled:i,"data-testid":y.ImportButton,className:B.ImportButton,...a,children:[jsx(PlusSquare,{})," ",!t&&(r??n)]})};var Er=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),A=T.forwardRef(({className:e,size:t,asChild:o,...r},a)=>jsx(o?Slot:"span",{ref:a,className:s(Er({size:t}),e),...r}));A.displayName="Text";var Vs=({value:e,...t})=>jsx(A,{...t,children:e});var Ws=({value:e,valueLabelTrue:t="true",valueLabelFalse:o="false",trueIcon:r,falseIcon:a,svgIconProps:n,...i})=>jsx(ie,{...i,children:jsx("span",{children:e?r??jsx(Check,{size:20,...n,className:`icon-check${n?.className?` ${n.className}`:""}`}):a??jsx(Minus,{size:20,...n,className:`icon-minus${n?.className?` ${n.className}`:""}`})})});function Fr(){return !!(typeof Intl=="object"&&Intl&&typeof Intl.NumberFormat=="function")}var Js=({value:e,locale:t,options:o,...r})=>{let a=Number(e);return jsx(A,{...r,children:Fr()?a.toLocaleString(t,o):a})};var rd=()=>{let[e,t]=useState(null),[o,r]=useState(false),a=useTranslate(),n=useGo(),{action:i,resource:d}=useResourceParams();return useEffect(()=>{d&&i&&t(a("pages.error.info",{resource:d.name,action:i},`You attempted to perform the "${i}" action on the "${d.name}" resource, but an error occurred.`));},[d,i,a]),jsxs("div",{children:[jsx("h1",{children:"404"}),jsx("p",{children:a("pages.error.404","Sorry, the page you visited does not exist.")}),e&&jsx("p",{children:e}),d&&i&&["create","edit","show"].includes(i)&&jsxs("div",{children:[jsx("span",{"data-testid":"error-component-tooltip",onMouseOver:()=>r(true),onMouseOut:()=>r(false)}),o&&jsx("p",{children:a("pages.error.tipKnownActionMissing",{resource:d.name,action:i},`You may have forgotten to add the "${i}" component to "${d.name}" resource.`)})]}),jsx(u,{onClick:()=>{n({to:"/"});},children:a("pages.error.backHome","Back Home")})]})};function Et({...e}){return jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Ot({className:e,...t}){return jsx("ol",{"data-slot":"breadcrumb-list",className:s("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function ze({className:e,...t}){return jsx("li",{"data-slot":"breadcrumb-item",className:s("inline-flex items-center gap-1.5",e),...t})}function Ee({asChild:e,className:t,...o}){return jsx(e?Slot:"a",{"data-slot":"breadcrumb-link",className:s("hover:text-foreground transition-colors",t),...o})}function Oe({children:e,className:t,...o}){return jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:s("[&>svg]:size-3.5",t),...o,children:e??jsx(ChevronRight,{})})}var de=({breadcrumbProps:e,showHome:t=true,hideIcons:o=false,meta:r,minItems:a=2})=>{let{breadcrumbs:n}=useBreadcrumb({meta:r}),i=useLink();if(n.length<a)return null;let{resources:d}=useResourceParams(),p=matchResourceFromRoute("/",d);return jsx(Et,{...e,children:jsxs(Ot,{children:[t&&p?.found&&jsxs(Fragment,{children:[jsx(ze,{children:jsx(i,{to:"/",children:p?.resource?.meta?.icon??jsx(Home,{size:20})})}),n.length>0&&jsx(Oe,{})]}),n.map(({label:l,icon:m,href:f},b)=>jsxs(Fragment,{children:[jsxs(ze,{children:[!o&&m,f?jsx(Ee,{asChild:true,children:jsx(i,{to:f,children:l})}):jsx(Ee,{children:l})]},l),b<n.length-1&&jsx(Oe,{})]}))]})})};var _t=({notificationKey:e="",message:t,cancelMutation:o,undoableTimeout:r=0})=>jsxs("div",{className:"bg-background flex min-w-[320px] items-center justify-between gap-2 p-2 shadow-md",children:[jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:"inline-flex h-6 min-w-6 items-center justify-center rounded-md border px-2 text-xs",children:[r,"s"]})}),jsx(A,{children:t}),jsx(u,{"aria-label":"undo",variant:"outline",onClick:()=>{o?.(),e&&toast.dismiss(e);},size:"icon",children:jsx(RotateCcwSquare,{size:18})})]});var Nd=({status:e,elements:{success:t=jsx(ve,{translationKey:"autoSave.success",defaultMessage:"saved",icon:jsx(CheckCircle,{size:"18px"})}),error:o=jsx(ve,{translationKey:"autoSave.error",defaultMessage:"auto save failure",icon:jsx(FileExclamationPoint,{size:"18px"})}),loading:r=jsx(ve,{translationKey:"autoSave.loading",defaultMessage:"saving...",icon:jsx(RefreshCcw,{size:"18px"})}),idle:a=jsx(ve,{translationKey:"autoSave.idle",defaultMessage:"waiting for changes",icon:jsx(Dot,{size:"18px"})})}={}})=>jsx(AutoSaveIndicator,{status:e,elements:{success:t,error:o,loading:r,idle:a}}),ve=({translationKey:e,defaultMessage:t,icon:o})=>{let r=useTranslate();return jsxs(A,{color:"gray.700",className:"color-muted mr-2 flex flex-wrap items-center text-sm",children:[r(e,t),jsx("span",{style:{marginLeft:"3px"},children:o})]})};var Id=()=>({open:({key:e,message:t,type:o,description:r,undoableTimeout:a,cancelMutation:n})=>{if(o==="progress"){toast.custom(()=>jsx(_t,{notificationKey:e,message:t,cancelMutation:n,undoableTimeout:a}),{id:e,duration:1/0});return}let i={};e!==void 0&&(i.id=e),r&&(i.description=r),o==="success"?toast.success(t,i):o==="error"?toast.error(t,i):toast(t,i);},close:e=>toast.dismiss(e)});function Hd(e={}){return `Hola, ${e.name??"mundo"}!`}
|
|
2
|
+
export{Nd as AutoSaveIndicator,Ws as BooleanField,de as Breadcrumb,Rr as CloneButton,ii as Create,Ie as CreateButton,tr as DeleteButton,Xo as EditButton,rd as ErrorComponent,gr as ExportButton,kr as ImportButton,Jn as List,cr as ListButton,Js as NumberField,ar as RefreshButton,Le as SaveButton,lr as ShowButton,Vs as TextField,Kn as ThemedLayout,ke as ThemedLayoutContextProvider,st as ThemedTitle,_t as UndoableNotification,Hd as greet,Id as useNotificationProvider};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|