@brunolucas22/ui 0.1.2 → 0.1.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/App.d.ts +2 -0
- package/dist/components/ModeTogle.d.ts +1 -0
- package/dist/components/ThemeProvider.d.ts +13 -0
- package/dist/components/ui/accordion.d.ts +6 -0
- package/dist/components/ui/breadcrumb.d.ts +10 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sidebar.d.ts +63 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/tooltip.d.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/lib/main.d.ts +1 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/main.d.ts +0 -0
- package/package.json +8 -7
- package/dist/index.d.mts +0 -1
- package/dist/index.js +0 -4
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ModeToggle(): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Theme = "dark" | "light" | "system";
|
|
2
|
+
type ThemeProviderProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
defaultTheme?: Theme;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
};
|
|
7
|
+
type ThemeProviderState = {
|
|
8
|
+
theme: Theme;
|
|
9
|
+
setTheme: (theme: Theme) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react").JSX.Element;
|
|
12
|
+
export declare const useTheme: () => ThemeProviderState;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from '@base-ui/react/accordion';
|
|
2
|
+
declare function Accordion({ className, ...props }: AccordionPrimitive.Root.Props): import("react").JSX.Element;
|
|
3
|
+
declare function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props): import("react").JSX.Element;
|
|
4
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function AccordionContent({ className, children, ...props }: AccordionPrimitive.Panel.Props): import("react").JSX.Element;
|
|
6
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
6
|
+
declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
7
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: "default" | "destructive";
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
|
|
25
|
+
inset?: boolean;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Popover({ ...props }: PopoverPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, alignOffset, side, sideOffset, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
6
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props): React.JSX.Element;
|
|
8
|
+
declare function PopoverDescription({ className, ...props }: PopoverPrimitive.Description.Props): React.JSX.Element;
|
|
9
|
+
export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Sheet({ ...props }: SheetPrimitive.Root.Props): React.JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props): React.JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: SheetPrimitive.Close.Props): React.JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, showCloseButton, ...props }: SheetPrimitive.Popup.Props & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
showCloseButton?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props): React.JSX.Element;
|
|
13
|
+
declare function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): React.JSX.Element;
|
|
14
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
import { Input } from './input';
|
|
5
|
+
import { Separator } from './separator';
|
|
6
|
+
import { TooltipContent } from './tooltip';
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
type SidebarContextProps = {
|
|
9
|
+
state: "expanded" | "collapsed";
|
|
10
|
+
open: boolean;
|
|
11
|
+
setOpen: (open: boolean) => void;
|
|
12
|
+
openMobile: boolean;
|
|
13
|
+
setOpenMobile: (open: boolean) => void;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
toggleSidebar: () => void;
|
|
16
|
+
};
|
|
17
|
+
declare function useSidebar(): SidebarContextProps;
|
|
18
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
open?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function Sidebar({ side, variant, collapsible, className, children, dir, ...props }: React.ComponentProps<"div"> & {
|
|
24
|
+
side?: "left" | "right";
|
|
25
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
26
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
29
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
30
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
|
|
31
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
32
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
33
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
34
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
35
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
36
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
37
|
+
declare function SidebarGroupLabel({ className, render, ...props }: useRender.ComponentProps<"div"> & React.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
38
|
+
declare function SidebarGroupAction({ className, render, ...props }: useRender.ComponentProps<"button"> & React.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
39
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
40
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
41
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
42
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
43
|
+
variant?: "default" | "outline" | null | undefined;
|
|
44
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
45
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
46
|
+
declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
|
|
47
|
+
isActive?: boolean;
|
|
48
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
49
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
|
|
50
|
+
declare function SidebarMenuAction({ className, render, showOnHover, ...props }: useRender.ComponentProps<"button"> & React.ComponentProps<"button"> & {
|
|
51
|
+
showOnHover?: boolean;
|
|
52
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
53
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
54
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
55
|
+
showIcon?: boolean;
|
|
56
|
+
}): React.JSX.Element;
|
|
57
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
58
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
59
|
+
declare function SidebarMenuSubButton({ render, size, isActive, className, ...props }: useRender.ComponentProps<"a"> & React.ComponentProps<"a"> & {
|
|
60
|
+
size?: "sm" | "md";
|
|
61
|
+
isActive?: boolean;
|
|
62
|
+
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
63
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
2
|
+
declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
|
|
3
|
+
declare function Tooltip({ ...props }: TooltipPrimitive.Root.Props): import("react").JSX.Element;
|
|
4
|
+
declare function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
|
|
6
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './components/ui/accordion';
|
|
2
|
+
export * from './components/ui/breadcrumb';
|
|
3
|
+
export * from './components/ui/button';
|
|
4
|
+
export * from './components/ui/card';
|
|
5
|
+
export * from './components/ui/dropdown-menu';
|
|
6
|
+
export * from './components/ui/input';
|
|
7
|
+
export * from './components/ui/popover';
|
|
8
|
+
export * from './components/ui/separator';
|
|
9
|
+
export * from './components/ui/sheet';
|
|
10
|
+
export * from './components/ui/sidebar';
|
|
11
|
+
export * from './components/ui/skeleton';
|
|
12
|
+
export * from './components/ui/tooltip';
|
|
13
|
+
export * from './components/ModeTogle';
|
|
14
|
+
export * from './components/ThemeProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cn } from 'cn';
|
package/dist/main.d.ts
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brunolucas22/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Pacote de Componentes da COTIC - CGE",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"main": "./dist/
|
|
14
|
+
"main": "./dist/index.mjs",
|
|
15
|
+
"module": "./dist/index.mjs",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
15
17
|
"files": [
|
|
16
18
|
"dist"
|
|
17
19
|
],
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
"build": "tsc -b && vite build",
|
|
21
23
|
"lint": "eslint .",
|
|
22
24
|
"preview": "vite preview",
|
|
23
|
-
"
|
|
25
|
+
"deploy": "tsc -b && vite build && npm version patch && npm publish --access public"
|
|
24
26
|
},
|
|
25
27
|
"dependencies": {
|
|
26
28
|
"@base-ui/react": "^1.8.0",
|
|
@@ -53,6 +55,5 @@
|
|
|
53
55
|
"peerDependencies": {
|
|
54
56
|
"react": "^19.0.0",
|
|
55
57
|
"react-dom": "^19.0.0"
|
|
56
|
-
}
|
|
57
|
-
"module": "./dist/cotic-ui.js"
|
|
58
|
+
}
|
|
58
59
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/dist/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));let l=require("react"),u=c(l,1);l=c(l);let d=require("react/jsx-runtime"),f=require("react-dom");f=c(f,1);var p;process.env.NODE_ENV!==`production`&&(p=new Set);function m(e,t){return function(...n){if(process.env.NODE_ENV!==`production`){let r=n.join(` `),i=t?`${t}: ${r}`:r,a=`${e}:${i}`;p.has(a)||(p.add(a),e===`warn`?console.warn(i):console.error(i))}}}var h=m(`error`,`Base UI`);function g({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=u.useRef(e!==void 0),[a,o]=u.useState(t),s=i&&e!==void 0?e:a;if(process.env.NODE_ENV!==`production`){u.useEffect(()=>{i!==(e!==void 0)&&h([`A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
|
|
2
|
-
`))},[r,n,e]);let{current:a}=u.useRef(t);u.useEffect(()=>{!i&&_(a)!==_(t)&&h([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
3
|
-
`))},[t])}return[s,u.useCallback(e=>{i||o(e)},[])]}function _(e){let t=0,n=new WeakMap;try{return JSON.stringify(e,function(e,r){if(!(e===`_owner`&&this!=null&&typeof this==`object`&&`$$typeof`in this)){if(typeof r==`bigint`)return`__bigint__:${r}`;if(typeof r==`object`&&r){let e=n.get(r);if(e!==void 0)return`__object__:${e}`;n.set(r,t),t+=1}return r}})??`__top__:${typeof e}`}catch{return`__unserializable__`}}var v={...u},y={};function b(e,t){let n=u.useRef(y);return n.current===y&&(n.current=e(t)),n}var x=v.useInsertionEffect,S=x&&x!==v.useLayoutEffect?x:e=>e();function C(e){let t=b(w).current;return t.next=e,S(t.effect),t.trampoline}function w(){let e={next:void 0,callback:T,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function T(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}var E=m(`warn`,`Base UI`);function D(){}var O=Object.freeze([]),k=Object.freeze({}),A=typeof document<`u`?u.useLayoutEffect:()=>{},j=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(j.displayName=`CompositeListContext`);function M(){return u.useContext(j)}function N(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=C(i),[,o]=u.useState(!1),s=b(F).current,c=b(P).current,l=u.useRef(0),f=u.useRef(!0),p=u.useRef(null),m=u.useRef(null),h=C(()=>{f.current||(f.current=!0,o(e=>!e))}),g=C((e,t)=>{c.set(e,t),h()}),_=C(e=>{c.delete(e),h()}),v=C(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function y(e){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!R(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&z(r,n)>0){t.disconnect(),h();return}r=n}});m.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=L(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let x=C(()=>{let[e,t]=I(c),n=v(e),r=p.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});y(t),p.current=e,f.current=!1,i&&(s.forEach(e=>e(n)),a(n))});A(()=>(!f.current&&p.current&&v(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),A(()=>{f.current&&x()}),A(()=>()=>{m.current?.disconnect(),f.current=!0},[]);let S=C(e=>(s.add(e),()=>{s.delete(e)})),w=u.useMemo(()=>({register:g,unregister:_,subscribeMapChange:S,nextIndexRef:l}),[g,_,S,l]);return(0,d.jsx)(j.Provider,{value:w,children:t})}function P(){return new Map}function F(){return new Set}function I(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>z(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function L(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function R(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function z(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function B(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var V=B(`https://base-ui.com/production-error`,`Base UI`),ee=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(ee.displayName=`AccordionRootContext`);function H(){let e=u.useContext(ee);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(10):`Base UI: AccordionRootContext is missing. Accordion parts must be placed within <Accordion.Root>.`);return e}function U(e,t,n,r){let i=b(ne).current;return re(i,e,t,n,r)&&W(i,[e,t,n,r]),i.callback}function te(e){let t=b(ne).current;return ie(t,e)&&W(t,e),t.callback}function ne(){return{callback:null,cleanup:null,refs:[]}}function re(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ie(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function W(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var ae=parseInt(u.version,10);function G(e){return ae>=e}function K(e){if(!u.isValidElement(e))return null;let t=e,n=t.props;return(G(19)?n?.ref:t.ref)??null}function oe(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function se(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ce(e,t){return typeof e==`function`?e(t):e}function le(e,t){return typeof e==`function`?e(t):e}var ue={};function de(e,t,n,r,i){if(!n&&!r&&!i&&!e)return pe(t);let a=pe(e);return t&&(a=me(a,t)),n&&(a=me(a,n)),r&&(a=me(a,r)),i&&(a=me(a,i)),a}function fe(e){if(e.length===0)return ue;if(e.length===1)return pe(e[0]);let t=pe(e[0]);for(let n=1;n<e.length;n+=1)t=me(t,e[n]);return t}function pe(e){return ve(e)?{...ye(e,ue)}:he(e)}function me(e,t){return ve(t)?ye(t,e):ge(e,t)}function he(e){let t={...e};for(let e in t){let n=t[e];_e(e,n)&&(t[e]=xe(n))}return t}function ge(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=oe(e.style,r);break;case`className`:e[n]=Ce(e.className,r);break;default:e[n]=_e(n,r)?be(e[n],r):r}}return e}function _e(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ve(e){return typeof e==`function`}function ye(e,t){return ve(e)?e(t):e??ue}function be(e,t){return t?e?(...n)=>{let r=n[0];if(we(r)){let i=r;Se(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:xe(t):e}function xe(e){return e&&((...t)=>{let n=t[0];return we(n)&&Se(n),e(...t)})}function Se(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ce(e,t){return t?e?t+` `+e:t:e}function we(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function q(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ae(r));let i=Te(t,n,r);if(n.enabled===!1)return null;let a=n.state??k;return je(e,r,i,a)}function Te(e,t,n){let{className:r,style:i}=e,{state:a=k,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ce(r,a):void 0,d=l?le(i,a):void 0,f=l?se(a,c):k,p=l&&s?Ee(s):void 0,m=l?oe(f,p)??{}:k;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?te([m.ref,K(n),...o]):U(m.ref,K(n),o):U(null,null)),l?(u!==void 0&&(m.className=Ce(m.className,u)),d!==void 0&&(m.style=oe(m.style,d)),m):k}function Ee(e){return Array.isArray(e)?fe(e):de(void 0,e)}var De=Symbol.for(`react.lazy`),Oe=/^[A-Z][A-Za-z0-9$]*$/,ke=/[a-z]/;function Ae(e){if(e?.$$typeof!==De)return e;let t=u.Children.toArray(e)[0];return u.isValidElement(t)?t:e}function je(e,t,n,r){if(t){if(typeof t==`function`)return process.env.NODE_ENV!==`production`&&Me(t),t(n,r);let e=de(n,t.props);if(e.ref=n.ref,process.env.NODE_ENV!==`production`&&!u.isValidElement(t))throw Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",`https://base-ui.com/r/invalid-render-prop`].join(`
|
|
4
|
-
`));return u.cloneElement(t,e)}if(e&&typeof e==`string`)return Ne(e,n);throw Error(process.env.NODE_ENV===`production`?V(8):`Base UI: Render element or function are not defined.`)}function Me(e){let t=e.name;t.length!==0&&Oe.test(t)&&ke.test(t)&&E(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function Ne(e,t){return e===`button`?(0,u.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,u.createElement)(`img`,{alt:``,...t,key:t.key}):u.createElement(e,t)}var Pe={value:()=>null},Fe=u.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,hiddenUntilFound:a,keepMounted:o,loopFocus:s,onValueChange:c,multiple:l=!1,orientation:f=`vertical`,value:p,defaultValue:m,style:h,..._}=e,v=m??O;process.env.NODE_ENV!==`production`&&u.useEffect(()=>{a&&o===!1&&E("The `keepMounted={false}` prop on `Accordion.Root` is ignored when `hiddenUntilFound` is enabled, since panels must remain mounted while closed.")},[a,o]);let y=u.useRef([]),[b,x]=g({controlled:p,default:v,name:`Accordion`,state:`value`}),S=C((e,t,n)=>{if(!l){let t=b[0]===e?[]:[e];if(c?.(t,n),n.isCanceled)return;x(t)}else if(t){let t=b.slice();if(t.push(e),c?.(t,n),n.isCanceled)return;x(t)}else{let t=b.filter(t=>t!==e);if(c?.(t,n),n.isCanceled)return;x(t)}}),w=u.useMemo(()=>({value:b,disabled:i,orientation:f}),[b,i,f]),T=u.useMemo(()=>({disabled:i,handleValueChange:S,hiddenUntilFound:a??!1,keepMounted:o??!1,state:w,value:b}),[i,S,a,o,w,b]),D=q(`div`,e,{state:w,ref:t,props:_,stateAttributesMapping:Pe});return(0,d.jsx)(ee.Provider,{value:T,children:(0,d.jsx)(N,{elementsRef:y,children:D})})});process.env.NODE_ENV!==`production`&&(Fe.displayName=`AccordionRoot`);var Ie=0;function Le(e,t=`mui`){let[n,r]=u.useState(e),i=e||n;return u.useEffect(()=>{n??(Ie+=1,r(`${t}-${Ie}`))},[n,t]),i}var Re=v.useId;function ze(e,t){if(Re!==void 0){let n=Re();return e??(t?`${t}-${n}`:n)}return Le(e,t)}function Be(e){return ze(e,`base-ui`)}var Ve=`none`,He=`trigger-press`,Ue=`trigger-hover`,We=`trigger-focus`,Ge=`outside-press`,Ke=`item-press`,qe=`close-press`,Je=`focus-out`,Ye=`escape-key`,Xe=`list-navigation`,Ze=`cancel-open`,Qe=`sibling-open`,$e=`disabled`,et=`imperative-action`;function J(e,t,n,r){let i=!1,a=!1,o=r??k;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function tt(e){u.useEffect(e,O)}var nt=null,rt=globalThis.requestAnimationFrame,it=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&rt!==requestAnimationFrame&&(rt=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},at=class e{static create(){return new e}static request(e){return it.request(e)}static cancel(e){return it.cancel(e)}currentId=nt;request(e){this.cancel(),this.currentId=it.request(()=>{this.currentId=nt,e()})}cancel=()=>{this.currentId!==nt&&(it.cancel(this.currentId),this.currentId=nt)};disposeEffect=()=>this.cancel};function ot(){let e=b(at.create).current;return tt(e.disposeEffect),e}function st(e,t=!1,n=!1,r=!1){let[i,a]=u.useState(e&&t?`idle`:void 0),[o,s]=u.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),A(()=>{if(!e&&o&&i!==`ending`&&n){let e=at.request(()=>{a(`ending`)});return()=>{at.cancel(e)}}},[e,o,i,n]),A(()=>{if(!e||t)return;let n=at.request(()=>{a(void 0)});return()=>{at.cancel(n)}},[t,e]),A(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=at.request(()=>{a(`idle`)});return()=>{at.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function ct(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=g({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=st(a,!0,!0),d=Be(),[f,p]=u.useState(),m=f===null?void 0:f??d,h=C(e=>{let t=!a,n=J(He,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return u.useMemo(()=>({defaultPanelId:d,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:c,setOpen:o,setPanelIdState:p,transitionStatus:l}),[d,i,h,s,a,m,c,o,p,l])}var lt=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(lt.displayName=`CollapsibleRootContext`);function ut(){let e=u.useContext(lt);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(15):`Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.`);return e}function dt(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=M(),d=u.useRef(-1),[f,p]=u.useState(a==null&&t?()=>{if(d.current===-1){let e=l.current;l.current+=1,d.current=e}return d.current}:-1),m=a??f,h=u.useRef(null),g=u.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return A(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&p(t)})},[a,c]),{ref:g,index:m}}var ft=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(ft.displayName=`AccordionItemContext`);function pt(){let e=u.useContext(ft);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(9):`Base UI: AccordionItemContext is missing. Accordion parts must be placed within <Accordion.Item>.`);return e}var mt=`data-starting-style`,ht=`data-ending-style`,gt={[mt]:``},_t={[ht]:``},vt={transitionStatus(e){return e===`starting`?gt:e===`ending`?_t:null}},yt=`data-open`,bt=`data-closed`,xt=mt,St=`data-panel-open`,Ct={[yt]:``},wt={[bt]:``},Tt={open(e){return e?{[St]:``}:null}},Et={open(e){return e?Ct:wt}},Dt=`data-index`,Ot={...Et,index:e=>({[Dt]:String(e)}),...vt,value:()=>null},kt=u.forwardRef(function(e,t){let{className:n,disabled:r=!1,onOpenChange:i,render:a,value:o,style:s,...c}=e,{ref:l,index:f}=dt(),p=U(t,l),{disabled:m,handleValueChange:h,state:g,value:_}=H(),v=Be(),y=o??v,b=r||m,x=_.indexOf(y)!==-1,S=C((e,t)=>{i?.(e,t),!t.isCanceled&&h(y,e,t)}),w=ct({open:x,onOpenChange:S,disabled:b}),T=u.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),E=u.useMemo(()=>({...w,onOpenChange:S,state:T}),[w,T,S]),D=u.useMemo(()=>({...g,hidden:!x&&!w.mounted,index:f,disabled:b,open:x}),[w.mounted,b,f,x,g]),O=Be(),[k,A]=u.useState(),j=k===null?void 0:k??O,M=u.useMemo(()=>({defaultTriggerId:O,open:x,state:D,setTriggerId:A,triggerId:j}),[O,x,D,A,j]),N=q(`div`,e,{state:D,ref:p,props:c,stateAttributesMapping:Ot});return(0,d.jsx)(lt.Provider,{value:E,children:(0,d.jsx)(ft.Provider,{value:M,children:N})})});process.env.NODE_ENV!==`production`&&(kt.displayName=`AccordionItem`);var At=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=pt();return q(`h3`,e,{state:o,ref:t,props:a,stateAttributesMapping:Ot})});process.env.NODE_ENV!==`production`&&(At.displayName=`AccordionHeader`);function jt(){return typeof window<`u`}function Mt(e){return Ft(e)?(e.nodeName||``).toLowerCase():`#document`}function Nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pt(e){return((Ft(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ft(e){return jt()?e instanceof Node||e instanceof Nt(e).Node:!1}function Y(e){return jt()?e instanceof Element||e instanceof Nt(e).Element:!1}function It(e){return jt()?e instanceof HTMLElement||e instanceof Nt(e).HTMLElement:!1}function Lt(e){return!jt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Nt(e).ShadowRoot}function Rt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function zt(e){return/^(table|td|th)$/.test(Mt(e))}function Bt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Vt=/transform|translate|scale|rotate|perspective|filter/,Ht=/paint|layout|strict|content/,Ut=e=>!!e&&e!==`none`,Wt;function Gt(e){let t=Y(e)?Yt(e):e;return Ut(t.transform)||Ut(t.translate)||Ut(t.scale)||Ut(t.rotate)||Ut(t.perspective)||!qt()&&(Ut(t.backdropFilter)||Ut(t.filter))||Vt.test(t.willChange||``)||Ht.test(t.contain||``)}function Kt(e){let t=Zt(e);for(;It(t)&&!Jt(t);){if(Gt(t))return t;if(Bt(t))return null;t=Zt(t)}return null}function qt(){return Wt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Wt}function Jt(e){return/^(html|body|#document)$/.test(Mt(e))}function Yt(e){return Nt(e).getComputedStyle(e)}function Xt(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Mt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Lt(e)&&e.host||Pt(e);return Lt(t)?t.host:t}function Qt(e){let t=Zt(e);return Jt(t)?(e.ownerDocument||e).body:It(t)&&Rt(t)?t:Qt(t)}function $t(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Qt(e),i=r===e.ownerDocument?.body,a=Nt(r);if(i){let e=en(a);return t.concat(a,a.visualViewport||[],Rt(r)?r:[],e&&n?$t(e):[])}return t.concat(r,$t(r,[],n))}function en(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var tn=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(tn.displayName=`CompositeRootContext`);function nn(e=!1){let t=u.useContext(tn);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function rn(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:u.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function X(e){return e?.ownerDocument||document}function an(e,t,{detail:n=0}={}){e.dispatchEvent(new(Nt(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function on(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=u.useRef(null),s=nn(!0),c=a??s!==void 0,{props:l}=rn({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i});process.env.NODE_ENV!==`production`&&u.useEffect(()=>{if(!o.current)return;let e=sn(o.current);i?e||h(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${v.captureOwnerStack?.()||``}`):e&&h(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${v.captureOwnerStack?.()||``}`)},[i]);let d=u.useCallback(()=>{let e=o.current;sn(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return A(d,[d]),{getButtonProps:u.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return de({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Se(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=sn(r),s=!i&&cn(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),an(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),an(r,e)))},onKeyUp(e){if(!t){if(Se(e),a?.(e),e.target===e.currentTarget&&i&&c&&sn(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),an(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:C(e=>{o.current=e,d()})}}function sn(e){return It(e)&&e.tagName===`BUTTON`}function cn(e){return It(e)&&e.tagName===`A`&&!!e.href}var ln=u.forwardRef(function(e,t){let{disabled:n,className:r,id:i,render:a,nativeButton:o=!0,style:s,...c}=e,{panelId:l,open:u,handleTrigger:d,disabled:f}=ut(),{getButtonProps:p,buttonRef:m}=on({disabled:n||f,focusableWhenDisabled:!0,native:o}),{defaultTriggerId:h,state:g,setTriggerId:_}=pt(),v=i||void 0,y=v??h;return A(()=>(_(e=>v??(e===null?void 0:e)),()=>{_(e=>e===v?null:e)}),[v,_]),q(`button`,e,{state:g,ref:[t,m],props:[{"aria-controls":u?l:void 0,"aria-expanded":u,id:y,onClick:d},c,p],stateAttributesMapping:Tt})});process.env.NODE_ENV!==`production`&&(ln.displayName=`AccordionTrigger`);function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function un(e){let t=b(dn,e).current;return t.next=e,A(t.effect),t}function dn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function fn(e){return e==null?e:`current`in e?e.current:e}var pn=null;function mn(e){if(!pn){let e=[];pn=e,queueMicrotask(()=>{pn=null,f.flushSync(()=>{for(let t of e)t()})})}pn.push(e)}function hn(e,t=!1,n=!1){let r=ot();return C((i,a=null)=>{r.cancel();let o=fn(e);if(o==null)return;let s=o,c=()=>{if(!n){f.flushSync(i);return}mn(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=mt;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function gn(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=C(a),s=hn(r,n,i);u.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var _n={height:void 0,width:void 0};function vn(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:d}=e,f=u.useRef(null),p=u.useRef(null),[m,h]=u.useState(_n),g=u.useRef(_n),_=u.useRef(!1),v=u.useRef(s),y=u.useRef(!1),[b,x]=u.useState(!1),S=u.useRef(null),w=U(t,f),T=un(s),E=hn(f),D=!s&&!a,O=b?`idle`:d,k=s&&(v.current||y.current),j=!s&&a&&p.current===`css-animation`&&m.height===void 0&&m.width===void 0?g.current:m,M=n&&D&&p.current!==`css-animation`,N=C((e,t=!0)=>{t&&(g.current=e),h(e)}),P=C(()=>{S.current?.(),S.current=null}),F=C(e=>{P(),S.current=()=>{S.current=null,e()}}),I=C(()=>{s&&a&&p.current===`css-animation`&&(y.current=!0)});A(()=>{b&&d!==`starting`&&x(!1)},[b,d]),u.useEffect(()=>()=>{I(),P()},[I,P]),A(()=>{let e=f.current;if(!e)return;!s&&S.current&&P();let t=bn(e,k);if(p.current=t,s&&d===`idle`&&v.current&&t===`css-animation`){g.current=yn(e);return}if(s&&d===`starting`){let n=_.current;if(_.current=!1,t===`none`){N(yn(e)),x(!0);return}if(t===`css-transition`){let t=Cn(e);if(N(yn(e)),!n)return t;let r=Sn(e,`transition-duration`,`0s`);return F(r),x(!0),t}N(yn(e));let r=Sn(e,`animation-name`,`none`);if(!n){r();return}let i=Sn(e,`animation-duration`,`0s`);r(),F(i),x(!0);return}if(!s&&a&&(d===`idle`||d===`starting`)){if(v.current=!1,y.current=!1,t===`none`){N(_n,!1),c(!1);return}N(yn(e));return}if(d!==`ending`)return;if(t===`none`){c(!1);return}let n=yn(e);if(!(n.height>0||n.width>0)){c(!1);return}N(n),t===`css-animation`&&Sn(e,`animation-name`,`none`)()},[a,s,P,N,c,F,k,d]),gn({enabled:s&&a&&O===`idle`,open:!0,ref:f,onComplete(){s&&N(_n,!1)}}),u.useEffect(()=>{if(s||!a||O!==`ending`||!f.current)return;let e=new AbortController,t=-1;function n(){T.current||(c(!1),N(_n,!1))}return t=at.request(()=>{E(n,e.signal)}),()=>{at.cancel(t),e.abort()}},[T,a,s,O,E,N,c]),A(()=>{let e=f.current;e&&n&&D&&e.setAttribute(`hidden`,`until-found`)},[D,n]),u.useEffect(function(){let e=f.current;if(!e)return;function t(e){let t=J(Ve,e);o(!0,t),!t.isCanceled&&(_.current=!0,l(!0))}return Z(e,`beforematch`,t)},[o,l]);let L=i||n||a||s;return{height:j.height,props:{...M?{[xt]:``}:void 0,hidden:D,id:r},ref:w,shouldPreventOpenAnimation:k,shouldRender:L,transitionStatus:O,width:j.width}}function yn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function bn(e,t){let n=Nt(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&xn(n.animationDuration),i=xn(n.transitionDuration);return r&&i?(process.env.NODE_ENV!==`production`&&E(`CSS transitions and CSS animations both detected on Collapsible or Accordion panel.`,`Only one of either animation type should be used.`),`css-transition`):i?`css-transition`:r?`css-animation`:`none`}function xn(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function Sn(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function Cn(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=at.request(n);return()=>{at.cancel(r),n()}}var wn=`--accordion-panel-height`,Tn=`--accordion-panel-width`,En=u.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,id:a,render:o,style:s,...c}=e,{hiddenUntilFound:l,keepMounted:d}=H(),{defaultPanelId:f,mounted:p,onOpenChange:m,open:h,setMounted:g,setOpen:_,setPanelIdState:v,transitionStatus:y}=ut(),b=r??l,x=i??d,S=a||void 0,C=a??f;process.env.NODE_ENV!==`production`&&u.useEffect(()=>{i===!1&&b&&E("The `keepMounted={false}` prop on an `Accordion.Panel` is ignored when `hiddenUntilFound` is enabled on the panel or root, since the panel must remain mounted while closed.")},[b,i]),A(()=>(v(e=>S??(e===null?void 0:e)),()=>{v(e=>e===S?null:e)}),[S,v]);let{height:w,props:T,ref:D,shouldPreventOpenAnimation:O,shouldRender:k,transitionStatus:j,width:M}=vn({externalRef:t,hiddenUntilFound:b,id:C,keepMounted:x,mounted:p,onOpenChange:m,open:h,setMounted:g,setOpen:_,transitionStatus:y}),{state:N,triggerId:P}=pt(),F={...N,transitionStatus:j},I=le(s,F),L=q(`div`,{...e,style:void 0},{state:F,ref:D,props:[T,{"aria-labelledby":P,role:`region`,style:{[wn]:w===void 0?`auto`:`${w}px`,[Tn]:M===void 0?`auto`:`${M}px`}},c,I?{style:I}:void 0,O?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Ot});return k?L:null});process.env.NODE_ENV!==`production`&&(En.displayName=`AccordionPanel`);var Dn=48,On=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-Dn-t;return n},kn=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},An=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-Dn;n+=i>>>1^-(i&1),t[r]=n}return t},jn=384,Mn=[],Nn=kn(On(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Pn=kn(On(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Fn=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,In=(()=>{let e=Nn.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=Nn[n];i<Nn[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(Nn[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=Nn[i];a<Nn[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Ln=On(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Rn=kn(On(`1233333593464636351265367151576`)),zn=On(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0324325853;D>E?3257D>03258432585:0325B:;0328B:032`),Bn=On(`012123445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EJK4444::EJ4444441691;644444114244444:;L6666555555555555555999666664444444444444444444444226?6:66644M9N?D:111::::6DJ199`),Vn=An(`0202002020020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Hn=(()=>{let e=new Int32Array(319).fill(-1),t=An(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=An(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Un=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top|none | auto square video| auto fr max min px| auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Wn=An(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Gn=An(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Kn=An("02222222222222222222222222222222222222222222222222222222222222222203062222222222IL2200IL021042222]`222IL0gj2e50n2222U00X202[^2y0000560|{~22>22|22222222222G000qOVI00000}2>40000B00000I¨000°00000000000000021Q²±00´000000000000000000000222HGHa5¾222Ã6À2222ÍÐ000°2±"),qn=new Int32Array(991),Jn=new Int32Array(991),Yn=new Int32Array(991),Xn=``,Zn=new Int32Array(1030);{let e=new Map,t=0,n=0;for(let r=0;r<Wn.length;r++)for(let i of Un[Kn[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Zn[a*2]=Xn.length,Zn[a*2+1]=i.length,Xn+=i),qn[n]=Wn[r],Jn[n]=Gn[r],Yn[n]=a,n++}}var Qn=An(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),$n=kn(On(`1::22222432:222:22:22>222222:22:2221322511111311111114`)),er=An(`24A;33N=C@H4A;33N=C@<2;363@QTQʰ222ˉºŴŽ2R2=18cƴÅŇÜÛŲǝȈ:ħ25=11D3A@216Er25;11B3?<438Cn9@7=<8192>2E121@9@EHE@9>2T25511<398216=V25511<398216=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),tr=On(`ij`),nr=On(``),rr=On(`1`),ir={GROUP_COUNT:jn,customValidatorNames:Mn,edgeStart:Nn,labelStart:Pn,labelText:Fn,edgeTarget:In,nodeGroup:Ln,nodeVlist:Hn,vlistPat:Rn,vlistOps:zn,vlistRef:Bn,vlistGroup:Vn,litAnchor:qn,litGroup:Jn,litPool:Yn,poolOffsets:Zn,poolText:Xn,adjGid:Qn,adjStart:$n,adjTgt:er,patGid:tr,patTgt:nr,postfixLookupGroups:rr,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},ar=`line`in Error(),or=-1,sr=-1,cr=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},lr=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},ur=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(cr(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(cr(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,H=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),U=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,W=-1,ae=-1,G=-1,K=-1,oe=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,se=e=>/\s/.test(String.fromCharCode(e)),ce=(e,t,n)=>{if(ie=0,W=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;G=t+1,K=n-1;let a=t+1;if(oe(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!oe(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(W=t+1,ae=a,G=a+1)}},le=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},ue=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,de=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fe=e=>!!e&&!Number.isNaN(Number(e)),pe=(e,t,n)=>{if(n-t<11||!le(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&le(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&le(e,t+10,t+18,`-normal/`)},me=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],he=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ge=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],_e=(e,t,n,r)=>{if(e>=10){if(e>=25)return H[e-25](t.slice(n,r));let i=e-10;if(ie!==me[i])return!1;if(W>=0){for(let e of he[i])if(le(t,W,ae,e))return!0;return!1}switch(ge[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(G,K);return U.test(e)&&!te.test(e)}case 3:return fe(t.slice(G,K));case 4:return re.test(t.slice(G,K));default:return ne.test(t.slice(G,K))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return ue.test(t.slice(n,r));case 5:return fe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&fe(t.slice(n,r-1));case 8:return de.test(t.slice(n,r));default:return pe(t,n,r)}},ve=new Set(typeof E==`string`?E.split(` `):E),ye=(e,t,n,r,i,a)=>{let o=cr(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},be=new Map,xe=new Map,Se=2,Ce=4096,we=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ve.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=xe.get(s);return c===void 0&&xe.set(s,c=Se++),c},q=new Map,Te=r,Ee=r+4096,De=()=>Te++,Oe=2097152,ke=8192,Ae=new Int32Array(ke),je=Array(ke).fill(null),Me=new Int32Array(ke),Ne=new Int32Array(ke),Pe=new Uint8Array(ke),Fe=0,Ie=(e,t,n,r,i,a,o,s)=>{let c=e;if(je[e]!==null){if(je[e|1]===null)c=e|1;else if(!(Fe++&3))c=e|Fe>>2&1;else return}je[c]=t.slice(n,r),Ae[c]=i,Me[c]=a,Ne[c]=o,Pe[c]=s},Le=()=>je.fill(null),Re=256,ze=[new Int32Array(Re),new Int32Array(Re),new Int32Array(Re),new Int32Array(Re)],[Be,Ve,He,Ue]=ze,We=new Uint8Array(Re),Ge=new Uint8Array(Re),Ke=()=>{Re*=2,ze=ze.map(e=>{let t=new Int32Array(Re);return t.set(e),t}),[Be,Ve,He,Ue]=ze;let e=new Uint8Array(Re);e.set(We),We=e,Ge=new Uint8Array(Re)},qe=64,Je=new Int32Array(qe),Ye=new Int32Array(qe),Xe=new Int32Array(r),Ze=2048,Qe=21,$e=new Float64Array(Ze),et=new Int32Array(Ze),J=0,tt=(e,t)=>{if(e===0&&t<r)return Xe[t]===J?1:(Xe[t]=J,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Qe;for(;et[i]===J;){if($e[i]===n)return 1;i=i+1&Ze-1}return $e[i]=n,et[i]=J,0},nt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?or:ye(q,e,t+1,r,0,De)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ye[t];if(r>n)continue;let i=Je[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ce(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(_e(d[t],e,r,n))return p[h+t]}return or},rt=e=>{let t=e.length,n=0,c=0,u=!1;(Se>Ce||be.size>Ce)&&(be=new Map,xe=new Map,Se=2,Le()),Te>Ee&&(q=new Map,Te=r,Le());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&se(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&se(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Re&&Ke();let _=n++;Be[_]=p,Ve[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Ae[y]===v&&je[y]!==null&&je[y].length===g?t=y:Ae[y|1]===v&&je[y|1]!==null&&je[y|1].length===g&&(t=y|1),t>=0){let n=je[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){He[_]=Me[t],Ue[_]=Ne[t],We[_]=Pe[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){He[_]=or,Ie(y,e,p,h,v,or,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Je[0]=0,Ye[0]=M,R=1);let z=sr,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?sr:P,B=R),P!==sr){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=sr;else{let e=i[P],t=i[P+1],c=sr;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===qe){qe*=2;let e=new Int32Array(qe);e.set(Je),Je=e;let t=new Int32Array(qe);t.set(Ye),Ye=t}Je[R]=r,Ye[R]=t+2,R++}}A===D&&(z=F<I?sr:P,B=R);let H=F<I?sr:P,U,te=!1;if(A>=0){if(te=!0,U=nt(e,E,A,z,B),U!==or&&U<r&&j[U]){let t=nt(e,E,D,H,R);t!==or&&t!==U&&(U=t,te=!1)}else U===or&&(U=nt(e,E,D,H,R),te=!1)}else U=nt(e,E,D,H,R);let ne=0,re=0;U===or?He[_]=or:(re=+!!te,ne=b>=C?+!!O:ye(be,e,b,C,+!!O,e=>we(e,O)),He[_]=U,We[_]=re,Ue[_]=ne),Ie(y,e,p,h,v,U,ne,re)}if(n===0)return``;if(n===1)return Be[0]===0&&Ve[0]===t?e:e.slice(Be[0],Ve[0]);if(n*k>Ze){for(;n*k>Ze;)Ze<<=1,Qe--;$e=new Float64Array(Ze),et=new Int32Array(Ze)}if(Se>=Oe||Te>=Oe)throw Error(`cn: too many distinct classes in one merge`);J=J+1|0,J===0&&(Xe.fill(0),et.fill(0),J=1);let f=!1;for(let e=n-1;e>=0;e--){let t=He[e];if(t===or){Ge[e]=1;continue}let n=Ue[e];if(tt(n,t)===1){Ge[e]=0,f=!0;continue}if(Ge[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)tt(n,x[e]);if(We[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&tt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ge[m]){m++;continue}let t=Be[m],r=Ve[m],i=m+1;for(;i<n&&Ge[i]&&Be[i]===r+1&&e.charCodeAt(r)===32;)r=Ve[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},it=16384,at=new Int32Array(it*2),ot=0,st=1,ct=Object.create(null),lt=Object.create(null),ut=new Map,dt=new Map,ft=0,pt=0,mt=()=>{ot^=it,st=st+1|0,pt=0},ht=e=>{let t=ct[e];if(t!==void 0)return t;let n=lr(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=lt[e],t!==void 0)?(ct[e]=t,t):(t=rt(e),i?(ct[e]=t,++ft>z&&(ft=0,lt=ct,ct=Object.create(null),mt())):(at[r]=n^st,++pt>it&&mt()),t)},gt=e=>{let t=ut.get(e);if(t!==void 0)return t;let n=lr(e,0,e.length),r=(n&16383)+ot,i=at[r]===(n^st)||at[r^it]===(n^st-1);return i&&(t=dt.get(e),t!==void 0)?(ut.set(e,t),t):(t=rt(e),i?(ut.set(e,t),++ft>z&&(ft=0,dt=ut,ut=new Map,mt())):(at[r]=n^st,++pt>it&&mt()),t)},_t=e=>{let t=lr(e,0,e.length),n=(t&16383)+ot;return at[n]===(t^st)||at[n^it]===(t^st-1)||(at[n]=t^st,++pt>it&&mt(),!1)},vt=z===0?rt:ar?e=>{let t=ut.get(e);return t===void 0?gt(e):t}:ht;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?vt(arguments[0]):vt(pr.apply(null,arguments))},mergeString:vt,seenBefore:z===0?()=>!1:_t,mergeUncached:rt}},dr=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:dr(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},fr=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:dr(i,t);a&&(n&&(n+=` `),n+=a)}return n},pr=function(){return fr(arguments,!1)},mr=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=dr(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(dr(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},hr=ur(ir),Q=mr(hr.mergeString,hr);hr.merge;var gr=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function _r(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:gr(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var vr=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},yr=e=>{let t=vr(e);return t.charAt(0).toUpperCase()+t.slice(1)},br=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),xr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Sr(e){return e!=null}function Cr(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??xr.width,a=e.size??e.height??xr.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?br(...c):br(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??xr[`stroke-width`])*Number(e.size??e.width??xr.width)/Number(t.size??t.width??xr.width):t.strokeWidth??xr[`stroke-width`];return[`svg`,{...Object.entries(xr).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Sr(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Sr(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Sr(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function wr(e,t={}){return Cr(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Tr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Er=(0,u.createContext)({}),Dr=()=>(0,u.useContext)(Er),Or=(0,u.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:d={node:l,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=Dr()??{},b=!!c||Tr(f),[x,S,C=[]]=wr(d,{color:e??v,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:br(y,s),hasA11yProp:b,attributes:f});return(0,u.createElement)(x,{ref:p,...S},[...C.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function kr(e,t=[],n=[]){let r=typeof e==`string`?_r(e,t,n):e,i=(0,u.forwardRef)(({className:e,...t},n)=>(0,u.createElement)(Or,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=yr(r.name)),i}var Ar={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ar.node;var jr=kr(Ar),Mr={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Mr.node;var Nr=kr(Mr),Pr={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Pr.node;var Fr=kr(Pr),Ir={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ir.node;var Lr=kr(Ir),Rr={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Rr.node;var zr=kr(Rr),Br={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Br.node;var Vr=kr(Br),Hr={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Hr.node;var Ur=kr(Hr),Wr={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Wr.node;var Gr=kr(Wr),Kr={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Kr.node;var qr=kr(Kr);function Jr({className:e,...t}){return(0,d.jsx)(Fe,{"data-slot":`accordion`,className:Q(`flex w-full flex-col`,e),...t})}function Yr({className:e,...t}){return(0,d.jsx)(kt,{"data-slot":`accordion-item`,className:Q(`not-last:border-b`,e),...t})}function Xr({className:e,children:t,...n}){return(0,d.jsx)(At,{className:`flex`,children:(0,d.jsxs)(ln,{"data-slot":`accordion-trigger`,className:Q(`group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground`,e),...n,children:[t,(0,d.jsx)(Nr,{"data-slot":`accordion-trigger-icon`,className:`pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden`}),(0,d.jsx)(Lr,{"data-slot":`accordion-trigger-icon`,className:`pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline`})]})})}function Zr({className:e,children:t,...n}){return(0,d.jsx)(En,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up`,...n,children:(0,d.jsx)(`div`,{className:Q(`h-(--accordion-panel-height) pt-0 pb-4 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),children:t})})}function Qr(e){return q(e.defaultTagName??`div`,e,e)}function $r({className:e,...t}){return(0,d.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:Q(e),...t})}function ei({className:e,...t}){return(0,d.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:Q(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5`,e),...t})}function ti({className:e,...t}){return(0,d.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:Q(`inline-flex items-center gap-1.5`,e),...t})}function ni({className:e,render:t,...n}){return Qr({defaultTagName:`a`,props:de({className:Q(`transition-colors hover:text-foreground`,e)},n),render:t,state:{slot:`breadcrumb-link`}})}function ri({className:e,...t}){return(0,d.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:Q(`font-normal text-foreground`,e),...t})}function ii({children:e,className:t,...n}){return(0,d.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:Q(`[&>svg]:size-3.5`,t),...n,children:e??(0,d.jsx)(Fr,{})})}function ai({className:e,...t}){return(0,d.jsxs)(`span`,{"data-slot":`breadcrumb-ellipsis`,role:`presentation`,"aria-hidden":`true`,className:Q(`flex size-5 items-center justify-center [&>svg]:size-4`,e),...t,children:[(0,d.jsx)(zr,{}),(0,d.jsx)(`span`,{className:`sr-only`,children:`More`})]})}var oi=u.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=on({disabled:i,focusableWhenDisabled:a,native:o});return q(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});process.env.NODE_ENV!==`production`&&(oi.displayName=`Button`);function si(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=si(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function ci(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=si(e))&&(r&&(r+=` `),r+=t);return r}var li=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ui=ci,di=(e,t)=>n=>{if(t?.variants==null)return ui(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=li(t)||li(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ui(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},fi=di(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function pi({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,d.jsx)(oi,{"data-slot":`button`,className:Q(fi({variant:t,size:n,className:e})),...r})}function mi({className:e,size:t=`default`,...n}){return(0,d.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:Q(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function hi({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-header`,className:Q(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function gi({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-title`,className:Q(`font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function _i({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-description`,className:Q(`text-sm text-muted-foreground`,e),...t})}function vi({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-action`,className:Q(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}function yi({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-content`,className:Q(`flex flex-col gap-3 px-(--card-spacing)`,e),...t})}function bi({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-footer`,className:Q(`flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)`,e),...t})}var xi=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(xi.displayName=`MenuPositionerContext`);function Si(e){let t=u.useContext(xi);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(33):`Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.`);return t}var Ci=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ci.displayName=`MenuRootContext`);function wi(e){let t=u.useContext(Ci);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(36):`Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.`);return t}var Ti=`data-open`,Ei=`data-closed`,Di=`data-anchor-hidden`,Oi=`data-popup-open`,ki=`data-pressed`,Ai={[Oi]:``},ji={[Oi]:``,[ki]:``},Mi={[Ti]:``},Ni={[Ei]:``},Pi={[Di]:``},Fi={open(e){return e?Ai:null}},Ii={open(e){return e?ji:null}},Li={open(e){return e?Mi:Ni},anchorHidden(e){return e?Pi:null}},Ri={...Li,...vt},zi=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(zi.displayName=`ContextMenuRootContext`);function Bi(e=!0){let t=u.useContext(zi);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(25):`Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.`);return t}var Vi=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Vi.displayName=`MenuCheckboxItemContext`);function Hi(){let e=u.useContext(Vi);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(30):`Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.`);return e}function Ui(){if(typeof navigator>`u`)return{userAgent:``,platform:``,maxTouchPoints:0};if(process.env.NODE_ENV!==`production`){let e=navigator.userAgentData;if(e&&Array.isArray(e.brands))return{userAgent:e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `),platform:e.platform??navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}return{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Wi,platform:Gi,maxTouchPoints:Ki}=Ui(),qi=Wi.toLowerCase(),Ji=Gi.toLowerCase(),Yi=/^i(os$|p)/.test(Ji)||Ji===`macintel`&&Ki>1,Xi=`android`,Zi=Ji===Xi||qi.includes(Xi),Qi=!Yi&&Ji.startsWith(`mac`);Ji.startsWith(`win`),!Zi&&/^(linux|chrome os)/.test(Ji);var $i=Qi||Yi,ea=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ea&&qi.includes(`firefox`),!ea&&qi.includes(`chrom`);var ta=$i,na=/jsdom|happydom/.test(qi);function ra(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),d=a.useState(`open`),f=Bi(!0),p=f!==void 0;return u.useMemo(()=>({id:r,role:`menuitem`,tabIndex:d&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Ke})},onMouseUp(e){if(f){let t=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,p&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||p&&!Qi&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!p||e.button===2)&&c.type===`regular-item`&&an(s.current,e,{detail:1})}}),[t,n,r,l,i,d,a,o,s,f,p,c])}var ia={type:`regular-item`};function aa(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,d=u.useRef(null),{getButtonProps:f,buttonRef:p}=on({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=ra({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:d,itemMetadata:c}),h=u.useCallback(e=>de(m,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,f),[m,f,c]),g=U(d,p);return u.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var oa=`data-checked`,sa=`data-unchecked`,ca={checked(e){return e?{[oa]:``}:{[sa]:``}},...vt},la=u.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:f,onCheckedChange:p,style:m,...h}=e,_=dt({guess:!0,label:a}),v=Si(!0),y=Be(i),{store:b}=wi(),x=b.useState(`disabled`),S=s||x,C=b.useState(`isActive`,_.index),w=b.useState(`itemProps`),[T,E]=g({controlled:l,default:f??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:O,itemRef:k}=aa({closeOnClick:c,disabled:S,highlighted:C,id:y,store:b,nativeButton:o,nodeId:v?.context.nodeId,itemMetadata:ia}),A=u.useMemo(()=>({disabled:S,highlighted:C,checked:T}),[S,C,T]);function j(e){let t=J(Ke,e.nativeEvent,void 0,{preventUnmountOnClose:D});p?.(!T,t),!t.isCanceled&&E(e=>!e)}let M=q(`div`,e,{state:A,stateAttributesMapping:ca,props:[w,{role:`menuitemcheckbox`,"aria-checked":T,onClick:j},h,O],ref:[k,t,_.ref]});return(0,d.jsx)(Vi.Provider,{value:A,children:M})});process.env.NODE_ENV!==`production`&&(la.displayName=`MenuCheckboxItem`);var ua=u.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Hi(),c=u.useRef(null),{transitionStatus:l,mounted:d,setMounted:f}=st(s.checked);return gn({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||f(!1)}}),q(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:ca,props:{"aria-hidden":!0,...o},enabled:a||d})});process.env.NODE_ENV!==`production`&&(ua.displayName=`MenuCheckboxItemIndicator`);var da=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(da.displayName=`MenuGroupContext`);function fa(){let e=u.useContext(da);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(31):`Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.`);return e}var pa=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=u.useState(void 0),c=q(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,d.jsx)(da.Provider,{value:s,children:c})});process.env.NODE_ENV!==`production`&&(pa.displayName=`MenuGroup`);var ma=u.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Be(a),c=fa();return A(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),q(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})});process.env.NODE_ENV!==`production`&&(ma.displayName=`MenuGroupLabel`);var ha=u.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=dt({guess:!0,label:a}),f=Si(!0),p=Be(i),{store:m}=wi(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=aa({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:ia});return q(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})});process.env.NODE_ENV!==`production`&&(ha.displayName=`MenuItem`);var ga=0,_a=class e{static create(){return new e}currentId=ga;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ga,t()},e)}isStarted(){return this.currentId!==ga}clear=()=>{this.currentId!==ga&&(clearTimeout(this.currentId),this.currentId=ga)};disposeEffect=()=>this.clear};function va(){let e=b(_a.create).current;return tt(e.disposeEffect),e}function ya(e){e.preventDefault(),e.stopPropagation()}function ba(e){return`nativeEvent`in e}function xa(e){return e.pointerType===``&&e.isTrusted?!0:Zi&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Sa(e){return na?!1:!Zi&&e.width===0&&e.height===0||Zi&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ca(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function wa(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Ta(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ea(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Da=`data-base-ui-focusable`,Oa=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ka=`ArrowLeft`,Aa=`ArrowRight`,ja=`ArrowUp`,Ma=`ArrowDown`,Na=`data-trigger-disabled`;function Pa(e,t){if(!Y(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Na);for(let[,e]of t.entries())if($(e,n))return!e.hasAttribute(Na);return!1}function Fa(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ia(e){return e.matches(`html,body`)}function La(e){return It(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ra(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Oa}`)!=null}function za(e){return e?e.getAttribute(`role`)===`combobox`&&La(e):!1}function Ba(e){if(!e||na)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Va(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ha(e,t){return t!=null&&!Ca(t)?0:typeof e==`function`?e():e}function Ua(e,t,n){let r=Ha(e,n);return typeof r==`number`?r:r?.[t]}function Wa(e){return typeof e==`function`?e():e}function Ga(e,t){return t||e===`click`||e===`mousedown`}function Ka(e){return e?.includes(`mouse`)&&e!==`mousedown`}var qa=u.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new _a,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(qa.displayName=`FloatingDelayGroupContext`);function Ja(e,t){e.current=t.current}function Ya(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=u.useRef(n),a=u.useRef(n),o=u.useRef(null),s=u.useRef(null),c=va();return A(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Ua(i.current,`open`),close:Ua(n,`close`)}},[n,o,i,a]),(0,d.jsx)(qa.Provider,{value:u.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Xa(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:d,timeout:f}=u.useContext(qa),[p,m]=u.useState(!1),h=u.useRef(n);return A(()=>{h.current=n},[n]),A(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,f.clear()}if(a.current&&!n&&a.current===i){if(m(!1),s){let t=i;return f.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(h.current||a.current!==t)&&f.clear()}}e()}},[n,i,a,o,s,c,l,f,r]),A(()=>{if(!n)return;let e=l.current,t=a.current;f.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:m},a.current=i,o.current={open:0,close:Ua(c.current,`close`)},t!==null&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,J(Ve))):(m(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,f]),A(()=>()=>{if(a.current===i){if(l.current=null,!h.current)return;a.current=null,Ja(o,c),f.clear()}},[l,a,o,i,c,f]),u.useMemo(()=>({activeIdRef:a,hasProvider:d,delayRef:o,isInstantPhase:p}),[a,d,o,p])}function Za(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var Qa={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},$a={...Qa,position:`fixed`,top:0,left:0};({...Qa});var eo=u.forwardRef(function(e,t){let[n,r]=u.useState();A(()=>{ta&&ea&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,d.jsx)(`span`,{...e,ref:t,style:$a,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(eo.displayName=`FocusGuard`);var to=Math.min,no=Math.max,ro=Math.round,io=Math.floor,ao=e=>({x:e,y:e}),oo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function so(e,t,n){return no(e,to(t,n))}function co(e,t){return typeof e==`function`?e(t):e}function lo(e){return e.split(`-`)[0]}function uo(e){return e.split(`-`)[1]}function fo(e){return e===`x`?`y`:`x`}function po(e){return e===`y`?`height`:`width`}function mo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ho(e){return fo(mo(e))}function go(e,t,n){n===void 0&&(n=!1);let r=uo(e),i=ho(e),a=po(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=To(o)),[o,To(o)]}function _o(e){let t=To(e);return[vo(e),t,vo(t)]}function vo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yo=[`left`,`right`],bo=[`right`,`left`],xo=[`top`,`bottom`],So=[`bottom`,`top`];function Co(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bo:yo:t?yo:bo;case`left`:case`right`:return t?xo:So;default:return[]}}function wo(e,t,n,r){let i=uo(e),a=Co(lo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vo)))),a}function To(e){let t=lo(e);return oo[t]+e.slice(t.length)}function Eo(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Do(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Eo(e)}function Oo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ko(e,t){return t<0||t>=e.length}function Ao(e,t){return Mo(e.current,{disabledIndices:t})}function jo(e,t){return Mo(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Mo(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&No(e,a,r));return a}function No(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Fo(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Po(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Fo(e,t=e?Yt(e):null){return!e||!e.isConnected||!t||Po(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Io=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Lo(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Lt(n)?n.host:null}function Ro(e){for(let t of Array.from(e.children))if(Mt(t)===`summary`)return t;return null}function zo(e,t){let n=Ro(t);return!!n&&(e===n||$(n,e))}function Bo(e){let t=e?Mt(e):``;return e!=null&&e.matches(Io)&&(t!==`summary`||e.parentElement!=null&&Mt(e.parentElement)===`details`&&Ro(e.parentElement)===e)&&(t!==`details`||Ro(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Vo(e){if(!Bo(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Lo(t)){let n=t!==e,r=Mt(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Mt(t)===`details`&&!t.open&&!zo(e,t)||t.hasAttribute(`hidden`)||!r&&!Ho(t,n))return!1}return!0}function Ho(e,t){let n=Yt(e);return t?n.display!==`none`:Fo(e,n)}function Uo(e){let t=e.tabIndex;if(t<0){let t=Mt(e);if(t===`details`||t===`audio`||t===`video`||It(e)&&e.isContentEditable)return 0}return t}function Wo(e){if(Mt(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Go(e,t){let n=Wo(e);if(!n)return!0;let r=t.find(e=>{let t=Wo(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Wo(e);return t?.name===n.name&&t.form===n.form})===n}function Ko(e){if(It(e)&&Mt(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return It(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function qo(e,t){Ko(e).forEach(e=>{Bo(e)&&t.push(e),qo(e,t)})}function Jo(e,t,n){Ko(e).forEach(e=>{It(e)&&e.matches(t)&&n.push(e),Jo(e,t,n)})}function Yo(e){return Vo(e)&&Uo(e)>=0}function Xo(e){let t=[];return qo(e,t),t.filter(Vo)}function Zo(e){let t=Xo(e);return t.filter(e=>Uo(e)>=0&&Go(e,t))}function Qo(e,t){let n=Zo(e),r=n.length;if(r===0)return;let i=Ta(X(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function $o(e){return Qo(X(e).body,1)||e}function es(e){return Qo(X(e).body,-1)||e}function ts(e,t){if(!e)return null;let n=Zo(X(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function ns(e){return ts(e,1)}function rs(e){return ts(e,-1)}function is(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function as(e){Zo(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function os(e){let t=[];Jo(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ss(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ss(e,t.id,n)])}function cs(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function ls(e){return`data-base-ui-${e}`}var us=0;function ds(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(us);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),D;let o=requestAnimationFrame(a);return us=o,()=>{us===o&&(cancelAnimationFrame(o),us=0)}}var fs={inert:new WeakMap,"aria-hidden":new WeakMap},ps=`data-base-ui-inert`,ms={inert:new WeakSet,"aria-hidden":new WeakSet},hs=new WeakMap,gs=0;function _s(e){return ms[e]}function vs(e){return e?Lt(e)?e.host:vs(e.parentNode):null}var ys=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=vs(t);return e.contains(n)?n:null}).filter(e=>e!=null),bs=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},xs=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Mt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Ss(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=ys(t,e),l=i?xs(t,bs(c),new Set(c)):[],u=[],d=[];if(a){let e=fs[a],n=_s(a);s=n,o=e;let r=ys(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);xs(t,bs(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(hs.get(e)||0)+1;hs.set(e,t),d.push(e),t===1&&e.setAttribute(ps,``)}),gs+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(hs.get(e)||0)-1;hs.set(e,t),t||e.removeAttribute(ps)}),--gs,gs||(fs.inert=new WeakMap,fs[`aria-hidden`]=new WeakMap,ms.inert=new WeakSet,ms[`aria-hidden`]=new WeakSet,hs=new WeakMap)}}function Cs(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=X(e[0]).body;return Ss(e,a,n,r,{mark:i})}var ws={style:{transition:`none`}},Ts=`data-base-ui-click-trigger`,Es={fallbackAxisSide:`none`},Ds={fallbackAxisSide:`end`},Os={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ks=u.createContext(null);process.env.NODE_ENV!==`production`&&(ks.displayName=`PortalContext`);var As=()=>u.useContext(ks),js=ls(`portal`);function Ms(e={}){let{ref:t,container:n,componentProps:r=k,elementProps:i}=e,a=ze(),o=As()?.portalNode,[s,c]=u.useState(null),[l,d]=u.useState(null),p=C(e=>{e!==null&&d(e)}),m=u.useRef(null);A(()=>{if(n===null){m.current&&(m.current=null,d(null),c(null));return}let e=(n&&(Ft(n)?n:n.current))??o??document.body;if(e==null){m.current&&(m.current=null,d(null),c(null));return}m.current!==e&&(m.current=e,d(null),c(e))},[n,o]);let h=q(`div`,r,{ref:[t,p],props:[{id:a,[js]:``},i]}),g=s&&h?f.createPortal(h,s):null;return{node:l,nodeId:u.isValidElement(h)?h.props.id:void 0,subtree:g}}var Ns=u.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:p,subtree:m}=Ms({container:o,ref:t,componentProps:e,elementProps:c}),h=u.useRef(null),g=u.useRef(null),_=u.useRef(null),v=u.useRef(null),[y,b]=u.useState(null),x=u.useRef(!1),S=y?.modal,C=y?.open,w=!!y&&!y.modal&&y.open&&!!l;u.useEffect(()=>{if(!l||S)return;function e(e){l&&e.relatedTarget&&is(e)&&(e.type===`focusin`?x.current&&=(os(l),!1):(as(l),x.current=!0))}return Za(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,S]),A(()=>{l&&C===!0&&x.current&&(os(l),x.current=!1)},[C,l]);let T=u.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:g,beforeInsideRef:_,afterInsideRef:v,portalNode:l,setFocusManagerState:b}),[l]);return(0,d.jsxs)(u.Fragment,{children:[m,(0,d.jsxs)(ks.Provider,{value:T,children:[w&&l&&(0,d.jsx)(eo,{"data-type":`outside`,ref:h,onFocus:e=>{is(e,l)?_.current?.focus():es(y?y.domReference:null)?.focus()}}),w&&l&&(0,d.jsx)(`span`,{role:s,"aria-owns":p,style:Os}),l&&f.createPortal(a,l),w&&l&&(0,d.jsx)(eo,{"data-type":`outside`,ref:g,onFocus:e=>{is(e,l)?v.current?.focus():($o(y?y.domReference:null)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,J(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(Ns.displayName=`FloatingPortal`);function Ps(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Fs=class{nodesRef={current:[]};events=Ps();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Is=u.createContext(null);process.env.NODE_ENV!==`production`&&(Is.displayName=`FloatingNodeContext`);var Ls=u.createContext(null);process.env.NODE_ENV!==`production`&&(Ls.displayName=`FloatingTreeContext`);var Rs=()=>u.useContext(Is)?.id||null,zs=e=>{let t=u.useContext(Ls);return e??t};function Bs(e){let t=ze(),n=zs(e),r=Rs();return A(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Vs(e){let{children:t,id:n}=e,r=Rs();return(0,d.jsx)(Is.Provider,{value:u.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Hs(e){let{children:t,externalTree:n}=e,r=b(()=>n??new Fs).current;return(0,d.jsx)(Ls.Provider,{value:r,children:t})}function Us(e,t){let n=Nt(Ea(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ws=20,Gs=[];function Ks(){Gs=Gs.filter(e=>e.deref()?.isConnected)}function qs(e){Ks(),e&&Mt(e)!==`body`&&(Gs.push(new WeakRef(e)),Gs.length>Ws&&(Gs=Gs.slice(-20)))}function Js(){return Ks(),Gs[Gs.length-1]?.deref()}function Ys(e){return e?Yo(e)?e:Zo(e)[0]||e:null}function Xs(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Xo(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Yo(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Zs(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=`rootStore`in t?t.rootStore:t,v=_.useState(`open`),y=_.useState(`domReferenceElement`),b=_.useState(`floatingElement`),{events:x,dataRef:S}=_.context,w=C(()=>S.current.floatingContext?.nodeId),T=i===!1,E=za(y)&&T,D=un(i),O=un(a),k=un(l),j=un(v),M=zs(h),N=As(),P=u.useRef(!1),F=u.useRef(!1),I=u.useRef(!1),L=u.useRef(null),R=u.useRef(``),z=u.useRef(``),B=u.useRef(null),V=u.useRef(null),ee=U(B,m,N?.beforeInsideRef),H=U(V,N?.afterInsideRef),te=va(),ne=va(),re=ot(),ie=N!=null,W=Va(b),ae=C((e=W)=>e?Zo(e):[]),G=C(()=>g?.().filter(e=>e!=null)??[]);u.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&$(W,Ta(X(W)))&&ae().length===0&&!E&&ya(e)}return Z(X(W),`keydown`,e)},[r,W,s,E,ae]),u.useEffect(()=>{if(r||!v)return;let e=X(W);function t(){I.current=!1}function n(e){let t=Ea(e),n=G(),r=$(b,t)||$(y,t)||$(N?.portalNode,t)||n.some(e=>e===t||$(e,t));I.current=!r,z.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(F.current=!0,ne.start(0,()=>{F.current=!1}))}function i(){z.current=`keyboard`}return Za(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,b,y,W,v,N,ne,G]),u.useEffect(()=>{if(r||!c)return;let e=X(W);function t(){F.current=!0,ne.start(0,()=>{F.current=!1})}function n(e){let t=Ea(e);Yo(t)&&(L.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Ea(t);s&&n==null&&i!=null&&$(b,i)&&qs(i),queueMicrotask(()=>{let a=w(),c=_.context.triggerElements,l=G(),u=n?.hasAttribute(ls(`focus-guard`))&&[B.current,V.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,fn(p),fn(f)].includes(n),d=!($(y,n)||$(b,n)||$(n,b)||$(N?.portalNode,n)||l.some(e=>e===n||$(e,n))||c.hasMatchingElement(e=>$(e,n))||u||M&&(ss(M.nodesRef.current,a).find(e=>$(e.context?.elements.floating,n)||$(e.context?.elements.domReference,n))||cs(M.nodesRef.current,a).find(e=>[e.context?.elements.floating,Va(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&W&&Xs(W),o&&r!==y&&!Fo(i)&&Ta(e)===e.body){if(It(W)&&(W.focus(),o===`popup`)){re.request(()=>{W.focus()});return}let e=ae(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;It(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(E||!s)&&n&&d&&!F.current&&(E||n!==Js())&&(P.current=!0,_.setOpen(!1,J(Je,t)))})}function a(){I.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let l=It(y)?y:null;if(b||l)return Za(l&&Z(l,`focusout`,i),l&&Z(l,`pointerdown`,t),b&&Z(b,`focusin`,n),b&&Z(b,`focusout`,i),b&&N&&Z(b,`focusout`,a,!0))},[r,y,b,W,s,M,N,_,c,o,ae,E,w,S,te,ne,re,f,p,G]),u.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${ls(`portal`)}]`)||[]),t=(M?cs(M.nodesRef.current,w()):[]).find(e=>za(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Cs([b,...e,B.current,V.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...G(),t,fn(p),fn(f),E?y:null].filter(e=>e!=null),{ariaHidden:s||E,mark:!1}),i=Cs([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,s,N,E,M,w,f,p,G]),A(()=>{if(!v||r||!It(W))return;R.current=``,z.current=``;let e=X(W),t=Ta(e);queueMicrotask(()=>{let n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(W,t))return;let i=null,a=()=>(i??=ae(W),i[0]||W),o;o=r===!0||r===null?a():fn(r),o||=a();let s=$(W,Ta(e));ds(o,{preventScroll:o===W,shouldFocus(){if(!j.current)return!1;if(s)return!0;let t=Ta(e);return!(t!==o&&$(W,t))}})})},[r,v,W,ae,D,k,j]),A(()=>{if(r||!W)return;let e=X(W),t=Ta(e),n=k.current==null;qs(t);function i(e){if(e.open||(R.current=Us(e.nativeEvent,z.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(xa(e.nativeEvent)||Sa(e.nativeEvent))P.current=!1;else{let e=!1;X(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}x.on(`openchange`,i);function a(e){let r=O.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&Mt(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Js()||null,typeof i==`boolean`?s:fn(i)||s||null}return()=>{x.off(`openchange`,i);let t=Ta(e),n=G(),r=$(b,t)||n.some(e=>e===t||$(e,t))||M&&ss(M.nodesRef.current,w(),!1).some(e=>$(e.context?.elements.floating,t)),o=O.current,s=R.current,c=a(s);queueMicrotask(()=>{let n=Ys(c),i=typeof o!=`boolean`;if(o&&!P.current&&It(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,b,W,O,k,x,M,y,w,G]),A(()=>{if(!ea||v||!b)return;let e=Ta(X(b));It(e)&&La(e)&&$(b,e)&&e.blur()},[v,b]),A(()=>{if(!r&&N)return N.setFocusManagerState({modal:s,closeOnFocusOut:c,open:v,onOpenChange:_.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[r,N,s,v,_,c,y]),A(()=>{if(!r&&W)return Xs(W),()=>{queueMicrotask(Ks)}},[r,W]);let K=!r&&(!s||!E)&&(ie||s);return(0,d.jsxs)(u.Fragment,{children:[K&&(0,d.jsx)(eo,{"data-type":`inside`,ref:ee,onFocus:e=>{if(s){let e=ae();ds(e[e.length-1])}else N?.portalNode&&(P.current=!1,is(e,N.portalNode)?$o(y)?.focus():fn(p??N.beforeOutsideRef)?.focus())}}),n,K&&(0,d.jsx)(eo,{"data-type":`inside`,ref:H,onFocus:e=>{s?ds(ae()[0]):N?.portalNode&&(c&&(P.current=!0),is(e,N.portalNode)?es(y)?.focus():fn(f??N.afterOutsideRef)?.focus())}})]})}function Qs(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=He}=t,l=`rootStore`in e?e.rootStore:e,d=l.context.dataRef,f=u.useRef(void 0),p=ot(),m=va(),h=u.useMemo(()=>{function e(e,t,n,r){let i=J(c,t,n);e&&r===`touch`&&s>0?m.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){f.current=Ca(e.pointerType,!0)&&Sa(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Ca(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Ea(o);if(La(u)){e(c,o,u,i);return}let d=n.currentTarget;p.request(()=>{e(c,o,d,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;if(r===`mousedown`&&i){f.current=void 0;return}Ca(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,a,c,l,o,i,p,m,s]);return u.useMemo(()=>n?{reference:h}:k,[n,h])}function $s(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function ec(e){return e!=null&&e.clientX!=null}function tc(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=u.useRef(!1),d=u.useRef(null),[f,p]=u.useState(),[m,h]=u.useState([]),g=C(e=>{i.set(`positionReference`,e)}),_=C((e,t,n)=>{l.current||(!c.current.openEvent||ec(c.current.openEvent))&&i.set(`positionReference`,$s(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:f}))}),v=C(e=>{a?d.current||(_(e.clientX,e.clientY,e.currentTarget),h([])):_(e.clientX,e.clientY,e.currentTarget)}),y=Ca(f)?o:a;u.useEffect(()=>{if(!n){g(s);return}if(!y)return;function e(){d.current?.(),d.current=null}let t=Nt(o);function r(t){let n=Ea(t);$(o,n)?e():_(t.clientX,t.clientY)}return!c.current.openEvent||ec(c.current.openEvent)?d.current=Z(t,`mousemove`,r):g(s),e},[y,n,o,c,s,i,_,g,m]),u.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),u.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),u.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=u.useMemo(()=>{function e(e){p(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return u.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function nc(){return!1}function rc(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ic(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=nc,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,d=l.useState(`open`),f=l.useState(`floatingElement`),{dataRef:p,events:m}=l.context,h=zs(c),g=C(typeof i==`function`?i:()=>!1),_=typeof i==`function`?g:i,v=_!==!1,y=C(()=>a),{escapeKey:b,outsidePress:x}=rc(s),S=u.useRef(!1),w=u.useRef(!1),T=u.useRef(!1),E=u.useRef(!1),D=u.useRef(!1),O=u.useRef(``),k=u.useRef(null),A=va(),j=va(),M=C(()=>{j.clear(),p.current.insideReactTree=!1}),N=C(e=>{let t=p.current.floatingContext?.nodeId;return(h?ss(h.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),P=C(e=>Fa(e,l.select(`floatingElement`))||Fa(e,l.select(`domReferenceElement`))),F=C(e=>{o()&&l.setOpen(!1,J(He,e.nativeEvent))}),I=C(e=>{if(!d||!n||!r||e.key!==`Escape`||D.current||!b&&N(`__escapeKeyBubbles`))return;let t=J(Ye,ba(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!b&&!t.isPropagationAllowed&&e.stopPropagation()}),L=C(()=>{p.current.insideReactTree=!0,j.start(0,M)}),R=C(e=>{if(!d||!n||e.button!==0)return;let t=Ea(e.nativeEvent);$(l.select(`floatingElement`),t)&&(S.current||(S.current=!0,w.current=!1))}),z=C(e=>{d&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&S.current&&(w.current=!0)});u.useEffect(()=>{function e(e){e.open||(E.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),u.useEffect(()=>{if(!d||!n)return d||(E.current=!1),M;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=x;let e=new _a,t=new _a,i=X(f);function a(){e.clear(),D.current=!0}function o(){e.start(ea?5:0,()=>{D.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function c(){S.current=!1,w.current=!1}function u(){let e=O.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function g(e){let t=p.current.floatingContext?.nodeId,n=h&&ss(h.nodesRef.current,t).some(t=>Fa(e,t.context?.elements.floating));return P(e)||n}function C(e){if(m(e)){e.type!==`click`&&!P(e)&&(t.clear(),T.current=!1),M();return}if(p.current.insideReactTree){M();return}let n=Ea(e),r=`[${ls(`inert`)}]`,i=Y(n)?n.getRootNode():null,a=Array.from((Lt(i)?i:X(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>$(e,n))))return;let s=Y(n)?n:null;for(;s&&!Jt(s);){let e=Zt(s);if(Jt(e)||!Y(e))break;s=e}if(!(a.length&&Y(n)&&!Ia(n)&&!$(n,l.select(`floatingElement`))&&a.every(e=>!$(s,e)))){if(It(n)&&!(`touches`in e)){let t=Jt(n),r=Yt(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!g(e)){if(u()===`intentional`){if(e.detail!==0&&!xa(e)&&!E.current)return;if(T.current){t.clear(),T.current=!1;return}}(typeof _!=`function`||_(e))&&(N(`__outsidePressBubbles`)||(l.setOpen(!1,J(Ge,e)),M()))}}}function j(e){u()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!P(e)&&C(e)}function F(e){if(u()!==`sloppy`||!l.select(`open`)||!n||P(e))return;let t=e.touches[0];t&&(k.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Ea(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function R(e){O.current=`touch`,L(e,F)}function z(e){A.clear(),e.type===`pointerdown`&&(e.button===0&&(E.current=!0),O.current=e.pointerType),(e.type!==`mousedown`||!k.current||k.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?j(e):C(e)})}function B(e){if(e.type===`pointercancel`&&(E.current=!1),!S.current)return;let n=w.current;if(c(),u()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!g(e)){if(n){s();return}(typeof _!=`function`||_(e))&&(t.clear(),T.current=!0,M())}}}function V(e){if(u()!==`sloppy`||!k.current||P(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-k.current.startX),r=Math.abs(t.clientY-k.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(k.current.dismissOnTouchEnd=!0),i>10&&(C(e),A.clear(),k.current=null)}function ee(e){L(e,V)}function H(e){u()===`sloppy`&&k.current&&!P(e)&&(k.current.dismissOnTouchEnd&&C(e),A.clear(),k.current=null)}function U(e){L(e,H)}let te=Za(r&&Za(Z(i,`keydown`,I),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),v&&Za(Z(i,`click`,z,!0),Z(i,`pointerdown`,z,!0),Z(i,`pointerup`,B,!0),Z(i,`pointercancel`,B,!0),Z(i,`mousedown`,z,!0),Z(i,`mouseup`,B,!0),Z(i,`touchstart`,R,{capture:!0,passive:!0}),Z(i,`touchmove`,ee,{capture:!0,passive:!0}),Z(i,`touchend`,U,{capture:!0,passive:!0})));return()=>{te(),e.clear(),t.clear(),c(),T.current=!1,M()}},[p,f,r,v,_,d,n,b,x,I,M,y,N,P,h,l,A]);let B=u.useMemo(()=>({onKeyDown:I,onPointerDown:F,onClick:F}),[I,F]),V=u.useMemo(()=>({onKeyDown:I,onPointerDown:z,onMouseDown:z,onClickCapture:L,onMouseDownCapture(e){L(),R(e)},onPointerDownCapture(e){L(),R(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[I,L,R,z]);return u.useMemo(()=>n?{reference:B,floating:V,trigger:B}:{},[n,B,V])}function ac(e,t,n){let{reference:r,floating:i}=e,a=mo(t),o=ho(t),s=po(o),c=lo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=uo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function oc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=co(t,e),p=Do(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Oo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var sc=50,cc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:oc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ac(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<sc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ac(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},lc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=co(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lo(r),_=mo(o),v=lo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[To(o)]:_o(o)),x=p!==`none`;!d&&x&&b.push(...wo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=go(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===mo(t)||T.every(e=>mo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=mo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},uc=new Set([`left`,`top`]);async function dc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lo(n),s=uo(n),c=mo(n)===`y`,l=uc.has(o)?-1:1,u=a&&c?-1:1,d=co(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await dc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=co(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=mo(i),p=fo(f),m=u[p],h=u[f],g=(e,t)=>so(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},mc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=co(e,t),u={x:n,y:r},d=mo(i),f=fo(d),p=u[f],m=u[d],h=co(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=uc.has(lo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=co(e,t),c=await i.detectOverflow(t,s),l=lo(n),u=uo(n),d=mo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=to(p-c[m],g),y=to(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*no(c.left,c.right):S=p-2*no(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gc(e){let t=Yt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=It(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ro(n)!==a||ro(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function _c(e){return Y(e)?e:e.contextElement}function vc(e){let t=_c(e);if(!It(t))return ao(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=gc(t),o=(a?ro(n.width):n.width)/r,s=(a?ro(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var yc=ao(0);function bc(e){let t=Nt(e);return!qt()||!t.visualViewport?yc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Nt(e)}function Sc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=_c(e),o=ao(1);t&&(r?Y(r)&&(o=vc(r)):o=vc(e));let s=xc(a,n,r)?bc(a):ao(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Nt(a),t=Y(r)?Nt(r):r,n=e,i=en(n);for(;i&&t!==n;){let e=vc(i),t=i.getBoundingClientRect(),r=Yt(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Nt(i),i=en(n)}}return Oo({width:u,height:d,x:c,y:l})}function Cc(e,t){let n=Xt(e).scrollLeft;return t?t.left+n:Sc(Pt(e)).left+n}function wc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Cc(e,n),y:n.top+t.scrollTop}}function Tc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Pt(r),s=t?Bt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ao(1),u=ao(0),d=It(r);if((d||!a)&&((Mt(r)!==`body`||Rt(o))&&(c=Xt(r)),d)){let e=Sc(r);l=vc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?wc(o,c):ao(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ec(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Dc(e){let t=Xt(e),n=e.ownerDocument.body,r=no(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=no(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Cc(e),o=-t.scrollTop;return Yt(n).direction===`rtl`&&(a+=no(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Oc=25;function kc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Nt(e),a=Pt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Cc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Oc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ac(e,t){let n=Sc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function jc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=kc(e,n,t);else if(t===`document`)r=Dc(Pt(e));else if(Y(t))r=Ac(t,n);else{let n=bc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Oo(r)}function Mc(e,t){let n=t.get(e);if(n)return n;let r=$t(e,[],!1).filter(e=>Y(e)&&Mt(e)!==`body`),i=null,a=Yt(e).position===`fixed`,o=a?Zt(e):e;for(;Y(o)&&!Jt(o);){let e=Yt(o),t=Gt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Zt(o)}return t.set(e,r),r}function Nc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Bt(t)?[]:Mc(t,this._c):[].concat(n),r],o=jc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=jc(t,a[e],i);s=no(n.top,s),c=to(n.right,c),l=to(n.bottom,l),u=no(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Pc(e){let{width:t,height:n}=gc(e);return{width:t,height:n}}function Fc(e,t,n){let r=It(t),i=Pt(t),a=n===`fixed`,o=Sc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ao(0);if((r||!a)&&((Mt(t)!==`body`||Rt(i))&&(s=Xt(t)),r)){let e=Sc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Cc(i));let l=i&&!r&&!a?wc(i,s):ao(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ic(e){return Yt(e).position===`static`}function Lc(e,t){if(!It(e)||Yt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Pt(e)===n&&(n=n.ownerDocument.body),n}function Rc(e,t){let n=Nt(e);if(Bt(e))return n;if(!It(e)){let t=Zt(e);for(;t&&!Jt(t);){if(Y(t)&&!Ic(t))return t;t=Zt(t)}return n}let r=Lc(e,t);for(;r&&zt(r)&&Ic(r);)r=Lc(r,t);return r&&Jt(r)&&Ic(r)&&!Gt(r)?n:r||Kt(e)||n}var zc=async function(e){let t=this.getOffsetParent||Rc,n=this.getDimensions,r=await n(e.floating);return{reference:Fc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bc(e){return Yt(e).direction===`rtl`}var Vc={convertOffsetParentRelativeRectToViewportRelativeRect:Tc,getDocumentElement:Pt,getClippingRect:Nc,getOffsetParent:Rc,getElementRects:zc,getClientRects:Ec,getDimensions:Pc,getScale:vc,isElement:Y,isRTL:Bc};function Hc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Uc(e,t,n){let r=null,i,a=Pt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=io(d),h=io(a.clientWidth-(u+f)),g=io(a.clientHeight-(d+p)),_=io(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:no(0,to(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Hc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Nt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Wc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=_c(e),u=i||a?[...l?$t(l):[],...t?$t(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Uc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Sc(e):null;c&&g();function g(){let t=Sc(e);h&&!Hc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Gc=fc,Kc=pc,qc=lc,Jc=hc,Yc=mc,Xc=(e,t,n)=>{let r=new Map,i=n??{},a={...Vc,...i.platform,_c:r};return cc(e,t,{...i,platform:a})},Zc=typeof document<`u`?u.useLayoutEffect:function(){};function Qc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Qc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $c(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function el(e,t){let n=$c(e);return Math.round(t*n)/n}function tl(e){let t=u.useRef(e);return Zc(()=>{t.current=e}),t}function nl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=u.useState(r);Qc(m,r)||h(r);let[g,_]=u.useState(null),[v,y]=u.useState(null),b=u.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=u.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=u.useRef(null),T=u.useRef(null),E=u.useRef(d),D=c!=null,O=tl(c),k=tl(i),A=tl(l),j=u.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Xc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Qc(E.current,t)&&(E.current=t,f.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Zc(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[l]);let M=u.useRef(!1);Zc(()=>(M.current=!0,()=>{M.current=!1}),[]),Zc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=u.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=u.useMemo(()=>({reference:S,floating:C}),[S,C]),F=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=el(P.floating,d.x),r=el(P.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$c(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var rl=(e,t)=>{let n=Gc(e);return{name:n.name,fn:n.fn,options:[e,t]}},il=(e,t)=>{let n=Kc(e);return{name:n.name,fn:n.fn,options:[e,t]}},al=(e,t)=>({fn:Yc(e).fn,options:[e,t]}),ol=(e,t)=>{let n=qc(e);return{name:n.name,fn:n.fn,options:[e,t]}},sl=(e,t)=>{let n=Jc(e);return{name:n.name,fn:n.fn,options:[e,t]}},cl=o((e=>{var t=require("react");function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ll=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require("react"),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),ul=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?cl():ll()})),dl=o((e=>{var t=require("react"),n=ul();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),fl=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require("react"),r=ul(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),pl=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?dl():fl()})),ml=[],hl=void 0;function gl(){return hl}function _l(e){ml.push(e)}function vl(e){let t=(t,n)=>{let r=b(bl).current,i;try{hl=r;for(let e of ml)e.before(r);i=e(t,n);for(let e of ml)e.after(r);r.didInitialize=!0}finally{hl=void 0}return i};return t.displayName=e.displayName||e.name,t}function yl(e){return u.forwardRef(vl(e))}function bl(){return{didInitialize:!1}}var xl=ul(),Sl=pl(),Cl=G(19)?El:Dl;function wl(e,t,n,r,i){return Cl(e,t,n,r,i)}function Tl(e,t,n,r,i){let a=u.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,xl.useSyncExternalStore)(e.subscribe,a,a)}_l({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,xl.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function El(e,t,n,r,i){let a=gl();if(!a)return Tl(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Dl(e,t,n,r,i){return(0,Sl.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ol=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return wl(this,e,t,n,r)}},kl=class extends Ol{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){u.useDebugValue(e);let n=this;A(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;A(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;if(process.env.NODE_ENV!==`production`){u.useDebugValue(e,e=>Object.keys(e));let t=u.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}A(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){u.useDebugValue(e);let n=this,r=t!==void 0;if(A(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r]),process.env.NODE_ENV!==`production`){let t=this.controlledValues??=new Map;t.has(e)||t.set(e,r);let n=t.get(e);n!==void 0&&n!==r&&console.error(`A component is changing the ${r?``:`un`}controlled state of ${e.toString()} to be ${r?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return u.useDebugValue(e),wl(this,this.selectors[e],t,n,r)}useContextCallback(e,t){u.useDebugValue(e);let n=C(t??D);this.context[e]=n}useStateSetter(e){let t=u.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Al={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},jl=class extends kl{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ps(),nested:n,triggerElements:i},Al),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&wa(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ml(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),d=t.context.triggerElements,f=o,p=u.useRef(null);r===void 0&&p.current===null&&(p.current=new jl({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:d,onOpenChange:f,floatingId:i,syncOnly:!0,nested:a}));let m=r??p.current;return t.useSyncedValue(`floatingId`,i),A(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Y(c)&&(e.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(e.positionReference=c),m.update(e)},[s,i,c,l,m]),m.context.onOpenChange=f,m.context.nested=a,m}var Nl={tabIndex:-1,[Da]:``};function Pl(e){return t=>t!==`touch`||e.current}function Fl(e,t=!1){let n=ze(),r=Rs()!=null,i=b(()=>e(n,r)).current;return Ml({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Il({handle:e,store:t}){return A(()=>e.attachStore(t),[e,t]),null}function Ll(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Rl(e,t){let n=u.useRef(null);return C(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ll(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ll(t))})}function zl(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Bl(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Vl(e,t,n,r={}){let i=n.reason,a=i===Ue,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Bl(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=zl(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?f.flushSync(l):l()}function Hl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Rl(e,n),o=C(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=C(e=>{a(e),e&&o(e)});return A(()=>(s(t.current),()=>s(null)),[s,t,n,e]),A(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ul(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=u.useRef(null),i=e.useState(`open`);A(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=J(Ve);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Wl(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=st(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=C(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return gn({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Gl(e,t){e.useSyncedValues(t),A(()=>()=>{e.update({activeTriggerProps:k,inactiveTriggerProps:k,popupProps:k})},[e])}function Kl(e,t){A(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),A(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ql;function Jl(e){ql??=new WeakMap;let t=ql.get(e);return t||(t=new WeakMap,ql.set(e,t)),t}var Yl=class{constructor(){this.idMap=new Map}add(e,t){if(process.env.NODE_ENV!==`production`){let n=Jl(this),r=n.get(t);if(r!==void 0&&r!==e)throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`);let i=this.idMap.get(e);i!==void 0&&i!==t&&n.delete(i),n.set(t,e)}this.idMap.set(e,t)}delete(e){if(process.env.NODE_ENV!==`production`){let t=this.idMap.get(e);t!==void 0&&ql?.get(this)?.delete(t)}this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Xl(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new jl({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:k,inactiveTriggerProps:k,popupProps:k}}var Zl=e=>e.triggerIdProp??e.activeTriggerId,Ql=e=>e.openProp??e.open,$l=e=>(e.popupElement?.id??e.floatingId)||void 0;function eu(e,t){return t!==void 0&&Ql(e)&&Zl(e)===t}function tu(e,t){return eu(e,t)?!0:t!==void 0&&Ql(e)&&Zl(e)==null&&e.triggerCount===1}var nu={open:Ql,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Zl,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:$l,isTriggerActive:(e,t)=>t!==void 0&&Zl(e)===t,isOpenedByTrigger:(e,t)=>eu(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Zl(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>tu(e,t)?$l(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ru(e){let t=u.useCallback(t=>e===void 0?D:e.subscribeStore(t),[e]),n=u.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xl.useSyncExternalStore)(t,n,()=>e?.serverStore)}function iu(e){return au(e,e.rootContext)}function au(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,d]=u.useState(null),[f,p]=u.useState(void 0),[m,h]=u.useState(void 0),g=u.useRef(null),_=zs(r),v=u.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=nl({...e,elements:{...v,...l&&{reference:l}}}),b=Y(f)?f:null,x=m===void 0?t.state.floatingElement:m;t.useSyncedValue(`referenceElement`,f??null),t.useSyncedValue(`domReferenceElement`,f===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=u.useCallback(e=>{let t=Y(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=u.useCallback(e=>{(Y(e)||e===null)&&(g.current=e,p(e)),(Y(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!Y(e))&&y.refs.setReference(e)},[y.refs,p]),w=u.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=u.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=u.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=u.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return A(()=>{o&&(g.current=o)},[o]),A(()=>{t.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),u.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var ou=Qi&&ea;function su(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=u.useRef(!1),c=u.useRef(null),l=u.useRef(!0),d=va();u.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=Nt(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&It(e)&&e===Ta(X(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return Za(Z(t,`blur`,r),ou&&Z(t,`keydown`,a,!0),ou&&Z(t,`pointerdown`,o,!0))},[i,n]),u.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Y(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let f=u.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Ea(t.nativeEvent);if(Y(a)){if(ou&&!t.relatedTarget){if(!l.current&&!La(a))return}else if(!Ba(a))return}let o=Pa(t.relatedTarget,i.context.triggerElements),{nativeEvent:u,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,J(We,u,f));return}d.start(p,()=>{s.current||i.setOpen(!0,J(We,u,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Y(n)&&n.hasAttribute(ls(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;d.start(0,()=>{let e=i.select(`domReferenceElement`),t=Ta(X(e));(n||t!==e)&&($(o.current.floatingContext?.refs.floating.current,t)||$(e,t)||a||Pa(n??t,i.context.triggerElements)||i.setOpen(!1,J(We,r)))})}}},[o,r,i,d]);return u.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}var cu=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new _a,this.restTimeout=new _a,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},lu=new WeakMap;function uu(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&lu.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),lu.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function du(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=lu.get(n);a&&a!==e&&uu(a),uu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,lu.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function fu(e){let t=e.context.dataRef.current,n=b(()=>t.hoverInteractionState??cu.create()).current;return t.hoverInteractionState||=n,tt(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function pu(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,d=zs(),f=Rs(),p=fu(a),m=va(),h=C(()=>Ga(l.current.openEvent?.type,p.interactedInside)),g=C(()=>Ka(l.current.openEvent?.type)),_=C(()=>{uu(p)});A(()=>{o||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,_())},[o,p,_]),u.useEffect(()=>_,[_]),A(()=>{if(n&&o&&p.handleCloseOptions?.blockPointerEvents&&g()&&Y(c)&&s){let e=c,t=s,n=X(s),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=p.pointerEventsScopeElement===t?null:p.pointerEventsScopeElement,a=r===t?null:r,o=p.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return du(p,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{_()}}},[n,o,c,s,p,g,d,f,_]),u.useEffect(()=>{if(!n)return;function e(){return!!(d&&f&&ss(d.nodesRef.current,f).length>0)}function t(e){let t=Ua(r,`close`,p.pointerType),n=()=>{a.setOpen(!1,J(Ue,e)),d?.events.emit(`floating.closed`,e)};t?p.openChangeTimeout.start(t,n):(p.openChangeTimeout.clear(),n())}function o(e){let t=Ea(e);if(!Ra(t)){p.interactedInside=!1;return}p.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){p.openChangeTimeout.clear(),m.clear(),d?.events.off(`floating.closed`,v),_()}function u(n){if(e()&&d){d.events.on(`floating.closed`,v);return}if(Pa(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(d&&r&&Y(o)&&ss(d.nodesRef.current,r,!1).some(e=>$(e.context?.elements.floating,o)))){if(p.handler){p.handler(n);return}_(),g()&&!h()&&t(n)}}function v(t){d&&f&&!e()&&m.start(0,()=>{d.events.off(`floating.closed`,v),a.setOpen(!1,J(Ue,t)),d.events.emit(`floating.closed`,t)})}let y=s;return Za(y&&Z(y,`mouseenter`,c),y&&Z(y,`mouseleave`,u),y&&Z(y,`pointerdown`,o,!0),()=>{d?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,g,h,_,p,d,f,m])}var mu={current:null};function hu(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=mu,externalTree:l,isActiveTrigger:d=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:h,guardStaleOpen:g=!1}=t,_=`rootStore`in e?e.rootStore:e,{dataRef:v,events:y}=_.context,b=zs(l),x=fu(_),S=u.useRef(!1),w=un(i),T=un(r),E=un(o),D=un(n),O=un(h),k=un(m),A=C(()=>Ga(v.current.openEvent?.type,x.interactedInside)),j=C(()=>O.current?.()!==!1),M=C((e,t,n)=>{let r=_.context.triggerElements;if(r.hasElement(t))return!e||!$(e,t);if(!Y(n))return!1;let i=n;return r.hasMatchingElement(e=>$(e,i))&&(!e||!$(e,i))}),N=C(()=>{x.handler&&=(X(_.select(`domReferenceElement`)).removeEventListener(`mousemove`,x.handler),void 0)}),P=C(()=>{uu(x)});return d&&(x.handleCloseOptions=i?.__options),u.useEffect(()=>N,[N]),u.useEffect(()=>{if(!n)return;function e(e){e.open?S.current=!1:(S.current=e.reason===Ue,N(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on(`openchange`,e),()=>{y.off(`openchange`,e)}},[n,y,x,N]),u.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Ua(T.current,`close`,x.pointerType);n?x.openChangeTimeout.start(n,()=>{_.setOpen(!1,J(Ue,e)),b?.events.emit(`floating.closed`,e)}):t&&(x.openChangeTimeout.clear(),_.setOpen(!1,J(Ue,e)),b?.events.emit(`floating.closed`,e))}let t=c.current??(d?_.select(`domReferenceElement`):null);if(!Y(t))return;function r(e){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!Ca(x.pointerType))return;let t=Wa(E.current),n=Ua(T.current,`open`,x.pointerType),r=Ea(e),i=e.currentTarget??null,o=_.select(`domReferenceElement`),s=i;if(Y(r)&&!_.context.triggerElements.hasElement(r)){for(let e of _.context.triggerElements.elements())if($(e,r)){s=e;break}}Y(i)&&Y(o)&&!_.context.triggerElements.hasElement(i)&&$(i,o)&&(s=o);let c=s!=null&&M(o,s,r),l=_.select(`open`),u=k.current?.()??_.select(`transitionStatus`)===`ending`,d=!l&&u&&S.current,f=!c&&Y(s)&&Y(o)&&$(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,h=!l||c;if(m){j()&&_.setOpen(!0,J(Ue,e,s));return}p||(n?x.openChangeTimeout.start(n,()=>{h&&j()&&_.setOpen(!0,J(Ue,e,s))}):h&&j()&&_.setOpen(!0,J(Ue,e,s)))}function i(t){if(A()){P();return}N();let n=X(_.select(`domReferenceElement`));x.restTimeout.clear(),x.restTimeoutPending=!1;let r=v.current.floatingContext??p?.();if(!Pa(t.relatedTarget,_.context.triggerElements)){if(w.current&&r){_.select(`open`)||x.openChangeTimeout.clear();let i=c.current;x.handler=w.current({...r,tree:b,x:t.clientX,y:t.clientY,onClose(){P(),N(),D.current&&!A()&&i===_.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,x.handler),x.handler(t);return}(x.pointerType!==`touch`||!$(_.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){$(t,e.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}let l=g?Z(t,`mouseout`,o):void 0;return s?Za(Z(t,`mousemove`,r,{once:!0}),Z(t,`mouseenter`,r),Z(t,`mouseleave`,i),l):Za(Z(t,`mouseenter`,r),Z(t,`mouseleave`,i),l)},[N,P,v,T,_,n,w,x,d,M,A,a,s,E,c,b,D,p,k,j,g]),u.useMemo(()=>{if(!n)return;function e(e){x.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=_.select(`domReferenceElement`),i=_.select(`open`),o=M(r,n,e.target);if(a&&!Ca(x.pointerType))return;if(i&&o&&x.handleCloseOptions?.blockPointerEvents){let e=_.select(`floatingElement`);if(e){let t=x.handleCloseOptions?.getScope?.()??n.ownerDocument.body;du(x,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Wa(E.current);if(i&&!o||s===0||!o&&x.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;x.restTimeout.clear();function c(){if(x.restTimeoutPending=!1,A())return;let e=_.select(`open`);!x.blockMouseMove&&(!e||o)&&j()&&_.setOpen(!0,J(Ue,t,n))}x.pointerType===`touch`?f.flushSync(()=>{c()}):o&&i?c():(x.restTimeoutPending=!0,x.restTimeout.start(s,c))}}},[n,x,A,M,a,_,E,j])}var gu=`Escape`;function _u(e){return ea&&e.movementX===0&&e.movementY===0}function vu(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function yu(e,t){return vu(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function bu(e,t,n){return vu(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function xu(e,t,n){return vu(t,n?e===ka:e===Aa,e===Ma)}function Su(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===gu:vu(t,n?e===Aa:e===ka,e===ja)}function Cu(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,grid:S}=t,w=S!=null;process.env.NODE_ENV!==`production`&&(s&&(c||console.warn("`useListNavigation` looping must be enabled to allow escaping."),f||console.warn("`useListNavigation` must be virtual to allow escaping.")),_===`vertical`&&w&&console.warn("In grid list navigation mode, the `orientation` should",`be either "horizontal" or "both".`));let T=`rootStore`in e?e.rootStore:e,E=T.useState(`open`),D=T.useState(`floatingElement`),O=T.useState(`domReferenceElement`),k=T.context.dataRef,j=Va(D),M=za(O),N=un(j),P=Rs(),F=zs(x),I=u.useRef(p),L=u.useRef(o??-1),R=u.useRef(null),z=u.useRef(!0),B=C(e=>{i(L.current===-1?null:L.current,e)}),V=u.useRef(!!D),ee=u.useRef(E),H=u.useRef(!1),U=u.useRef(!1),te=u.useRef(null),ne=un(g),re=un(E),ie=un(o),W=un(b),ae=ot(),G=ot(),K=C(()=>{function e(e){f?F?.events.emit(`virtualfocus`,e):te.current=ds(e,{sync:H.current,preventScroll:!0})}let t=n.current[L.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[L.current]||t;i&&(t||e(i),de&&(r||!z.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});A(()=>{k.current.orientation=_},[k,_]),A(()=>{a&&(E&&D?(L.current=o??-1,I.current&&o!=null&&(U.current=!0,B())):V.current&&(L.current=-1,B()))},[a,E,D,o,B]),A(()=>{if(a){if(!E){H.current=!1;return}if(D){if(r==null){if(H.current=!1,ie.current!=null)return;if(V.current&&(L.current=-1,K()),(!ee.current||!V.current)&&I.current&&(R.current!=null||I.current===!0&&R.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>G.request(e):queueMicrotask)(t),e+=1):(L.current=R.current==null||bu(R.current,_,d)||l?Ao(n):jo(n),R.current=null,B())};t()}}else ko(n.current,r)||(L.current=r,K(),U.current=!1)}}},[a,E,D,r,ie,l,n,_,d,B,K,G]),A(()=>{if(!a||D||!F||f||!V.current)return;let e=F.nodesRef.current,t=e.find(e=>e.id===P)?.context?.elements.floating,n=Ta(X(O??t??null)),r=e.some(e=>e.context&&$(e.context.elements.floating,n));t&&!r&&z.current&&t.focus({preventScroll:!0})},[a,D,O,F,P,f]),A(()=>{ee.current=E,V.current=!!D}),A(()=>{E||(R.current=null,I.current=p)},[E,p]);let oe=r!=null,se=C(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(L.current!==t||r!==t)&&(L.current=t,B(e))}),ce=C(()=>v??F?.nodesRef.current.find(e=>e.id===P)?.context?.dataRef?.current.orientation),le=C(()=>Ao(n,ne.current)),ue=C(e=>{if(z.current=!1,H.current=!0,e.which===229||!re.current&&e.currentTarget===N.current)return;if(l&&Su(e.key,_,d,w)){yu(e.key,ce())||ya(e),T.setOpen(!1,J(Xe,e.nativeEvent)),It(O)&&(f?F?.events.emit(`virtualfocus`,O):O.focus());return}let t=L.current,r=Ao(n,g),i=jo(n,g);if(M||(e.key===`Home`&&(ya(e),L.current=r,B(e)),e.key===`End`&&(ya(e),L.current=i,B(e))),S!=null){let t=S(e,L.current,n,_,c,d,g,r,i);if(t!=null&&(L.current=t,B(e)),_===`both`)return}if(yu(e.key,_)){if(ya(e),E&&!f&&Ta(e.currentTarget.ownerDocument)===e.currentTarget){L.current=bu(e.key,_,d)?r:i,B(e);return}bu(e.key,_,d)?c?t>=i?s&&t!==n.current.length?L.current=-1:(H.current=!1,L.current=r):L.current=Mo(n.current,{startingIndex:t,disabledIndices:g}):L.current=Math.min(i,Mo(n.current,{startingIndex:t,disabledIndices:g})):c?t<=r?s&&t!==-1?L.current=n.current.length:(H.current=!1,L.current=i):L.current=Mo(n.current,{startingIndex:t,decrement:!0,disabledIndices:g}):L.current=Math.max(r,Mo(n.current,{startingIndex:t,decrement:!0,disabledIndices:g})),ko(n.current,L.current)&&(L.current=-1),B(e)}}),de=u.useMemo(()=>({onFocus(e){H.current=!0,se(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){_u(e)||(H.current=!0,U.current=!1,m&&se(e))},onPointerLeave(e){if(!re.current||!z.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&W.current&&(te.current?.(),te.current=null,L.current=-1,B(e),!f)){let e=N.current,t=Ta(X(e));e&&$(e,t)&&e.focus({preventScroll:!0})}}}),[se,re,N,m,n,B,W,f]),fe=u.useMemo(()=>f&&E&&oe&&{"aria-activedescendant":`${y}-${r}`},[f,E,oe,y,r]),pe=u.useMemo(()=>({...M?{}:fe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&E&&!f){let t=Ea(e.nativeEvent);if(t&&!$(N.current,t))return;ya(e),T.setOpen(!1,J(Je,e.nativeEvent)),It(O)&&O.focus();return}ue(e)},onPointerMove(e){_u(e)||(z.current=!0)}}),[fe,ue,N,M,T,E,f,O]),me=u.useMemo(()=>{function e(e){T.setOpen(!0,J(Xe,e.nativeEvent,e.currentTarget))}function t(e){p===`auto`&&xa(e.nativeEvent)&&(I.current=!f)}function n(e){I.current=p,p===`auto`&&Sa(e.nativeEvent)&&(I.current=!0)}return{onKeyDown(t){let n=T.select(`open`);z.current=!1;let r=t.key.startsWith(`Arrow`),i=xu(t.key,ce(),d),a=yu(t.key,_),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(f&&n)return ue(t);if(n||h||!r){if(o){let e=yu(t.key,ce());R.current=l&&e?null:t.key}if(l){i&&(ya(t),n?(L.current=le(),B(t)):e(t));return}a&&(ie.current!=null&&(L.current=ie.current),ya(t),!n&&h?e(t):ue(t),n&&B(t))}},onFocus(e){T.select(`open`)&&!f&&(L.current=-1,B(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,p,le,l,B,T,h,_,ce,d,ie,f]),he=u.useMemo(()=>({...fe,...me}),[fe,me]);return u.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function wu(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=va(),h=u.useRef(``),g=u.useRef(d??i??-1),_=u.useRef(null),v=C(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Fo(n)||n?.matches(`:disabled`)?!1:o==null||!No(O,e,o)}function u(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let f=n.current;if(h.current.length>0&&e.key===` `&&(ya(e),s?.(!0)),h.current.length>0&&h.current[0]!==` `&&u(f,h.current)===-1&&e.key!==` `&&s?.(!1),f==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(ya(e),s?.(!0));let v=h.current===``;v&&(g.current=d??i??-1),f.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,s?.(!1)});let y=((v?d??i??-1:g.current)??0)+1,b=u(f,h.current,y);b===-1?e.key!==` `&&(h.current=``,s?.(!1)):(a?.(b),_.current=b)}),y=C(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);$(n,t)||$(r,t)||(m.clear(),h.current=``,g.current=_.current,s?.(!1))});A(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]);let b=u.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return u.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Tu=.1,Eu=Tu*Tu,Du=.5;function Ou(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function ku(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ou(e,t,n,r,i,a)&&(u=!u),Ou(e,t,i,a,o,s)&&(u=!u),Ou(e,t,o,s,c,l)&&(u=!u),Ou(e,t,c,l,n,r)&&(u=!u),u}function Au(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ju(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Mu(e={}){let{blockPointerEvents:t=!1}=e,n=new _a,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Eu;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Ea(r),g=r.type===`mouseleave`,_=$(u,h),v=$(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Y(r.relatedTarget)&&$(u,r.relatedTarget))return;function y(){return!!(s&&ss(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=ju(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ju(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ju(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ju(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Au(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Du/2:Du*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Du+1,o=C||T?S.bottom-Du:S.top,s=C?T?S.bottom-Du:S.top:S.bottom-Du;M=ku(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Du/2:Du*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Du,o=C||T?S.top+Du:S.bottom,s=C?T?S.top+Du:S.bottom:S.top+Du;M=ku(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Du/2:Du*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Du+1,o=w||E?S.right-Du:S.left,s=w?E?S.right-Du:S.left:S.right-Du;M=ku(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Du/2:Du*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Du,o=w||E?S.left+Du:S.right,s=w?E?S.left+Du:S.right:S.left+Du;M=ku(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Nu=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Nu.displayName=`ToolbarRootContext`);function Pu(e){let t=u.useContext(Nu);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(69):`Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.`);return t}var Fu=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Iu(e){return e===`starting`?ws:k}var Lu=u.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=wi(),{side:c,align:l}=Si(),f=Pu(!0)!=null,p=s.useState(`open`),m=s.useState(`transitionStatus`),h=s.useState(`popupProps`),g=s.useState(`mounted`),_=s.useState(`instantType`),v=s.useState(`activeTriggerElement`),y=s.useState(`parent`),b=s.useState(`lastOpenChangeReason`),x=s.useState(`rootId`),S=s.useState(`floatingRootContext`),C=s.useState(`floatingTreeRoot`),w=s.useState(`closeDelay`),T=s.useState(`hoverEnabled`),E=s.useState(`disabled`),D=s.useState(`openMethod`),O=y.type===`context-menu`;gn({open:p,ref:s.context.popupRef,onComplete(){p&&s.context.onOpenChangeComplete?.(!0)}}),u.useEffect(()=>{function e(e){s.setOpen(!1,J(e.reason,e.domEvent))}return C.events.on(`close`,e),()=>{C.events.off(`close`,e)}},[C.events,s]),pu(S,{enabled:T&&!E&&!O&&y.type!==`menubar`,closeDelay:w});let k=s.useStateSetter(`popupElement`),A=q(`div`,e,{state:{transitionStatus:m,side:c,align:l,open:p,nested:y.type===`menu`,instant:_},ref:[t,s.context.popupRef,k],stateAttributesMapping:Ri,props:[h,{onKeyDown(e){f&&Fu.has(e.key)&&e.stopPropagation()}},Iu(m),o,{"data-rootownerid":x}]}),j=y.type===void 0||O;return(v||y.type===`menubar`&&b!==`outside-press`)&&(j=!0),(0,d.jsx)(Zs,{context:S,openInteractionType:D,modal:O,disabled:!g,returnFocus:a===void 0?j:a,initialFocus:y.type!==`menu`,restoreFocus:!0,externalTree:y.type===`menubar`?void 0:C,previousFocusableElement:v,nextFocusableElement:y.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:A})});process.env.NODE_ENV!==`production`&&(Lu.displayName=`MenuPopup`);var Ru=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ru.displayName=`MenuPortalContext`);function zu(){let e=u.useContext(Ru);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(32):`Base UI: <Menu.Portal> is missing.`);return e}var Bu=u.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=wi();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,d.jsx)(Ru.Provider,{value:n,children:(0,d.jsx)(Ns,{ref:t,...r,portalOwnerRole:o})})});process.env.NODE_ENV!==`production`&&(Bu.displayName=`MenuPortal`);function Vu(e){return G(19)?e:e?`true`:void 0}var Hu=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Hu.displayName=`DirectionContext`);function Uu(){return u.useContext(Hu)?.direction??`ltr`}var Wu=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=co(e,t)||{};if(l==null)return{};let f=Do(u),p={x:n,y:r},m=ho(i),h=po(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=so(k,j,A),N=!c.arrow&&uo(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Gu=(e,t)=>{let{name:n,fn:r}=Wu(e);return{name:n,fn:r,options:[e,t]}},Ku={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},qu={sideX:`left`,sideY:`top`},Ju=`--available-width`,Yu=`--available-height`,Xu=`--anchor-width`,Zu=`--anchor-height`,Qu=`--transform-origin`,$u=Ju,ed=Yu;function td(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function nd(e,t,n){let{rects:r,placement:i}=e;return{side:td(t,lo(i),n),align:uo(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function rd(e){return id(e,iu)}function id(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:w}=e,[T,E]=u.useState(null);!_&&T!==null&&E(null);let D=v.side||`flip`,O=v.align||`flip`,k=v.fallbackAxisSide||`end`,j=y?.crossAxis??!1,M=y?.rootBoundary,N=typeof n==`function`?n:void 0,P=C(N),F=N?P:n,I=un(n),L=un(_),R=Uu()===`rtl`,z=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[i],B=o===`center`?z:`${z}-${o}`,V=l;typeof V==`number`?V={top:V,right:V,bottom:V,left:V}:V&&={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0};let ee=+(i===`bottom`),H=+(i===`top`),U=+(i===`right`),te=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:V},re=u.useRef(null),ie=un(a),W=un(s),ae=typeof a==`function`?0:a,G=typeof s==`function`?0:s,K=[];m&&K.push(m),K.push(rl(e=>{let t=nd(e,i,R),n=typeof ie.current==`function`?ie.current(t):ie.current,r=typeof W.current==`function`?W.current(t):W.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ae,G,R,i]));let oe=O===`none`&&D!==`shift`,se=!oe&&(d||j||D===`shift`),ce=D===`none`?null:ol({...ne,padding:{top:V.top+1+ee,right:V.right+1+te,bottom:V.bottom+1+H,left:V.left+1+U},mainAxis:!j&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),le=oe?null:il({...ne,rootBoundary:M,mainAxis:O!==`none`,crossAxis:se,limiter:d||j?void 0:al(e=>{if(!re.current)return{};let{width:t,height:n}=re.current.getBoundingClientRect(),r=mo(lo(e.placement)),i=r===`y`?t:n,a=r===`y`?V.left+V.right:V.top+V.bottom;return{offset:i/2+a/2}})},[ne,d,j,M,V,O]);D===`shift`||O===`shift`||o===`center`?K.push(le,ce):K.push(ce,le),K.push(sl({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty($u,`${t}px`),i.setProperty(ed,`${n}px`);let a=Nt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Xu,`${u}px`),i.setProperty(Zu,`${d}px`)}}),Gu(e=>({element:re.current||X(e.elements.floating).createElement(`div`),padding:re.current?f:0,offsetParent:`floating`}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=lo(r),u=uo(r),d=mo(l)===`y`,f=re.current,p=typeof a==`function`?a(nd(e,i,R)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return se&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Qu,d?`${m} ${h}`:`${h} ${m}`),{}}},Ku,x),A(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let ue=u.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:de,elements:fe,x:pe,y:me,middlewareData:he,update:ge,placement:_e,context:ve,isPositioned:ye,floatingStyles:be}=t({rootContext:g,open:h?_:void 0,placement:B,middleware:K,strategy:r,whileElementsMounted:h?void 0:(...e)=>Wc(...e,ue),nodeId:b,externalTree:w}),{sideX:xe,sideY:Se}=he.adaptiveOrigin||qu,Ce=ye?r:`fixed`,we=u.useMemo(()=>{let e;return e=ye?x?{position:Ce,[xe]:pe,[Se]:me}:{...be,position:Ce}:{position:Ce,top:0,left:0},e[$u]=`100vw`,e[ed]=`100vh`,ye||(e.opacity=0),e},[x,Ce,xe,pe,Se,me,be,ye]),q=u.useRef(null);A(()=>{if(!_)return;let e=I.current,t=typeof e==`function`?e():e,n=(ad(t)?t.current:t)||null;n!==q.current&&(de.setPositionReference(n),q.current=n)},[_,de,F,I]),u.useEffect(()=>{if(!_)return;let e=I.current;typeof e!=`function`&&ad(e)&&e.current!==q.current&&(de.setPositionReference(e.current),q.current=e.current)},[_,de,F,I]),u.useEffect(()=>{if(h&&_&&fe.reference&&fe.floating)return Wc(fe.reference,fe.floating,ge,ue)},[h,_,fe,ge,ue]);let Te=lo(_e),Ee=td(i,Te,R),De=uo(_e)||`center`,Oe=!!he.hide?.referenceHidden;A(()=>{S&&_&&ye&&Te!==z&&E(Te)},[S,_,ye,Te,z]);let ke=u.useMemo(()=>({position:`absolute`,top:he.arrow?.y,left:he.arrow?.x}),[he.arrow]),Ae=he.arrow?.centerOffset!==0;return u.useMemo(()=>({positionerStyles:we,arrowStyles:ke,arrowRef:re,arrowUncentered:Ae,side:Ee,align:De,physicalSide:Te,anchorHidden:Oe,refs:de,context:ve,isPositioned:ye,update:ge}),[we,ke,re,Ae,Ee,De,Te,Oe,de,ve,ye,ge])}function ad(e){return e!=null&&`current`in e}var od=u.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,d.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});process.env.NODE_ENV!==`production`&&(od.displayName=`InternalBackdrop`);function sd(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),q(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Iu(r),i],stateAttributesMapping:Li})}var cd={},ld={},ud=``;function dd(e,t){return Rt(e)?e:t}function fd(e,t,n){return/hidden|clip/.test(e.getComputedStyle(dd(t,n)).overflowY)}function pd(e){if(typeof document>`u`)return!1;let t=X(e);return Nt(t).innerWidth-t.documentElement.clientWidth>0}function md(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=X(e),n=t.documentElement,r=t.body,i=dd(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function hd(e){let t=X(e),n=t.documentElement,r=t.body,i=dd(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function gd(e){let t=X(e),n=t.documentElement,r=t.body,i=Nt(n),a=0,o=0,s=!1,c=at.create();if(ea&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,cd={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ud=n.style.scrollBehavior,ld={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=dd(n,r);if(s=md(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,cd),Object.assign(r.style,ld),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ud)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var _d=new class{lockCount=0;restore=null;timeoutLock=_a.create();timeoutUnlock=_a.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=X(e),n=t.documentElement,r=t.body,i=Nt(n);if(fd(i,n,r)){let t=new i.MutationObserver(()=>{fd(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Yi||!pd(e);this.restore=a?hd(e):gd(e)}};function vd(e=!0,t=null){A(()=>{if(e)return _d.acquire(t)},[e,t])}var yd=20;function bd(e,t,n,r){let[i,a]=u.useState(!1);A(()=>{if(!e||!t||n==null){a(!1);return}let r=X(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-yd)},[e,t,n]),vd(e&&(!t||i),r)}var xd=u.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=Es,style:v,...y}=e,{store:b}=wi(),x=zu(),S=Bi(!0),C=b.useState(`parent`),w=b.useState(`floatingRootContext`),T=b.useState(`floatingTreeRoot`),E=b.useState(`mounted`),D=b.useState(`open`),O=b.useState(`modal`),k=b.useState(`openMethod`),j=b.useState(`activeTriggerElement`),M=b.useState(`transitionStatus`),P=b.useState(`positionerElement`),F=b.useState(`instantType`),I=b.useState(`adaptiveOrigin`),L=b.useState(`lastOpenChangeReason`),R=b.useState(`floatingNodeId`),z=b.useState(`floatingParentNodeId`),B=w.useState(`domReferenceElement`),V=u.useRef(null),ee=hn(P),H=n,U=c,te=l,ne=s,re=_;C.type===`context-menu`&&(H=n??C.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(te=e.alignOffset??2,U=e.sideOffset??-5));let ie=o,W=ne;C.type===`menu`?(ie??=`inline-end`,W??=`start`,re=e.collisionAvoidance??Ds):C.type===`menubar`&&(ie??=C.context.orientation===`vertical`?`inline-end`:`bottom`,W??=`start`);let ae=C.type===`context-menu`,G=rd({anchor:H,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ie,sideOffset:U,align:W,alignOffset:te,arrowPadding:ae?0:m,collisionBoundary:f,collisionPadding:p,sticky:h,nodeId:R,keepMounted:x,disableAnchorTracking:g,collisionAvoidance:re,shift:ae?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:I});u.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===R&&b.set(`hoverEnabled`,!1),e.nodeId!==R&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,J(Qe)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[b,T.events,R]),u.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,J(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,b]);let K=va();u.useEffect(()=>{D||K.clear()},[D,K]),u.useEffect(()=>{function e(e){if(D&&e.nodeId===b.select(`floatingParentNodeId`)){if(e.target&&j&&j!==e.target){let e=b.select(`closeDelay`);e>0?K.isStarted()||K.start(e,()=>{b.setOpen(!1,J(Qe))}):b.setOpen(!1,J(Qe))}else K.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,j,b,K]),u.useEffect(()=>{let e={open:D,nodeId:R,parentNodeId:z,reason:b.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,b,R,z]),A(()=>{let e=B,t=V.current;if(e&&(V.current=e),t&&e&&e!==t){b.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{b.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[B,ee,b]);let oe={open:D,side:G.side,align:G.align,anchorHidden:G.anchorHidden,nested:C.type===`menu`,instant:F},se=C.type===`menubar`&&C.context.modal;bd(D&&(se||O&&L!==`trigger-hover`),k===`touch`,P,j);let ce=sd(e,oe,{styles:G.positionerStyles,transitionStatus:M,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),le=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&L!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=j),(0,d.jsxs)(xi.Provider,{value:G,children:[le&&(0,d.jsx)(od,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:Vu(!D),cutout:ue}),(0,d.jsx)(Vs,{id:R,children:(0,d.jsx)(N,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,children:ce})})]})});process.env.NODE_ENV!==`production`&&(xd.displayName=`MenuPositioner`);var Sd=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Sd.displayName=`MenuRadioGroupContext`);function Cd(){let e=u.useContext(Sd);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(34):`Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.`);return e}var wd=u.memo(u.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...f}=e,[p,m]=u.useState(void 0),[h,_]=g({controlled:i,default:a,name:`MenuRadioGroup`}),v=C((e,t)=>{o?.(e,t),!t.isCanceled&&_(e)}),y=q(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??p,"aria-disabled":s||void 0,...f}}),b=u.useMemo(()=>({value:h,setValue:v,disabled:s}),[h,v,s]);return(0,d.jsx)(da.Provider,{value:m,children:(0,d.jsx)(Sd.Provider,{value:b,children:y})})}));process.env.NODE_ENV!==`production`&&(wd.displayName=`MenuRadioGroup`);var Td=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Td.displayName=`MenuRadioItemContext`);function Ed(){let e=u.useContext(Td);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(35):`Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.`);return e}var Dd=u.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:f,...p}=e,m=dt({guess:!0,label:a}),h=Si(!0),g=Be(i),{store:_}=wi(),v=_.useState(`isActive`,m.index),y=_.useState(`itemProps`),{value:b,setValue:x,disabled:S}=Cd(),C=_.useState(`disabled`),w=s||S||C,T=b===l,{getItemProps:E,itemRef:O}=aa({closeOnClick:c,disabled:w,highlighted:v,id:g,store:_,nativeButton:o,nodeId:h?.context.nodeId,itemMetadata:ia}),k=u.useMemo(()=>({disabled:w,highlighted:v,checked:T}),[w,v,T]);function A(e){let t=J(Ke,e.nativeEvent,void 0,{preventUnmountOnClose:D});x(l,t)}let j=q(`div`,e,{state:k,stateAttributesMapping:ca,props:[y,{role:`menuitemradio`,"aria-checked":T,onClick:A},p,E],ref:[O,t,m.ref]});return(0,d.jsx)(Td.Provider,{value:k,children:j})});process.env.NODE_ENV!==`production`&&(Dd.displayName=`MenuRadioItem`);var Od=u.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Ed(),c=u.useRef(null),{transitionStatus:l,mounted:d,setMounted:f}=st(s.checked);return gn({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||f(!1)}}),q(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:ca,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||d})});process.env.NODE_ENV!==`production`&&(Od.displayName=`MenuRadioItemIndicator`);var kd=u.createContext(null);process.env.NODE_ENV!==`production`&&(kd.displayName=`MenubarContext`);function Ad(e){let t=u.useContext(kd);if(t===null&&!e)throw Error(process.env.NODE_ENV===`production`?V(5):`Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.`);return t}function jd(e){let t=u.useRef(``),n=u.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:u.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Md(e,t){let n=u.useRef(e),r=C(t);A(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Nd(e,t){let{onClick:n,onPointerDown:r}=jd(C((n,r)=>{(typeof e==`function`?e():e)||t(r||(Yi?`touch`:``))}));return u.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Pd(e){let[t,n]=u.useState(null),r=Nd(e,n);return Md(e,t=>{t&&!e&&n(null)}),u.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Fd={...nu,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Id=class extends kl{constructor(e,t,n=!1){let r=new Yl,i=Rd(r,t,n,e);super(i,Ld(r),Fd),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function Ld(e){return{positionerRef:u.createRef(),popupRef:u.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:u.createRef(),beforeContentFocusGuardRef:u.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Rd(e,t,n=!1,r){return{...Xl(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Fs,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:k,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var zd=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(zd.displayName=`MenuSubmenuRootContext`);function Bd(){return u.useContext(zd)}var Vd=vl(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:f,closeParentOnEsc:p=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:_=!0}=e,v=Bi(!0),y=wi(!0),x=Ad(!0),S=Bd(),w=u.useMemo(()=>S&&y?{type:`menu`,store:y.store}:x?{type:`menubar`,context:x}:v&&!y?{type:`context-menu`,context:v}:{type:void 0},[v,y,x,S]),T=ze(),E=ze(),D=Rs(),j=w.type===`menu`?w.store:void 0,M=(n??a)&&j?.state.transitionStatus===`starting`,N=b(()=>M?j?.state.instantType:void 0).current,P=Hd({open:a,openProp:n,activeTriggerId:g,triggerIdProp:h,parent:w,disabled:o,highlightItemOnHover:_,modal:w.type===void 0?s:void 0,rootId:T,instantType:N},E,D!=null);P.useControlledProp(`openProp`,n),P.useControlledProp(`triggerIdProp`,h),P.useContextCallback(`onOpenChangeComplete`,i);let F=P.useState(`floatingTreeRoot`),I=Bs(F),L=P.useState(`open`),R=P.useState(`activeTriggerElement`),z=P.useState(`positionerElement`),B=P.useState(`hoverEnabled`),V=P.useState(`disabled`),ee=P.useState(`lastOpenChangeReason`),H=P.useState(`parent`),U=P.useState(`activeIndex`),te=P.useState(`payload`),ne=P.useState(`floatingParentNodeId`),re=u.useRef(null),ie=u.useRef(H.type!==`context-menu`),W=va(),ae=u.useRef(!0),G=va(),K=ne!=null;process.env.NODE_ENV!==`production`&&H.type!==void 0&&s!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");let{openMethod:oe,triggerProps:se}=Pd(L);P.useSyncedValues({disabled:o,highlightItemOnHover:_,modal:H.type===void 0?s:void 0,openMethod:oe,rootId:T}),Ul(P);let{forceUnmount:ce,transitionStatus:le}=Wl(L,P,()=>{P.set(`allowMouseEnter`,!1)},M),ue=hn(P.context.popupRef);u.useEffect(()=>{if(N===void 0)return;let e=()=>{P.state.instantType===N&&P.set(`instantType`,void 0)};if(!L){e();return}if(le!==void 0)return;if(P.context.popupRef.current==null){e();return}let t=new AbortController;return ue(e,t.signal),()=>{t.abort()}},[N,L,le,ue,P]),A(()=>{v&&!y?P.update({parent:{type:`context-menu`,context:v},floatingNodeId:I,floatingParentNodeId:D}):y&&P.update({floatingNodeId:I,floatingParentNodeId:D})},[v,y,I,D,P]),u.useEffect(()=>{if(L||(re.current=null),H.type===`context-menu`){if(!L){W.clear(),ie.current=!1;return}W.start(500,()=>{ie.current=!0})}},[W,L,H.type]),A(()=>{!L&&!B&&P.set(`hoverEnabled`,!0)},[L,B,P]);let fe=C((e,t)=>{let n=t.reason;if(!e&&!P.select(`open`)||L===e&&t.trigger===R&&ee===n)return;let i=Bl(t);if(!e&&t.trigger==null&&(t.trigger=R??void 0),r?.(e,t),t.isCanceled)return;P.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ae.current)return;e&&n===`trigger-focus`?(ae.current=!1,G.start(300,()=>{ae.current=!0})):(ae.current=!0,G.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);re.current=t.event;let c=zl(P.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=H.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,P.update(c)}),pe=Ml({popupStore:P,floatingRootContext:P.state.floatingRootContext,floatingId:E,nested:D!=null,onOpenChange:fe}),me=pe.context.events;A(()=>{let e=({open:e,eventDetails:t})=>fe(e,t);return me.on(`setOpen`,e),()=>{me?.off(`setOpen`,e)}},[me,fe]);let he=u.useCallback(()=>{P.setOpen(!1,J(et))},[P]);u.useImperativeHandle(f,()=>({unmount:ce,close:he}),[ce,he]);let ge;H.type===`context-menu`&&(ge=H.context),u.useImperativeHandle(ge?.positionerRef,()=>z,[z]),u.useImperativeHandle(ge?.actionsRef,()=>({setOpen:fe}),[fe]);let _e=ic(pe,{enabled:!V,bubbles:{escapeKey:p&&H.type===`menu`},outsidePress(){return H.type!==`context-menu`||re.current?.type===`contextmenu`||ie.current},externalTree:K?F:void 0}),ve=Uu(),ye=u.useCallback(e=>{P.select(`activeIndex`)!==e&&P.set(`activeIndex`,e)},[P]),be=Cu(pe,{enabled:!V,listRef:P.context.itemDomElements,activeIndex:U,nested:H.type!==void 0,loopFocus:c,orientation:l,parentOrientation:H.type===`menubar`?H.context.orientation:void 0,rtl:ve===`rtl`,disabledIndices:O,onNavigate:ye,openOnArrowKeyDown:H.type!==`context-menu`,externalTree:K?F:void 0,focusItemOnHover:_}),xe=u.useCallback(e=>{P.context.typingRef.current=e},[P]),Se=wu(pe,{enabled:!V,listRef:P.context.itemLabels,elementsRef:P.context.itemDomElements,activeIndex:U,resetMs:500,onMatch:e=>{L&&e!==U&&P.set(`activeIndex`,e)},onTyping:xe}),Ce=u.useMemo(()=>{let e=de(Se.reference,be.reference,_e.reference,{onMouseMove(){P.set(`allowMouseEnter`,!0)}},se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=L,e},[P,Se.reference,be.reference,_e.reference,se,L]),we=u.useMemo(()=>{let e=de(be.trigger,_e.trigger,se);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[be.trigger,_e.trigger,se]);b(()=>(P.update({inactiveTriggerProps:we}),null)),Gl(P,{floatingRootContext:pe,activeTriggerProps:Ce,inactiveTriggerProps:we,popupProps:u.useMemo(()=>de(Nl,{id:E,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":R?.id,onMouseMove(){P.set(`allowMouseEnter`,!0),H.type===`menu`&&P.set(`hoverEnabled`,!1)},onClick(){P.select(`hoverEnabled`)&&P.set(`hoverEnabled`,!1)},onKeyDown(e){let t=P.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Se.floating,be.floating,_e.floating),[R,E,l,H.type,P,Se.floating,be.floating,_e.floating]),itemProps:be.item??k});let q=u.useMemo(()=>({store:P,parent:w}),[P,w]),Te=(0,d.jsxs)(Ci.Provider,{value:q,children:[m&&(0,d.jsx)(Il,{handle:m,store:P}),typeof t==`function`?t({payload:te}):t]});return H.type===void 0||H.type===`context-menu`?(0,d.jsx)(Hs,{externalTree:F,children:Te}):Te});process.env.NODE_ENV!==`production`&&(Vd.displayName=`MenuRoot`);function Hd(e,t,n){return b(()=>new Id(e,t,n)).current}function Ud(e){let t=wi().store,n=u.useMemo(()=>({parentMenu:t}),[t]);return(0,d.jsx)(zd.Provider,{value:n,children:(0,d.jsx)(Vd,{...e})})}var Wd=5;function Gd(e,t){let n=Kd(t);return e.clientX>=n.left-Wd&&e.clientX<=n.right+Wd&&e.clientY>=n.top-Wd&&e.clientY<=n.bottom+Wd}function Kd(e){let t=e.getBoundingClientRect(),n=Nt(e);if(na)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function qd(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=nn(),{ref:i,index:a}=dt(e),o=n===a,s=u.useRef(null),c=U(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Jd(e){let{render:t,className:n,style:r,state:i=k,props:a=O,refs:o=O,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=qd({metadata:s});return q(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Yd(e){if(It(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Jt(e))return Yd(Zt(e))}function Xd(e,t){let n=u.useRef(null);function r(t){f.flushSync(()=>{e.setOpen(!1,J(Je,t.nativeEvent,t.currentTarget))}),rs(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&is(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{f.flushSync(()=>{e.setOpen(!1,J(Je,n.nativeEvent,n.currentTarget))});let i=ns(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&$(r,i);){let e=i;if(i=$o(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Zd(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=u.useRef(!1);return u.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,X(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:k,[t,n,r])}var Qd=yl(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:f=0,handle:p,payload:m,...h}=e,g=wi(!0),_=ru(p)??g?.store;if(!_)throw Error(process.env.NODE_ENV===`production`?V(85):`Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.`);let v=Be(s),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerPopupId`,v),w=u.useRef(null),T=ef(),E=nn(!0),D=zs(),O=u.useMemo(()=>D??new Fs,[D]),{registerTrigger:A,isMountedByThisTrigger:j}=Hl(v,w,_,{payload:m,closeDelay:f,parent:T,floatingTreeRoot:O,floatingNodeId:Bs(O),floatingParentNodeId:Rs(),keyboardEventRelay:E?.relayKeyboardEvent}),M=T.type===`menubar`,N=_.useState(`disabled`),P=a||N||M&&T.context.disabled,{getButtonProps:F,buttonRef:I}=on({disabled:P,native:o});u.useEffect(()=>{!x&&T.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,x,T.type]);let L=u.useRef(null),R=va(),z=C(e=>{if(!L.current)return;R.clear(),_.context.allowMouseUpTriggerRef.current=!1;let t=e.target;$(L.current,t)||$(_.select(`positionerElement`),t)||t===L.current||(t==null||Yd(t)!==_.select(`rootId`))&&(Gd(e,L.current)||O.events.emit(`close`,{domEvent:e,reason:Ze}))});u.useEffect(()=>{x&&_.select(`lastOpenChangeReason`)===`trigger-hover`&&X(L.current).addEventListener(`mouseup`,z,{once:!0})},[x,z,_]);let B=M&&T.context.hasSubmenuOpen,ee=hu(b,{enabled:(c??B)&&!P&&(!M||B&&!j),handleClose:Mu({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:T.type===void 0?l:void 0,delay:{close:f},triggerElementRef:w,externalTree:O,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),H=$d(x,_.select(`lastOpenChangeReason`)),U=Qs(b,{enabled:!P,event:x&&M?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0&&H}),te=su(b,{enabled:!P&&B}),ne=Zd({open:x,enabled:M,mouseDownAction:`open`}),re=u.useMemo(()=>de(te.reference,U.reference),[te.reference,U.reference]),ie=_.useState(`triggerProps`,j),{preFocusGuardRef:W,handlePreFocusGuardFocus:ae,handleFocusTargetFocus:G}=Xd(_,w),K={disabled:P,open:x},oe=[L,t,I,A,w],se=[re,ee??k,ie,{"aria-haspopup":`menu`,"aria-controls":S,id:v,onMouseDown:e=>{_.select(`open`)||(R.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),X(e.currentTarget).addEventListener(`mouseup`,z,{once:!0}))}},M?{role:`menuitem`}:{},ne,h,F],ce=q(`button`,e,{enabled:!M,stateAttributesMapping:Ii,state:K,ref:oe,props:se});return M?(0,d.jsx)(Jd,{tag:`button`,render:n,className:r,style:i,state:K,refs:oe,props:se,stateAttributesMapping:Ii}):x?(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(eo,{ref:W,onFocus:ae},`${v}-pre-focus-guard`),(0,d.jsx)(u.Fragment,{children:ce},v),(0,d.jsx)(eo,{ref:_.context.triggerFocusTargetRef,onFocus:G},`${v}-post-focus-guard`)]}):(0,d.jsx)(u.Fragment,{children:ce},v)});process.env.NODE_ENV!==`production`&&(Qd.displayName=`MenuTrigger`);function $d(e,t){let n=va(),[r,i]=u.useState(!1);return A(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function ef(){let e=Ad(!0);return u.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var tf=u.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return q(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});process.env.NODE_ENV!==`production`&&(tf.displayName=`Separator`);function nf(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var rf={"aria-expanded":void 0},af=u.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:d=0,disabled:f=!1,...p}=e,m=Bd();if(!m?.parentMenu)throw Error(process.env.NODE_ENV===`production`?V(37):`Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.`);let h=dt({guess:!0,label:a}),g=Si(),{store:_}=wi(),y=Be(o),b=_.useState(`open`),x=_.useState(`floatingRootContext`),S=_.useState(`floatingTreeRoot`),w=_.useState(`triggerPopupId`,y),T=Rl(y,_),D=C(e=>{T(e),e!==null&&_.select(`open`)&&_.select(`activeTriggerId`)==null&&_.update({activeTriggerId:y??null,activeTriggerElement:e,closeDelay:d})}),O=u.useRef(null),j=u.useCallback(e=>{O.current=e,_.set(`activeTriggerElement`,e)},[_]);A(()=>(D(O.current),()=>D(null)),[D,y,_]),_.useSyncedValue(`closeDelay`,d);let M=m.parentMenu,N=_.useState(`disabled`),P=M.useState(`disabled`),F=f||N||P;process.env.NODE_ENV!==`production`&&u.useEffect(()=>{let e=O.current;e&&nf(e)&&!F&&E(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${v.captureOwnerStack?.()||``}`)});let I=M.useState(`itemProps`),L=M.useState(`isActive`,h.index),R=u.useMemo(()=>({type:`submenu-trigger`,setActive(){M.select(`highlightItemOnHover`)&&M.set(`activeIndex`,h.index)}}),[M,h.index]),{getItemProps:z,itemRef:B}=aa({closeOnClick:!1,disabled:F,highlighted:L,id:y,store:_,typingRef:M.context.typingRef,nativeButton:s,itemMetadata:R,nodeId:g?.context.nodeId}),ee=hu(x,{enabled:_.useState(`hoverEnabled`)&&c&&!F,handleClose:Mu({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:d},shouldOpen:l>0?()=>M.select(`allowMouseEnter`):void 0,triggerElementRef:O,externalTree:S,isClosing:()=>_.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),H=Qs(x,{enabled:!F,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??k,U=_.useState(`triggerProps`,!0);delete U.id;let te={disabled:F,highlighted:L,open:b},ne=_.useState(`openMethod`),re=_.useState(`lastOpenChangeReason`)===`list-navigation`||ne===`keyboard`;return q(`div`,e,{state:te,stateAttributesMapping:Fi,props:[H,ee,U,I,b&&re&&ta?rf:void 0,{"aria-controls":w,tabIndex:b||L?0:-1,onBlur(){L&&M.set(`activeIndex`,null)}},p,z],ref:[t,h.ref,B,D,j]})});process.env.NODE_ENV!==`production`&&(af.displayName=`MenuSubmenuTrigger`);function of({...e}){return(0,d.jsx)(Vd,{"data-slot":`dropdown-menu`,...e})}function sf({...e}){return(0,d.jsx)(Bu,{"data-slot":`dropdown-menu-portal`,...e})}function cf({...e}){return(0,d.jsx)(Qd,{"data-slot":`dropdown-menu-trigger`,...e})}function lf({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,d.jsx)(Bu,{children:(0,d.jsx)(xd,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,d.jsx)(Lu,{"data-slot":`dropdown-menu-content`,className:Q(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function uf({...e}){return(0,d.jsx)(pa,{"data-slot":`dropdown-menu-group`,...e})}function df({className:e,inset:t,...n}){return(0,d.jsx)(ma,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:Q(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function ff({className:e,inset:t,variant:n=`default`,...r}){return(0,d.jsx)(ha,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function pf({...e}){return(0,d.jsx)(Ud,{"data-slot":`dropdown-menu-sub`,...e})}function mf({className:e,inset:t,children:n,...r}){return(0,d.jsxs)(af,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:Q(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,d.jsx)(Fr,{className:`ml-auto`})]})}function hf({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,d.jsx)(lf,{"data-slot":`dropdown-menu-sub-content`,className:Q(`w-auto min-w-24 rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function gf({className:e,children:t,checked:n,inset:r,...i}){return(0,d.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:Q(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,d.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,d.jsx)(ua,{children:(0,d.jsx)(jr,{})})}),t]})}function _f({...e}){return(0,d.jsx)(wd,{"data-slot":`dropdown-menu-radio-group`,...e})}function vf({className:e,children:t,inset:n,...r}){return(0,d.jsxs)(Dd,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:Q(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,d.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,d.jsx)(Od,{children:(0,d.jsx)(jr,{})})}),t]})}function yf({className:e,...t}){return(0,d.jsx)(tf,{"data-slot":`dropdown-menu-separator`,className:Q(`-mx-1 my-1 h-px bg-border`,e),...t})}function bf({className:e,...t}){return(0,d.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:Q(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}var xf=`data-valid`,Sf=`data-invalid`,Cf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},wf={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Tf={valid(e){return e===null?null:e?{[xf]:``}:{[Sf]:``}}},Ef={invalid:void 0,name:void 0,validityData:{state:Cf,errors:[],error:``,value:``,initialValue:null},setValidityData:D,disabled:void 0,setTouched:D,setDirty:D,setFilled:D,setFocused:D,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:wf,registerFieldControl:D,validation:{getValidationProps:(e,t=k)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:D,getInputControl:()=>null,commit:async()=>{},change:D}},Df=u.createContext(Ef);process.env.NODE_ENV!==`production`&&(Df.displayName=`FieldRootContext`);function Of(e=!0){let t=u.useContext(Df);if(t.setValidityData===D&&!e)throw Error(process.env.NODE_ENV===`production`?V(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return t}var kf=u.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:D,validationMode:`onSubmit`,submitCountRef:{current:0}});process.env.NODE_ENV!==`production`&&(kf.displayName=`FormContext`);function Af(){return u.useContext(kf)}var jf=u.createContext({controlId:void 0,registerControlId:D,resetControlId:D,labelId:void 0,setLabelId:D,messageIds:[],setMessageIds:D,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(jf.displayName=`LabelableContext`);function Mf(){return u.useContext(jf)}function Nf(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Mf(),o=Be(),s=b(()=>Symbol()),c=u.useRef(!1),l=u.useRef(!1),d=C(()=>{c.current&&i!==D&&(c.current=!1,i(s.current,void 0))});return A(()=>{if(!n||i===D){d();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){d();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,d]),A(()=>d,[d]),(n?r:void 0)??t??o}function Pf(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Of(),s=b(()=>Symbol());A(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),A(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ff=u.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:_,setTouched:v,setDirty:y,validityData:b,setFocused:x,setFilled:S,validationMode:w,validation:T}=Of(),{clearErrors:E,elementRef:D,submitCountRef:O}=Af(),k=_||s,j=h??a,M={...m,disabled:k},{labelId:N}=Mf(),P=Nf({id:i}),[F]=g({controlled:o,default:l,name:`FieldControl`,state:`value`}),I=o!==void 0,L=I?F:void 0,R=L==null?void 0:String(L),z=C(()=>T.inputRef.current?.value);Pf(T.inputRef,P,R,z,!k,a),A(()=>{let e=R??T.inputRef.current?.value;e!==void 0&&S(e!==``)},[R,T.inputRef,S]),Md(R,()=>{R!==void 0&&(E(j),y(R!==(b.initialValue??``)),T.change(R))});let B=u.useRef(null),V=va();return A(()=>{d&&B.current===Ta(X(B.current))&&x(!0)},[d,x]),q(`input`,e,{ref:[t,B],state:M,props:[{id:P,disabled:k,name:j,ref:T.inputRef,"aria-labelledby":N,autoFocus:d,...I?{value:L}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=J(Ve,e.nativeEvent);c?.(t,n),!I&&(y(t!==(b.initialValue??``)),S(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(E(j),T.change(t)))},onFocus(){x(!0)},onBlur(e){if(v(!0),x(!1),w===`onBlur`){let t=e.currentTarget.value;T.commit(t),I&&queueMicrotask(()=>{let e=T.inputRef.current?.value;e!==void 0&&e!==t&&e!==(b.initialValue??``)&&T.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){v(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===D.current&&!e.defaultPrevented){let t=e.currentTarget,n=O.current;V.start(0,()=>{O.current===n&&T.commit(t.value)})}else T.commit(t)}}},p,e=>T.getValidationProps(k,e)],stateAttributesMapping:Tf})});process.env.NODE_ENV!==`production`&&(Ff.displayName=`FieldControl`);var If=u.forwardRef(function(e,t){return(0,d.jsx)(Ff,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(If.displayName=`Input`);function Lf({className:e,type:t,...n}){return(0,d.jsx)(If,{type:t,"data-slot":`input`,className:Q(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}var Rf=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Rf.displayName=`PopoverRootContext`);function zf(e){let t=u.useContext(Rf);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(47):`Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.`);return t}var Bf={...nu,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Vf=class extends kl{constructor(e,t,n){let r=new Yl;super(Hf(e,r,t,n),Uf(r),Bf)}setOpen=(e,t)=>{let n=t.reason===Ue,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Bl(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=zl(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),f.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Hf(e,t,n,r=!1){let i={...Xl(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Uf(e){return{popupRef:u.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:u.createRef(),beforeContentFocusGuardRef:u.createRef(),stickIfOpenTimeout:new _a,triggerElements:e}}var Wf=vl(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,f=Kf(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,c);let p=f.useState(`open`),m=f.useState(`mounted`),h=f.useState(`payload`);f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a),Kl(f,p),Ul(f);let{forceUnmount:g}=Wl(p,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null})});f.useSyncedValues({modal:o}),u.useEffect(()=>{p||f.context.stickIfOpenTimeout.clear()},[f,p]),u.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>f.setOpen(!1,J(et))}),[g,f]);let _=p||m;return(0,d.jsxs)(Rf.Provider,{value:f,children:[s&&(0,d.jsx)(Il,{handle:s,store:f}),_&&(0,d.jsx)(qf,{store:f,modal:o}),typeof t==`function`?t({payload:h}):t]})});process.env.NODE_ENV!==`production`&&(Wf.displayName=`PopoverRootComponent`);function Gf(e){return zf(!0)?(0,d.jsx)(Wf,{props:e}):(0,d.jsx)(Hs,{children:(0,d.jsx)(Wf,{props:e})})}function Kf(e,t){let n=Fl((e,n)=>new Vf(t,e,n));return u.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function qf({store:e,modal:t}){let n=ic(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Gl(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var Jf=yl(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:f=300,closeDelay:p=0,id:m,...h}=e,g=zf(!0),_=ru(s)??g;if(!_)throw Error(process.env.NODE_ENV===`production`?V(74):`Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.`);let v=Be(m),y=_.useState(`isTriggerActive`,v),b=_.useState(`floatingRootContext`),x=_.useState(`isOpenedByTrigger`,v),S=_.useState(`triggerPopupId`,v),C=u.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Hl(v,C,_,{payload:c,disabled:a,openOnHover:l,closeDelay:p}),E=_.useState(`openChangeReason`),D=_.useState(`stickIfOpen`),O=_.useState(`openMethod`),k=_.useState(`focusManagerModal`),A=hu(b,{enabled:!a&&l&&(O!==`touch`||E!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Mu(),restMs:f,delay:{close:p},triggerElementRef:C,isActiveTrigger:y,isClosing:()=>_.select(`transitionStatus`)===`ending`}),j=Qs(b,{stickIfOpen:D}),M=Nd(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),N=_.useState(`triggerProps`,T),{getButtonProps:P,buttonRef:F}=on({disabled:a,native:o}),I={open(e){return e&&E===`trigger-press`?Ii.open(e):Fi.open(e)}},{preFocusGuardRef:L,handlePreFocusGuardFocus:R,handleFocusTargetFocus:z}=Xd(_,C),B=q(`button`,e,{state:{disabled:a,open:x},ref:[F,t,w,C],props:[j.reference,A,N,M,{[Ts]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":S},h,P],stateAttributesMapping:I}),ee=(0,d.jsx)(u.Fragment,{children:B},v);return T&&!k?(0,d.jsxs)(u.Fragment,{children:[(0,d.jsx)(eo,{ref:L,onFocus:R}),ee,(0,d.jsx)(eo,{ref:_.context.triggerFocusTargetRef,onFocus:z})]}):ee});process.env.NODE_ENV!==`production`&&(Jf.displayName=`PopoverTrigger`);var Yf=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Yf.displayName=`PopoverPortalContext`);function Xf(){let e=u.useContext(Yf);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(45):`Base UI: <Popover.Portal> is missing.`);return e}var Zf=u.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return zf().useState(`mounted`)||n?(0,d.jsx)(Yf.Provider,{value:n,children:(0,d.jsx)(Ns,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(Zf.displayName=`PopoverPortal`);var Qf=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(Qf.displayName=`PopoverPositionerContext`);function $f(){let e=u.useContext(Qf);if(!e)throw Error(process.env.NODE_ENV===`production`?V(46):`Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.`);return e}var ep=u.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:f,collisionBoundary:p=`clipping-ancestors`,collisionPadding:m,arrowPadding:h,sticky:g,disableAnchorTracking:_=!1,collisionAvoidance:v=Ds,...y}=e,b=zf(),x=Xf(),S=Bs(),C=b.useState(`floatingRootContext`),w=b.useState(`mounted`),T=b.useState(`open`),E=b.useState(`openChangeReason`),D=b.useState(`activeTriggerElement`),O=b.useState(`modal`),k=b.useState(`openMethod`),j=b.useState(`positionerElement`),M=b.useState(`instantType`),N=b.useState(`transitionStatus`),P=b.useState(`adaptiveOrigin`),F=u.useRef(null),I=hn(j),L=rd({anchor:a,floatingRootContext:C,positionMethod:o,mounted:w,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:g,disableAnchorTracking:_,keepMounted:x,nodeId:S,collisionAvoidance:v,adaptiveOrigin:P}),R=C.useState(`domReferenceElement`);A(()=>{let e=R,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){b.set(`instantType`,void 0);let e=new AbortController;return I(()=>{b.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[R,I,b]);let z=O===!0&&E!==`trigger-hover`;bd(T&&z,k===`touch`,j,D);let B=b.useStateSetter(`positionerElement`),V=sd(e,{open:T,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:M},{styles:L.positionerStyles,transitionStatus:N,props:y,refs:[t,B],hidden:!w,inert:!T});return(0,d.jsxs)(Qf.Provider,{value:L,children:[w&&z&&(0,d.jsx)(od,{inert:Vu(!T),cutout:D}),(0,d.jsx)(Vs,{id:S,children:V})]})});process.env.NODE_ENV!==`production`&&(ep.displayName=`PopoverPositioner`);var tp=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(tp.displayName=`ClosePartContext`);function np(){let[e,t]=u.useState(0),n=C(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:u.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var rp=u.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=zf(),l=$f(),u=Pu(!0)!=null,{context:f,hasClosePart:p}=np(),m=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);gn({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),pu(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Pl(c.context.popupRef):a,j=x!==!1&&p;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=q(`div`,e,{state:{open:m,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...Nl,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&Fu.has(e.key)&&e.stopPropagation()}},Iu(_),s],stateAttributesMapping:Ri});return(0,d.jsx)(Zs,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:It(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,d.jsx)(tp.Provider,{value:f,children:N})})});process.env.NODE_ENV!==`production`&&(rp.displayName=`PopoverPopup`);var ip=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=zf(),s=Be(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),q(`h2`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(ip.displayName=`PopoverTitle`);var ap=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=zf(),s=Be(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),q(`p`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(ap.displayName=`PopoverDescription`);function op({...e}){return(0,d.jsx)(Gf,{"data-slot":`popover`,...e})}function sp({...e}){return(0,d.jsx)(Jf,{"data-slot":`popover-trigger`,...e})}function cp({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,d.jsx)(Zf,{children:(0,d.jsx)(ep,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,d.jsx)(rp,{"data-slot":`popover-content`,className:Q(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function lp({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`popover-header`,className:Q(`flex flex-col gap-1 text-sm`,e),...t})}function up({className:e,...t}){return(0,d.jsx)(ip,{"data-slot":`popover-title`,className:Q(`font-medium`,e),...t})}function dp({className:e,...t}){return(0,d.jsx)(ap,{"data-slot":`popover-description`,className:Q(`text-muted-foreground`,e),...t})}function fp({className:e,orientation:t=`horizontal`,...n}){return(0,d.jsx)(tf,{"data-slot":`separator`,orientation:t,className:Q(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var pp=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(pp.displayName=`DialogRootContext`);function mp(e){let t=u.useContext(pp);if(!e&&t===void 0)throw Error(process.env.NODE_ENV===`production`?V(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return t}var hp=u.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=mp(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return q(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Ri,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});process.env.NODE_ENV!==`production`&&(hp.displayName=`DialogBackdrop`);var gp=u.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=mp(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=on({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,J(qe,e.nativeEvent))}return q(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})});process.env.NODE_ENV!==`production`&&(gp.displayName=`DialogClose`);var _p=u.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=mp(),c=Be(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),q(`p`,e,{ref:t,props:[{id:c},o]})});process.env.NODE_ENV!==`production`&&(_p.displayName=`DialogDescription`);var vp=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(vp.displayName=`DialogPortalContext`);function yp(){let e=u.useContext(vp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(26):`Base UI: <Dialog.Portal> is missing.`);return e}var bp=`--nested-dialogs`,xp=`data-nested-dialog-open`,Sp={...Li,...vt,nestedDialogOpen(e){return e?{[xp]:``}:null}},Cp=u.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=mp(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),f=c.useState(`floatingRootContext`),p=c.useState(`popupProps`),m=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=f.useState(`floatingId`);yp(),gn({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?Pl(c.context.popupRef):o,T=_>0,E=c.useStateSetter(`popupElement`),D=q(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[p,{id:C,"aria-labelledby":b,"aria-describedby":l,role:S,...Nl,hidden:!h,onKeyDown(e){Fu.has(e.key)&&e.stopPropagation()},style:{[bp]:_}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:Sp});return(0,d.jsx)(Zs,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:D})});process.env.NODE_ENV!==`production`&&(Cp.displayName=`DialogPopup`);var wp=u.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=mp(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,d.jsx)(vp.Provider,{value:n,children:(0,d.jsxs)(Ns,{ref:t,...r,children:[a&&o===!0&&(0,d.jsx)(od,{ref:i.context.internalBackdropRef,inert:Vu(!s)}),e.children]})}):null});process.env.NODE_ENV!==`production`&&(wp.displayName=`DialogPortal`);function Tp({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=u.useState(0),[d,f]=u.useState(0),p=c===0,m=ic(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Ea(t);if(p&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||$(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return vd(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),f(t)}),A(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,d+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,d,t]),Gl(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}var Ep={...nu,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Dp=class extends kl{constructor(e,t,n){let r=new Yl,i=Op(e,r,t,n);super(i,kp(r),Ep)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(zl(this.state,e,t.trigger)))}};function Op(e,t,n,r=!1){return{...Xl(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function kp(e){return{popupRef:u.createRef(),backdropRef:u.createRef(),internalBackdropRef:u.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Ap(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:f,triggerId:p,defaultTriggerId:m=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:c,v=g||s,y=g?`alertdialog`:`dialog`,b=mp(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=Fl((e,t)=>new Dp({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,p),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,a),S.useContextCallback(`onOpenChangeComplete`,o);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);Kl(S,C),Ul(S);let{forceUnmount:E}=Wl(C,S);u.useImperativeHandle(l,()=>({unmount:E,close:()=>S.setOpen(!1,J(et))}),[E,S]);let D=C||w;return(0,d.jsxs)(pp.Provider,{value:S,children:[f&&(0,d.jsx)(Il,{handle:f,store:S}),D&&(0,d.jsx)(Tp,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var jp=vl(function(e){return Ap(`dialog`,e)});process.env.NODE_ENV!==`production`&&(jp.displayName=`DialogRoot`);var Mp=u.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=mp(),c=Be(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),q(`h2`,e,{ref:t,props:[{id:c},o]})});process.env.NODE_ENV!==`production`&&(Mp.displayName=`DialogTitle`);var Np=yl(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...d}=e,f=mp(!0),p=ru(l)??f;if(!p)throw Error(process.env.NODE_ENV===`production`?V(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let m=Be(s),h=p.useState(`floatingRootContext`),g=p.useState(`isOpenedByTrigger`,m),_=p.useState(`triggerPopupId`,m),v=u.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Hl(m,v,p,{payload:c}),{getButtonProps:x,buttonRef:S}=on({disabled:a,native:o}),C=Qs(h),w=Nd(()=>p.select(`open`),e=>{p.set(`openMethod`,e)}),T={disabled:a,open:g},E=p.useState(`triggerProps`,b);return q(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[Ts]:``,id:m,"aria-haspopup":`dialog`,"aria-expanded":g,"aria-controls":_},d,x],stateAttributesMapping:Fi})});process.env.NODE_ENV!==`production`&&(Np.displayName=`DialogTrigger`);function Pp({...e}){return(0,d.jsx)(jp,{"data-slot":`sheet`,...e})}function Fp({...e}){return(0,d.jsx)(Np,{"data-slot":`sheet-trigger`,...e})}function Ip({...e}){return(0,d.jsx)(gp,{"data-slot":`sheet-close`,...e})}function Lp({...e}){return(0,d.jsx)(wp,{"data-slot":`sheet-portal`,...e})}function Rp({className:e,...t}){return(0,d.jsx)(hp,{"data-slot":`sheet-overlay`,className:Q(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function zp({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,d.jsxs)(Lp,{children:[(0,d.jsx)(Rp,{}),(0,d.jsxs)(Cp,{"data-slot":`sheet-content`,"data-side":n,className:Q(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,d.jsxs)(gp,{"data-slot":`sheet-close`,render:(0,d.jsx)(pi,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,d.jsx)(qr,{}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Bp({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sheet-header`,className:Q(`flex flex-col gap-1.5 p-4`,e),...t})}function Vp({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sheet-footer`,className:Q(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function Hp({className:e,...t}){return(0,d.jsx)(Mp,{"data-slot":`sheet-title`,className:Q(`font-heading font-medium text-foreground`,e),...t})}function Up({className:e,...t}){return(0,d.jsx)(_p,{"data-slot":`sheet-description`,className:Q(`text-sm text-muted-foreground`,e),...t})}var Wp=768;function Gp(){let[e,t]=l.useState(void 0);return l.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Wp)};return e.addEventListener(`change`,n),t(window.innerWidth<Wp),()=>e.removeEventListener(`change`,n)},[]),!!e}function Kp({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`skeleton`,className:Q(`animate-pulse rounded-md bg-muted`,e),...t})}var qp=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(qp.displayName=`TooltipRootContext`);function Jp(e){let t=u.useContext(qp);if(t===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?V(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}var Yp={...nu,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Xp=class extends kl{constructor(e,t,n){let r=new Yl;super(Zp(e,r,t,n),Qp(r),Yp)}setOpen=(e,t)=>{Vl(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,J(He,e))}};function Zp(e,t,n,r=!1){return{...Xl(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Qp(e){return{popupRef:u.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var $p=vl(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:f,defaultTriggerId:p=null,children:m}=e,h=Fl((e,t)=>new Xp({open:n,openProp:r,activeTriggerId:p,triggerIdProp:f},e,t));h.useControlledProp(`openProp`,r),h.useControlledProp(`triggerIdProp`,f),h.useContextCallback(`onOpenChange`,s),h.useContextCallback(`onOpenChangeComplete`,c);let g=h.useState(`open`),_=!t&&g,v=h.useState(`activeTriggerId`),y=h.useState(`mounted`),b=h.useState(`payload`);h.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Ul(h,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:x,transitionStatus:S}=Wl(_,h),C=h.useState(`isInstantPhase`),w=h.useState(`instantType`),T=h.useState(`lastOpenChangeReason`),E=u.useRef(null);A(()=>{g&&t&&h.setOpen(!1,J($e))},[g,t,h]),A(()=>{S===`ending`&&T===`none`||S!==`ending`&&C?(w!==`delay`&&(E.current=w),h.set(`instantType`,`delay`)):E.current!==null&&(h.set(`instantType`,E.current),E.current=null)},[S,C,T,w,h]),A(()=>{_&&(v??h.set(`payload`,void 0))},[h,v,_]),u.useImperativeHandle(o,()=>({unmount:x,close:()=>h.setOpen(!1,J(et))}),[x,h]);let D=_||y||!t&&a!==`none`;return(0,d.jsxs)(qp.Provider,{value:h,children:[l&&(0,d.jsx)(Il,{handle:l,store:h}),D&&(0,d.jsx)(em,{store:h,disabled:t,trackCursorAxis:a}),typeof m==`function`?m({payload:b}):m]})});process.env.NODE_ENV!==`production`&&($p.displayName=`TooltipRoot`);function em({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ic(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=tc(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=u.useMemo(()=>de(a.reference,i.reference),[a.reference,i.reference]);return Gl(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??k}),null}var tm=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(tm.displayName=`TooltipProviderContext`);function nm(){return u.useContext(tm)}var rm=`data-base-ui-tooltip-trigger`;function im(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(Y(n))return n}}let t=e.target;return Y(t)?t:null}function am(e){let t=e;for(;t;){let e=t.closest(`[${rm}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&Y(n.host)?n.host:null}return null}var om=yl(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:d,id:f,...p}=e,m=Jp(!0),h=ru(a)??m;if(!h)throw Error(process.env.NODE_ENV===`production`?V(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let g=Be(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=u.useRef(null),x=d??0,{registerTrigger:S,isMountedByThisTrigger:C}=Hl(g,b,h,{payload:o,closeOnClick:l,closeDelay:x}),w=nm(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=Xa(y,{open:v}),k=fu(y);h.useSyncedValue(`isInstantPhase`,D);let A=h.useState(`disabled`),j=s??A,M=un(j),N=h.useState(`trackCursorAxis`),P=h.useState(`disableHoverablePopup`),F=u.useRef(!1),I=va(),L=u.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=am(e);return n!==null&&n!==t&&$(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let ee=hu(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Mu():null,restMs:R,delay(){return d==null&&O?{close:Ua(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=su(y,{enabled:!j}).reference,U=e=>{let t=F.current,n=im(e),r=B(n),i=b.current,a=i&&n&&$(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,J(Ue,e));return}if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&Ca(L.current)){let t=()=>{!F.current&&!M.current&&!h.select(`open`)&&h.setOpen(!0,J(Ue,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},te=h.useState(`triggerProps`,C);return q(`button`,e,{state:{open:v},ref:[t,S,b],props:[ee,H,C||N!==`none`?te:void 0,{onMouseOver(e){U(e.nativeEvent)},onFocus(e){z(im(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[Na]:j?``:void 0,[rm]:j?void 0:``},p],stateAttributesMapping:Fi})});process.env.NODE_ENV!==`production`&&(om.displayName=`TooltipTrigger`);var sm=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(sm.displayName=`TooltipPortalContext`);function cm(){let e=u.useContext(sm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(70):`Base UI: <Tooltip.Portal> is missing.`);return e}var lm=u.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Ms({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,d.jsxs)(u.Fragment,{children:[l,c&&f.createPortal(n,c)]})});process.env.NODE_ENV!==`production`&&(lm.displayName=`FloatingPortalLite`);var um=u.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Jp().useState(`mounted`)||n?(0,d.jsx)(sm.Provider,{value:n,children:(0,d.jsx)(lm,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(um.displayName=`TooltipPortal`);var dm=u.createContext(void 0);process.env.NODE_ENV!==`production`&&(dm.displayName=`TooltipPositionerContext`);function fm(){let e=u.useContext(dm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?V(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}var pm=u.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=Ds,style:v,...y}=e,b=Jp(),x=cm(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`trackCursorAxis`),T=b.useState(`disableHoverablePopup`),E=b.useState(`floatingRootContext`),D=b.useState(`instantType`),O=b.useState(`transitionStatus`),k=rd({anchor:i,positionMethod:a,floatingRootContext:E,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:f,collisionPadding:p,sticky:h,arrowPadding:m,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:_,adaptiveOrigin:b.useState(`adaptiveOrigin`)}),A=sd(e,u.useMemo(()=>({open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:w===`none`?D:`tracking-cursor`}),[S,k.side,k.align,k.anchorHidden,w,D]),{styles:k.positionerStyles,transitionStatus:O,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,d.jsx)(dm.Provider,{value:k,children:A})});process.env.NODE_ENV!==`production`&&(pm.displayName=`TooltipPositioner`);var mm=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Jp(),{side:s,align:c}=fm(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);gn({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),pu(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return q(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Nl,f,Iu(d),a],stateAttributesMapping:Ri})});process.env.NODE_ENV!==`production`&&(mm.displayName=`TooltipPopup`);var hm=u.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Jp(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=fm();return q(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Li})});process.env.NODE_ENV!==`production`&&(hm.displayName=`TooltipArrow`);var gm=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=u.useMemo(()=>({open:t,close:n}),[t,n]);return(0,d.jsx)(tm.Provider,{value:t,children:(0,d.jsx)(Ya,{delay:i,timeoutMs:r,children:e.children})})};process.env.NODE_ENV!==`production`&&(gm.displayName=`TooltipProvider`);function _m({delay:e=0,...t}){return(0,d.jsx)(gm,{"data-slot":`tooltip-provider`,delay:e,...t})}function vm({...e}){return(0,d.jsx)($p,{"data-slot":`tooltip`,...e})}function ym({...e}){return(0,d.jsx)(om,{"data-slot":`tooltip-trigger`,...e})}function bm({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,d.jsx)(um,{children:(0,d.jsx)(pm,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,d.jsxs)(mm,{"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,d.jsx)(hm,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var xm=`sidebar_state`,Sm=604800,Cm=`16rem`,wm=`18rem`,Tm=`3rem`,Em=`b`,Dm=u.createContext(null);function Om(){let e=u.useContext(Dm);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function km({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=Gp(),[c,l]=u.useState(!1),[f,p]=u.useState(e),m=t??f,h=u.useCallback(e=>{let t=typeof e==`function`?e(m):e;n?n(t):p(t),document.cookie=`${xm}=${t}; path=/; max-age=${Sm}`},[n,m]),g=u.useCallback(()=>s?l(e=>!e):h(e=>!e),[s,h,l]);u.useEffect(()=>{let e=e=>{e.key===Em&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let _=m?`expanded`:`collapsed`,v=u.useMemo(()=>({state:_,open:m,setOpen:h,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:g}),[_,m,h,s,c,l,g]);return(0,d.jsx)(Dm.Provider,{value:v,children:(0,d.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Cm,"--sidebar-width-icon":Tm,...i},className:Q(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function Am({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Om();return n===`none`?(0,d.jsx)(`div`,{"data-slot":`sidebar`,className:Q(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,d.jsx)(Pp,{open:l,onOpenChange:u,...o,children:(0,d.jsxs)(zp,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":wm},side:e,children:[(0,d.jsxs)(Bp,{className:`sr-only`,children:[(0,d.jsx)(Hp,{children:`Sidebar`}),(0,d.jsx)(Up,{children:`Displays the mobile sidebar.`})]}),(0,d.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,d.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,d.jsx)(`div`,{"data-slot":`sidebar-gap`,className:Q(`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)`)}),(0,d.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:Q(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:-left-(--sidebar-width) data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:-right-(--sidebar-width) md:flex`,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),...o,children:(0,d.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function jm({className:e,onClick:t,...n}){let{toggleSidebar:r}=Om();return(0,d.jsxs)(pi,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:Q(e),onClick:e=>{t?.(e),r()},...n,children:[(0,d.jsx)(Ur,{}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Mm({className:e,...t}){let{toggleSidebar:n}=Om();return(0,d.jsx)(`button`,{"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:n,title:`Toggle Sidebar`,className:Q(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:inset-s-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})}function Nm({className:e,...t}){return(0,d.jsx)(`main`,{"data-slot":`sidebar-inset`,className:Q(`relative flex w-full flex-1 flex-col bg-background 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 Pm({className:e,...t}){return(0,d.jsx)(Lf,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:Q(`h-8 w-full bg-background shadow-none`,e),...t})}function Fm({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:Q(`flex flex-col gap-2 p-2`,e),...t})}function Im({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:Q(`flex flex-col gap-2 p-2`,e),...t})}function Lm({className:e,...t}){return(0,d.jsx)(fp,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:Q(`mx-2 w-auto bg-sidebar-border`,e),...t})}function Rm({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:Q(`no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function zm({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:Q(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function Bm({className:e,render:t,...n}){return Qr({defaultTagName:`div`,props:de({className:Q(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function Vm({className:e,render:t,...n}){return Qr({defaultTagName:`button`,props:de({className:Q(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-action`,sidebar:`group-action`}})}function Hm({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:Q(`w-full text-sm`,e),...t})}function Um({className:e,...t}){return(0,d.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:Q(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function Wm({className:e,...t}){return(0,d.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:Q(`group/menu-item relative`,e),...t})}var Gm=di(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_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 Km({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=Om(),l=Qr({defaultTagName:`button`,props:de({className:Q(Gm({variant:n,size:r}),a)},o),render:i?(0,d.jsx)(ym,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,d.jsxs)(vm,{children:[l,(0,d.jsx)(bm,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function qm({className:e,render:t,showOnHover:n=!1,...r}){return Qr({defaultTagName:`button`,props:de({className:Q(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,e)},r),render:t,state:{slot:`sidebar-menu-action`,sidebar:`menu-action`}})}function Jm({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:Q(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function Ym({className:e,showIcon:t=!1,...n}){let[r]=u.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,d.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:Q(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,d.jsx)(Kp,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,d.jsx)(Kp,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}function Xm({className:e,...t}){return(0,d.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:Q(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,e),...t})}function Zm({className:e,...t}){return(0,d.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:Q(`group/menu-sub-item relative`,e),...t})}function Qm({render:e,size:t=`md`,isActive:n=!1,className:r,...i}){return Qr({defaultTagName:`a`,props:de({className:Q(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,r)},i),render:e,state:{slot:`sidebar-menu-sub-button`,sidebar:`menu-sub-button`,size:t,active:n}})}var $m=(0,u.createContext)({theme:`system`,setTheme:()=>null});function eh({children:e,defaultTheme:t=`system`,storageKey:n=`vite-ui-theme`,...r}){let[i,a]=(0,u.useState)(()=>localStorage.getItem(n)||t);(0,u.useEffect)(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),i===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(i)},[i]);let o={theme:i,setTheme:e=>{localStorage.setItem(n,e),a(e)}};return(0,d.jsx)($m.Provider,{...r,value:o,children:e})}var th=()=>{let e=(0,u.useContext)($m);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function nh(){let{setTheme:e}=th();return(0,d.jsxs)(of,{children:[(0,d.jsxs)(cf,{render:(0,d.jsx)(pi,{variant:`outline`}),children:[(0,d.jsx)(Gr,{className:`h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90`}),(0,d.jsx)(Vr,{className:`absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0`}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle theme`})]}),(0,d.jsxs)(lf,{align:`end`,children:[(0,d.jsx)(ff,{onClick:()=>e(`light`),children:`Claro`}),(0,d.jsx)(ff,{onClick:()=>e(`dark`),children:`Escuro`}),(0,d.jsx)(ff,{onClick:()=>e(`system`),children:`Sistema`})]})]})}exports.Accordion=Jr,exports.AccordionContent=Zr,exports.AccordionItem=Yr,exports.AccordionTrigger=Xr,exports.Breadcrumb=$r,exports.BreadcrumbEllipsis=ai,exports.BreadcrumbItem=ti,exports.BreadcrumbLink=ni,exports.BreadcrumbList=ei,exports.BreadcrumbPage=ri,exports.BreadcrumbSeparator=ii,exports.Button=pi,exports.Card=mi,exports.CardAction=vi,exports.CardContent=yi,exports.CardDescription=_i,exports.CardFooter=bi,exports.CardHeader=hi,exports.CardTitle=gi,exports.DropdownMenu=of,exports.DropdownMenuCheckboxItem=gf,exports.DropdownMenuContent=lf,exports.DropdownMenuGroup=uf,exports.DropdownMenuItem=ff,exports.DropdownMenuLabel=df,exports.DropdownMenuPortal=sf,exports.DropdownMenuRadioGroup=_f,exports.DropdownMenuRadioItem=vf,exports.DropdownMenuSeparator=yf,exports.DropdownMenuShortcut=bf,exports.DropdownMenuSub=pf,exports.DropdownMenuSubContent=hf,exports.DropdownMenuSubTrigger=mf,exports.DropdownMenuTrigger=cf,exports.Input=Lf,exports.ModeToggle=nh,exports.Popover=op,exports.PopoverContent=cp,exports.PopoverDescription=dp,exports.PopoverHeader=lp,exports.PopoverTitle=up,exports.PopoverTrigger=sp,exports.Separator=fp,exports.Sheet=Pp,exports.SheetClose=Ip,exports.SheetContent=zp,exports.SheetDescription=Up,exports.SheetFooter=Vp,exports.SheetHeader=Bp,exports.SheetTitle=Hp,exports.SheetTrigger=Fp,exports.Sidebar=Am,exports.SidebarContent=Rm,exports.SidebarFooter=Im,exports.SidebarGroup=zm,exports.SidebarGroupAction=Vm,exports.SidebarGroupContent=Hm,exports.SidebarGroupLabel=Bm,exports.SidebarHeader=Fm,exports.SidebarInput=Pm,exports.SidebarInset=Nm,exports.SidebarMenu=Um,exports.SidebarMenuAction=qm,exports.SidebarMenuBadge=Jm,exports.SidebarMenuButton=Km,exports.SidebarMenuItem=Wm,exports.SidebarMenuSkeleton=Ym,exports.SidebarMenuSub=Xm,exports.SidebarMenuSubButton=Qm,exports.SidebarMenuSubItem=Zm,exports.SidebarProvider=km,exports.SidebarRail=Mm,exports.SidebarSeparator=Lm,exports.SidebarTrigger=jm,exports.Skeleton=Kp,exports.ThemeProvider=eh,exports.Tooltip=vm,exports.TooltipContent=bm,exports.TooltipProvider=_m,exports.TooltipTrigger=ym,exports.buttonVariants=fi,exports.useSidebar=Om,exports.useTheme=th;
|