@headlessui/react
Advanced tools
Comparing version 0.3.0 to 0.3.1-1fd5e21
@@ -7,3 +7,5 @@ export declare enum Keys { | ||
ArrowUp = "ArrowUp", | ||
ArrowRight = "ArrowRight", | ||
ArrowDown = "ArrowDown", | ||
ArrowLeft = "ArrowLeft", | ||
Home = "Home", | ||
@@ -10,0 +12,0 @@ End = "End", |
@@ -18,95 +18,95 @@ import React, { ElementType } from 'react'; | ||
var Label: <TTag extends React.ElementType<any> = "label">(props: Props<TTag, LabelRenderPropArg, LabelPropsWeControl>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null; | ||
var Options: <TTag extends React.ElementType<any> = "ul">(props: ({ | ||
var Options: <TTag extends React.ElementType<any> = "ul">(props: (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-labelledby">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-labelledby">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-labelledby">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-labelledby">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onKeyDown">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onKeyDown">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onKeyDown">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onKeyDown">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-activedescendant">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-activedescendant">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-activedescendant">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-activedescendant">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
unmount?: undefined; | ||
@@ -116,95 +116,95 @@ } & { | ||
}), ref: React.Ref<HTMLUListElement>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null; | ||
var Option: <TTag extends React.ElementType<any> = "li", TType = unknown>(props: ({ | ||
var Option: <TTag extends React.ElementType<any> = "li", TType = unknown>(props: (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "value" | "children" | "as" | "refName">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "value">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-disabled">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-disabled">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-selected">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-selected">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onPointerLeave">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onPointerLeave">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onMouseLeave">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onMouseLeave">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onPointerMove">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onPointerMove">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onMouseMove">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onMouseMove">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onFocus">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onFocus">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
value: TType; | ||
className?: string | ((bag: OptionRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "className">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: OptionRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "className">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -211,0 +211,0 @@ value: TType; |
@@ -12,95 +12,95 @@ import React, { ElementType } from 'react'; | ||
var Button: <TTag extends React.ElementType<any> = "button">(props: Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl>, ref: React.Ref<HTMLButtonElement>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null; | ||
var Items: <TTag extends React.ElementType<any> = "div">(props: ({ | ||
var Items: <TTag extends React.ElementType<any> = "div">(props: (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onKeyDown">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onKeyDown">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onKeyDown">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onKeyDown">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-activedescendant">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-activedescendant">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-activedescendant">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-activedescendant">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-labelledby">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-labelledby">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-labelledby">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-labelledby">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemsRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
unmount?: undefined; | ||
@@ -112,7 +112,7 @@ } & { | ||
children?: React.ReactNode; | ||
}>>(props: ({ | ||
}>>(props: (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "id">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "id">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -123,7 +123,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "role">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "role">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -134,7 +134,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "tabIndex">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "tabIndex">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -145,7 +145,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "aria-disabled">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "aria-disabled">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -156,7 +156,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onPointerLeave">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onPointerLeave">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -167,7 +167,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onPointerMove">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onPointerMove">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -178,7 +178,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onMouseLeave">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onMouseLeave">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -189,7 +189,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onMouseMove">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onMouseMove">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -200,7 +200,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "onFocus">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "onFocus">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -211,7 +211,7 @@ onClick?: ((event: { | ||
className?: string | ((bag: ItemRenderPropArg) => string) | undefined; | ||
}) | ({ | ||
}) | (Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "children" | "as" | "refName" | "className">> & { | ||
as?: TTag | undefined; | ||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | ((bag: ItemRenderPropArg) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | null | undefined; | ||
refName?: string | undefined; | ||
} & Pick<import("../../types").PropsOf<TTag>, Exclude<keyof import("../../types").PropsOf<TTag>, "className">> & { | ||
} & { | ||
disabled?: boolean | undefined; | ||
@@ -218,0 +218,0 @@ onClick?: ((event: { |
@@ -7,3 +7,3 @@ import React, { ElementType } from 'react'; | ||
} | ||
declare type SwitchPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-checked' | 'onClick' | 'onKeyUp' | 'onKeyPress'; | ||
declare type SwitchPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-checked' | 'aria-labelledby' | 'aria-describedby' | 'onClick' | 'onKeyUp' | 'onKeyPress'; | ||
export declare function Switch<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG>(props: Props<TTag, SwitchRenderPropArg, SwitchPropsWeControl | 'checked' | 'onChange' | 'className'> & { | ||
@@ -17,4 +17,5 @@ checked: boolean; | ||
children?: React.ReactNode; | ||
}>>(props: Props<TTag, {}, unique symbol>) => JSX.Element; | ||
}>>(props: Props<TTag, any, unique symbol>) => JSX.Element; | ||
var Label: <TTag extends React.ElementType<any> = "label">(props: Props<TTag, LabelRenderPropArg, LabelPropsWeControl>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null; | ||
var Description: <TTag extends React.ElementType<any> = "label">(props: Props<TTag, DescriptionRenderPropArg, DescriptionPropsWeControl>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null; | ||
} | ||
@@ -24,2 +25,5 @@ interface LabelRenderPropArg { | ||
declare type LabelPropsWeControl = 'id' | 'ref' | 'onClick'; | ||
interface DescriptionRenderPropArg { | ||
} | ||
declare type DescriptionPropsWeControl = 'id' | 'ref'; | ||
export {}; |
import { ElementType, MutableRefObject } from 'react'; | ||
import { Props } from 'types'; | ||
import { Props } from '../../types'; | ||
import { Features, PropsForFeatures } from '../../utils/render'; | ||
@@ -4,0 +4,0 @@ export interface TransitionClasses { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("react"),t=(e=n)&&"object"==typeof e&&"default"in e?e.default:e;function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function o(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function i(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return u(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}var a,c,l,s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,f={serverHandoffComplete:!1},d=0;function v(){return++d}function p(){var e=n.useState(f.serverHandoffComplete?v:null),t=e[0],r=e[1];return s((function(){null===t&&r(v())}),[t]),n.useEffect((function(){!1===f.serverHandoffComplete&&(f.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}function m(){var e=n.useRef(!0);return n.useEffect((function(){e.current=!1}),[]),e.current}function b(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,b),i}function y(e,n,t,u,i){if(void 0===i&&(i=!0),i)return h(e,n,t);var l=null!=u?u:a.None;if(l&a.Static){var s=e.static,f=void 0!==s&&s,d=o(e,["static"]);if(f)return h(d,n,t)}if(l&a.RenderStrategy){var v,p=e.unmount,m=void 0===p||p,y=o(e,["unmount"]);return b(m?c.Unmount:c.Hidden,((v={})[c.Unmount]=function(){return null},v[c.Hidden]=function(){return h(r({},y,{hidden:!0,style:{display:"none"}}),n,t)},v))}return h(e,n,t)}function h(e,t,r){var u,a=S(e,["unmount","static"]),c=a.as,l=void 0===c?r:c,s=a.children,f=a.refName,d=void 0===f?"ref":f,v=o(a,["as","children","refName"]),p=void 0!==e.ref?((u={})[d]=e.ref,u):{},m="function"==typeof s?s(t):s;if(l===n.Fragment&&Object.keys(v).length>0){if(Array.isArray(m)&&m.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,h),b}if(!n.isValidElement(m)){var y=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(y,h),y}return n.cloneElement(m,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},a=i(["onClick"]);!(r=a()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(S(v,["ref"])),m.props),p))}return n.createElement(l,Object.assign({},S(v,["ref"]),l!==n.Fragment&&p),m)}function x(e){return n.forwardRef(e)}function S(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=i(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function g(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=i(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function I(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function C(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function O(e,n,t,r,o){var u=g(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return I.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){C.apply(void 0,[e].concat(t)),I.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=g();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(l.Finished)}),u+o[1]):n(l.Finished),t.add((function(){return n(l.Cancelled)})),t.dispose}(e,(function(t){return C.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return C.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(l.Cancelled)})),u.dispose}function w(e){return void 0===e&&(e=""),n.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(c||(c={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(l||(l={}));var R,E=n.createContext(null);E.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(R||(R={}));var k=n.createContext(null);function T(e){return"children"in e?T(e.children):e.current.filter((function(e){return e.state===R.Visible})).length>0}function L(e){var t=n.useRef(e),r=n.useRef([]),o=function(){var e=n.useRef(!0);return n.useEffect((function(){return function(){e.current=!1}}),[]),e}();n.useEffect((function(){t.current=e}),[e]);var u=n.useCallback((function(e,n){var u;void 0===n&&(n=c.Hidden);var i=r.current.findIndex((function(n){return n.id===e}));-1!==i&&(b(n,((u={})[c.Unmount]=function(){r.current.splice(i,1)},u[c.Hidden]=function(){r.current[i].state=R.Hidden},u)),!T(r)&&o.current&&(null==t.current||t.current()))}),[t,o,r]),i=n.useCallback((function(e){var n=r.current.find((function(n){return n.id===e}));return n?n.state!==R.Visible&&(n.state=R.Visible):r.current.push({id:e,state:R.Visible}),function(){return u(e,c.Unmount)}}),[r,u]);return n.useMemo((function(){return{children:r,register:i,unregister:u}}),[i,u,r])}function D(){}k.displayName="NestingContext";var F=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function M(e){return F.reduce((function(n,t){return n[t]=e[t]||D,n}),{})}var A,N,P,G,j,H=a.RenderStrategy;function U(e){var u=e.beforeEnter,i=e.afterEnter,a=e.beforeLeave,f=e.afterLeave,d=e.enter,v=e.enterFrom,h=e.enterTo,x=e.leave,S=e.leaveFrom,g=e.leaveTo,I=o(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),C=n.useRef(null),D=n.useState(R.Visible),F=D[0],A=D[1],N=I.unmount?c.Unmount:c.Hidden,P=function(){var e=n.useContext(E);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),G=P.show,j=P.appear,U=function(){var e=n.useContext(k);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),V=U.register,Q=U.unregister,B=m(),K=p(),_=n.useRef(!1),q=L((function(){_.current||(A(R.Hidden),Q(K),Z.current.afterLeave())}));s((function(){if(K)return V(K)}),[V,K]),s((function(){var e;N===c.Hidden&&K&&(G&&F!==R.Visible?A(R.Visible):b(F,((e={})[R.Hidden]=function(){return Q(K)},e[R.Visible]=function(){return V(K)},e)))}),[F,K,V,Q,G,N]);var W=w(d),Y=w(v),J=w(h),$=w(x),z=w(S),X=w(g),Z=function(e){var t=n.useRef(M(e));return n.useEffect((function(){t.current=M(e)}),[e]),t}({beforeEnter:u,afterEnter:i,beforeLeave:a,afterLeave:f});n.useEffect((function(){if(F===R.Visible&&null===C.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[C,F]);var ee=B&&!j;return s((function(){var e=C.current;if(e&&!ee)return _.current=!0,G&&Z.current.beforeEnter(),G||Z.current.beforeLeave(),G?O(e,W,Y,J,(function(e){_.current=!1,e===l.Finished&&Z.current.afterEnter()})):O(e,$,z,X,(function(e){_.current=!1,e===l.Finished&&(T(q)||(A(R.Hidden),Q(K),Z.current.afterLeave()))}))}),[Z,K,_,Q,q,C,ee,G,W,Y,J,$,z,X]),t.createElement(k.Provider,{value:q},y(r({},I,{ref:C}),{},"div",H,F===R.Visible))}function V(e){var u=e.show,i=e.appear,a=void 0!==i&&i,c=e.unmount,l=o(e,["show","appear","unmount"]);if(![!0,!1].includes(u))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=n.useState(u?R.Visible:R.Hidden),f=s[0],d=s[1],v=L((function(){d(R.Hidden)})),p=m(),b=n.useMemo((function(){return{show:u,appear:a||!p}}),[u,a,p]);n.useEffect((function(){u?d(R.Visible):T(v)||d(R.Hidden)}),[u,v]);var h={unmount:c};return t.createElement(k.Provider,{value:v},t.createElement(E.Provider,{value:b},y(r({},h,{as:n.Fragment,children:t.createElement(U,Object.assign({},h,l))}),{},n.Fragment,H,f===R.Visible)))}function Q(){var e=n.useState(g)[0];return n.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback((function(e){t.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[t])}function K(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case N.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case N.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case N.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case N.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case N.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case N.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function _(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}function q(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}V.Child=U,function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(A||(A={})),function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(N||(N={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(G||(G={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(j||(j={}));var W=((P={})[j.CloseMenu]=function(e){return r({},e,{activeItemIndex:null,menuState:G.Closed})},P[j.OpenMenu]=function(e){return r({},e,{menuState:G.Open})},P[j.GoToItem]=function(e,n){var t=K(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:r({},e,{searchQuery:"",activeItemIndex:t})},P[j.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return r({},e,-1===o||o===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:o})},P[j.ClearSearch]=function(e){return r({},e,{searchQuery:""})},P[j.RegisterItem]=function(e,n){return r({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},P[j.UnregisterItem]=function(e,n){var t=e.items.slice(),o=null!==e.activeItemIndex?t[e.activeItemIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{items:t,activeItemIndex:u===e.activeItemIndex||null===o?null:t.indexOf(o)})},P),Y=n.createContext(null);function J(e){var t=n.useContext(Y);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+X.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,J),r}return t}function $(e,n){return b(n.type,W,e,n)}Y.displayName="MenuContext";var z=n.Fragment;function X(e){var r=n.useReducer($,{menuState:G.Closed,buttonRef:n.createRef(),itemsRef:n.createRef(),items:[],searchQuery:"",activeItemIndex:null}),o=r[0],u=o.menuState,i=o.itemsRef,a=o.buttonRef,c=r[1];n.useEffect((function(){function e(e){var n,t,r,o=e.target,l=document.activeElement;u===G.Open&&((null==(n=a.current)?void 0:n.contains(o))||((null==(t=i.current)?void 0:t.contains(o))||c({type:j.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(o))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[u,i,a,c]);var l=n.useMemo((function(){return{open:u===G.Open}}),[u]);return t.createElement(Y.Provider,{value:r},y(e,l,z))}var Z,ee,ne,te=x((function e(t,o){var u,i=J([X.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-menu-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===G.Open?(c({type:j.CloseMenu}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;return null==(e=a.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=n.useMemo((function(){return{open:a.menuState===G.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.itemsRef.current)?void 0:u.id,"aria-expanded":a.menuState===G.Open||void 0,onKeyDown:d,onClick:v}),m,"button")})),re=a.RenderStrategy|a.Static,oe=x((function e(t,o){var u,i,a=J([X.name,e.name].join(".")),c=a[0],l=a[1],f=B(c.itemsRef,o),d="headlessui-menu-items-"+p(),v=Q();s((function(){var e=c.itemsRef.current;if(e&&c.menuState===G.Open)for(var n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")}));var m=n.useCallback((function(e){switch(v.dispose(),e.key){case A.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:j.Search,value:e.key});case A.Enter:var n;e.preventDefault(),l({type:j.CloseMenu}),null!==c.activeItemIndex&&(null==(n=document.getElementById(c.items[c.activeItemIndex].id))||n.click()),g().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Next});case A.ArrowUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Last});case A.Escape:e.preventDefault(),l({type:j.CloseMenu}),g().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:j.Search,value:e.key}),v.setTimeout((function(){return l({type:j.ClearSearch})}),350))}}),[l,v,c]),b=n.useMemo((function(){return{open:c.menuState===G.Open}}),[c]);return y(r({},t,{"aria-activedescendant":null===c.activeItemIndex||null==(u=c.items[c.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(i=c.buttonRef.current)?void 0:i.id,id:d,onKeyDown:m,role:"menu",tabIndex:0,ref:f}),b,"div",re,c.menuState===G.Open)})),ue=n.Fragment;function ie(e,t){var r=n.useState(e),o=r[0],u=r[1],i=n.useRef(e);return s((function(){i.current=e}),[e]),s((function(){return u(i.current)}),[i,u].concat(t)),o}X.Button=te,X.Items=oe,X.Item=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.className,c=t.onClick,l=o(t,["disabled","className","onClick"]),f=J([X.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-menu-item-"+p(),b=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===m;s((function(){if(d.menuState===G.Open&&b){var e=g();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.menuState]);var h=n.useRef({disabled:i});s((function(){h.current.disabled=i}),[h,i]),s((function(){var e,n;h.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,m]),s((function(){return v({type:j.RegisterItem,id:m,dataRef:h}),function(){return v({type:j.UnregisterItem,id:m})}}),[h,m]);var x=n.useCallback((function(e){return i?e.preventDefault():(v({type:j.CloseMenu}),g().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[v,d.buttonRef,i,c]),S=n.useCallback((function(){if(i)return v({type:j.GoToItem,focus:N.Nothing});v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,m,v]),I=n.useCallback((function(){i||b||v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,b,m,v]),C=n.useCallback((function(){i||b&&v({type:j.GoToItem,focus:N.Nothing})}),[i,b,v]),O=n.useMemo((function(){return{active:b,disabled:i}}),[b,i]);return y(r({},l,{id:m,role:"menuitem",tabIndex:-1,className:_(a,O),"aria-disabled":!0===i||void 0,onClick:x,onFocus:S,onPointerMove:I,onMouseMove:I,onPointerLeave:C,onMouseLeave:C}),O,ue)},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(ne||(ne={}));var ae=((Z={})[ne.CloseListbox]=function(e){return e.disabled||e.listboxState===ee.Closed?e:r({},e,{activeOptionIndex:null,listboxState:ee.Closed})},Z[ne.OpenListbox]=function(e){return e.disabled||e.listboxState===ee.Open?e:r({},e,{listboxState:ee.Open})},Z[ne.SetDisabled]=function(e,n){return e.disabled===n.disabled?e:r({},e,{disabled:n.disabled})},Z[ne.GoToOption]=function(e,n){if(e.disabled)return e;if(e.listboxState===ee.Closed)return e;var t=K(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:r({},e,{searchQuery:"",activeOptionIndex:t})},Z[ne.Search]=function(e,n){if(e.disabled)return e;if(e.listboxState===ee.Closed)return e;var t=e.searchQuery+n.value,o=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return r({},e,-1===o||o===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:o})},Z[ne.ClearSearch]=function(e){return e.disabled||e.listboxState===ee.Closed||""===e.searchQuery?e:r({},e,{searchQuery:""})},Z[ne.RegisterOption]=function(e,n){return r({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},Z[ne.UnregisterOption]=function(e,n){var t=e.options.slice(),o=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{options:t,activeOptionIndex:u===e.activeOptionIndex||null===o?null:t.indexOf(o)})},Z),ce=n.createContext(null);function le(e){var t=n.useContext(ce);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,le),r}return t}function se(e,n){return b(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=n.Fragment;function de(e){var r=e.value,u=e.onChange,i=e.disabled,a=void 0!==i&&i,c=o(e,["value","onChange","disabled"]),l=Q(),f=n.useReducer(se,{listboxState:ee.Closed,propsRef:{current:{value:r,onChange:u}},labelRef:n.createRef(),buttonRef:n.createRef(),optionsRef:n.createRef(),disabled:a,options:[],searchQuery:"",activeOptionIndex:null}),d=f[0],v=d.listboxState,p=d.propsRef,m=d.optionsRef,b=d.buttonRef,h=f[1];s((function(){p.current.value=r}),[r,p]),s((function(){p.current.onChange=u}),[u,p]),s((function(){return h({type:ne.SetDisabled,disabled:a})}),[a]),n.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;v===ee.Open&&((null==(n=b.current)?void 0:n.contains(o))||((null==(t=m.current)?void 0:t.contains(o))||h({type:ne.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=b.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[v,m,b,l,h]);var x=n.useMemo((function(){return{open:v===ee.Open,disabled:a}}),[v,a]);return t.createElement(ce.Provider,{value:f},y(c,x,fe))}var ve=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-listbox-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();a.listboxState===ee.Open?(c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;return null==(e=a.optionsRef.current)?void 0:e.focus({preventScroll:!0})})))}),[c,f,a]),m=ie((function(){if(a.labelRef.current)return[a.labelRef.current.id,s].join(" ")}),[a.labelRef.current,s]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open,disabled:a.disabled}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.optionsRef.current)?void 0:u.id,"aria-expanded":a.listboxState===ee.Open||void 0,"aria-labelledby":m,disabled:a.disabled,onKeyDown:d,onClick:v}),b,"button")})),pe=a.RenderStrategy|a.Static,me=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.optionsRef,o),s="headlessui-listbox-options-"+p(),f=Q(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==a.searchQuery)return e.preventDefault(),c({type:ne.Search,value:e.key});case A.Enter:e.preventDefault(),c({type:ne.CloseListbox}),null!==a.activeOptionIndex&&a.propsRef.current.onChange(a.options[a.activeOptionIndex].dataRef.current.value),g().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Next});case A.ArrowUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Last});case A.Escape:return e.preventDefault(),c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case A.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:ne.Search,value:e.key}),d.setTimeout((function(){return c({type:ne.ClearSearch})}),350))}}),[f,c,d,a]),m=ie((function(){var e,n,t;return null!=(e=null==(n=a.labelRef.current)?void 0:n.id)?e:null==(t=a.buttonRef.current)?void 0:t.id}),[a.labelRef.current,a.buttonRef.current]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(u=a.options[a.activeOptionIndex])?void 0:u.id,"aria-labelledby":m,id:s,onKeyDown:v,role:"listbox",tabIndex:0,ref:l}),b,"ul",pe,a.listboxState===ee.Open)}));de.Button=ve,de.Label=function e(t){var o=le([de.name,e.name].join("."))[0],u="headlessui-listbox-label-"+p(),i=n.useCallback((function(){var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[o.buttonRef]),a=n.useMemo((function(){return{open:o.listboxState===ee.Open,disabled:o.disabled}}),[o]);return y(r({},t,{ref:o.labelRef,id:u,onClick:i}),a,"label")},de.Options=me,de.Option=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.value,c=t.className,l=o(t,["disabled","value","className"]),f=le([de.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-listbox-option-"+p(),b=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===m,h=d.propsRef.current.value===a,x=n.useRef({disabled:i,value:a});s((function(){x.current.disabled=i}),[x,i]),s((function(){x.current.value=a}),[x,a]),s((function(){var e,n;x.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[x,m]);var S=n.useCallback((function(){return d.propsRef.current.onChange(a)}),[d.propsRef,a]);s((function(){return v({type:ne.RegisterOption,id:m,dataRef:x}),function(){return v({type:ne.UnregisterOption,id:m})}}),[x,m]),s((function(){var e;d.listboxState===ee.Open&&h&&(v({type:ne.GoToOption,focus:N.Specific,id:m}),null==(e=document.getElementById(m))||null==e.focus||e.focus())}),[d.listboxState]),s((function(){if(d.listboxState===ee.Open&&b){var e=g();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.listboxState]);var I=n.useCallback((function(e){if(i)return e.preventDefault();S(),v({type:ne.CloseListbox}),g().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[v,d.buttonRef,i,S]),C=n.useCallback((function(){if(i)return v({type:ne.GoToOption,focus:N.Nothing});v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,m,v]),O=n.useCallback((function(){i||b||v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,b,m,v]),w=n.useCallback((function(){i||b&&v({type:ne.GoToOption,focus:N.Nothing})}),[i,b,v]),R=n.useMemo((function(){return{active:b,selected:h,disabled:i}}),[b,h,i]);return y(r({},l,{id:m,role:"option",tabIndex:-1,className:_(c,R),"aria-disabled":!0===i||void 0,"aria-selected":!0===h||void 0,onClick:I,onFocus:C,onPointerMove:O,onMouseMove:O,onPointerLeave:w,onMouseLeave:w}),R,"li")};var be=n.createContext(null);function ye(e){var t=n.useContext(be);if(null===t){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,ye),r}return t}be.displayName="GroupContext";var he=n.Fragment;function xe(e){var t,u=e.checked,i=e.onChange,a=e.className,c=o(e,["checked","onChange","className"]),l="headlessui-switch-"+p(),s=n.useContext(be),f=n.useCallback((function(){return i(!u)}),[i,u]),d=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();e.preventDefault(),f()}),[f]),v=n.useCallback((function(e){e.key!==A.Tab&&e.preventDefault(),e.key===A.Space&&f()}),[f]),m=n.useCallback((function(e){return e.preventDefault()}),[]),b=n.useMemo((function(){return{checked:u}}),[u]),h={id:l,ref:null===s?void 0:s.setSwitch,role:"switch",tabIndex:0,className:_(a,b),"aria-checked":u,"aria-labelledby":null==s||null==(t=s.label)?void 0:t.id,onClick:d,onKeyUp:v,onKeyPress:m};return"button"===c.as&&Object.assign(h,{type:"button"}),y(r({},c,h),b,"button")}xe.Group=function(e){var r=n.useState(null),o=r[0],u=r[1],i=n.useState(null),a=i[0],c=i[1],l=n.useMemo((function(){return{switch:o,label:a,setSwitch:u,setLabel:c}}),[o,u,a,c]);return t.createElement(be.Provider,{value:l},y(e,{},he))},xe.Label=function e(t){var o=ye([xe.name,e.name].join(".")),u="headlessui-switch-label-"+p(),i=n.useCallback((function(){o.switch&&(o.switch.click(),o.switch.focus({preventScroll:!0}))}),[o.switch]);return y(r({},t,{ref:o.setLabel,id:u,onClick:i}),{},"label")},exports.Listbox=de,exports.Menu=X,exports.Switch=xe,exports.Transition=V; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,n,r,o=require("react"),i=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,u=require("react-dom");function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function f(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var u=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(u,f),u}function d(e,r,o,i,u){if(void 0===u&&(u=!0),u)return p(e,r,o);var c=null!=i?i:t.None;if(c&t.Static){var s=e.static,d=void 0!==s&&s,v=l(e,["static"]);if(d)return p(v,r,o)}if(c&t.RenderStrategy){var m,h=e.unmount,y=void 0===h||h,b=l(e,["unmount"]);return f(y?n.Unmount:n.Hidden,((m={})[n.Unmount]=function(){return null},m[n.Hidden]=function(){return p(a({},b,{hidden:!0,style:{display:"none"}}),r,o)},m))}return p(e,r,o)}function p(e,t,n){var r,i=m(e,["unmount","static"]),u=i.as,a=void 0===u?n:u,c=i.children,f=i.refName,d=void 0===f?"ref":f,v=l(i,["as","children","refName"]),h=void 0!==e.ref?((r={})[d]=e.ref,r):{},y="function"==typeof c?c(t):c;if(a===o.Fragment&&Object.keys(v).length>0){if(Array.isArray(y)&&y.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,p),b}if(!o.isValidElement(y)){var g=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(g,p),g}return o.cloneElement(y,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},u=s(["onClick"]);!(r=u()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(m(v,["ref"])),y.props),h))}return o.createElement(a,Object.assign({},m(v,["ref"]),a!==o.Fragment&&h),y)}function v(e){return Object.assign(o.forwardRef(e),{name:e.name})}function m(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=s(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.useCallback((function(e){t.forEach((function(t){if(null!=t)return"function"==typeof t?t(e):void(t.current=e)}))}),[t])}function y(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;for(var t=e.previousElementSibling;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(t||(t={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(n||(n={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(r||(r={}));var b="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,g={serverHandoffComplete:!1},S=0;function x(){return++S}function E(){var e=o.useState(g.serverHandoffComplete?x:null),t=e[0],n=e[1];return b((function(){null===t&&n(x())}),[t]),o.useEffect((function(){!1===g.serverHandoffComplete&&(g.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}var w=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function C(e){e&&e.focus({preventScroll:!0})}function I(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={});var i=o.useRef("undefined"!=typeof window?document.activeElement:null),u=o.useRef(null),a=o.useRef(!1),l=o.useCallback((function(){return e.current?Array.from(e.current.querySelectorAll(w)):[]}),[e]);b((function(){var r,o,c,s;if(t){a.current=!0;var f,d=document.activeElement;if(null==(r=n.initialFocus)?void 0:r.current){if((null==(f=n.initialFocus)?void 0:f.current)===d)return}else if(null==(o=e.current)?void 0:o.contains(d))return;i.current=d;var p=l();if(p.length<=0)throw new Error("There are no focusable elements inside the <FocusTrap />");return function e(t){void 0!==t&&(C(t),document.activeElement!==t?e(p[p.indexOf(t)+1]):u.current=t)}(null!=(c=null==(s=n.initialFocus)?void 0:s.current)?c:p[0]),function(){a.current=!1,C(i.current),i.current=null,u.current=null}}}),[t,a,n.initialFocus]),b((function(){if(t)return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)};function e(e){if(e.key===r.Tab&&document.activeElement){e.preventDefault();var t=e.shiftKey?-1:1,n=l(),o=n.length,i=n.indexOf(document.activeElement);!function e(r){void 0===r&&(r=0);var a=(n.indexOf(document.activeElement)+o+t+r)%o,l=n[a];if(C(l),l!==document.activeElement){if(i===a)return;e(r+t)}else u.current=l}()}}}),[t,l]),b((function(){if(t&&e.current){var n=e.current;return window.addEventListener("focus",r,!0),function(){return window.removeEventListener("focus",r,!0)}}function r(e){var t=u.current;if(t&&a.current){var r=e.target;r&&r instanceof HTMLElement?n.contains(r)?(u.current=r,C(r)):(e.preventDefault(),e.stopPropagation(),C(t)):C(u.current)}}}),[t,a,e])}function O(e,t){return e(t={exports:{}},t.exports),t.exports}var k=O((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=Object.create((t&&t.prototype instanceof f?t:f).prototype),i=new w(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var a=S(u,n);if(a){if(a===s)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,i),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var s={};function f(){}function d(){}function p(){}var v={};v[o]=function(){return this};var m=Object.getPrototypeOf,h=m&&m(m(C([])));h&&h!==t&&n.call(h,o)&&(v=h);var y=p.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var r;this._invoke=function(o,i){function u(){return new t((function(r,u){!function r(o,i,u,a){var l=c(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,a)}),(function(e){r("throw",e,u,a)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,a)}))}a(l.arg)}(o,i,r,u)}))}return r=r?r.then(u,u):u()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return d.prototype=y.constructor=p,p.constructor=d,d.displayName=a(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,u,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(g.prototype),g.prototype[i]=function(){return this},e.AsyncIterator=g,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var u=new g(l(t,n,r,o),i);return e.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},b(y),a(y,u,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return u.type="throw",u.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var a=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(a&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=e,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),R=k.mark(L);function L(e){var t;return k.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.parentElement){n.next=2;break}return n.abrupt("return");case 2:t=e.parentElement.firstChild;case 3:if(!t){n.next=10;break}if(!(t!==e&&t instanceof HTMLElement)){n.next=7;break}return n.next=7,t;case 7:t=t.nextSibling,n.next=3;break;case 10:case"end":return n.stop()}}),R)}var T,F,D,P=o.Fragment;function M(e){var t=o.useState((function(){if("undefined"==typeof window)return null;var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}))[0],n=o.useState((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0];return b((function(){if(t&&n)return t.appendChild(n),function(){t&&n&&(t.removeChild(n),t.childNodes.length<=0&&document.body.removeChild(t))}}),[t]),t&&n?u.createPortal(d(e,{},P),n):null}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(F||(F={})),function(e){e[e.SetTitleElement=0]="SetTitleElement",e[e.SetDescriptionElement=1]="SetDescriptionElement"}(D||(D={}));var A=((T={})[D.SetTitleElement]=function(e,t){return e.titleElement===t.element?e:a({},e,{titleElement:t.element})},T[D.SetDescriptionElement]=function(e,t){return e.descriptionElement===t.element?e:a({},e,{descriptionElement:t.element})},T),N=o.createContext(null);function j(e){var t=o.useContext(N);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+_.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,j),n}return t}function G(e,t){return f(t.type,A,e,t)}N.displayName="DialogContext";var U,H,B,V=t.RenderStrategy|t.Static,_=Object.assign(v((function(e,t){var n,u,c=e.open,f=e.onClose,p=e.initialFocus,v=l(e,["open","onClose","initialFocus"]),m=o.useRef(null),y=h(m,t),g=e.hasOwnProperty("open"),S=e.hasOwnProperty("onClose");if(!g)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof c)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+c);if("function"!=typeof f)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+f);var x=c?F.Open:F.Closed,w=o.useReducer(G,{titleElement:null,descriptionElement:null}),C=w[0],O=w[1],k=o.useCallback((function(){return f(!1)}),[f]),R=o.useCallback((function(e){return O({type:D.SetTitleElement,element:e})}),[O]),T=o.useCallback((function(e){return O({type:D.SetDescriptionElement,element:e})}),[O]);o.useEffect((function(){function e(e){e.key===r.Escape&&x===F.Open&&k()}return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[k,x]),o.useEffect((function(){if(x===F.Open){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[x]),o.useEffect((function(){if(x===F.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=s(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(m.current),function(){return e.disconnect()}}}),[x,m,k]);var P=!!e.static||x===F.Open;I(m,P,{initialFocus:p}),function(e,t){void 0===t&&(t=!0),b((function(){if(t&&e.current){for(var n,r=e.current,o=new Map,i=s(L(r));!(n=i()).done;){var u=n.value;o.set(u,{"aria-hidden":u.getAttribute("aria-hidden"),inert:u.inert})}document.querySelectorAll("body > *").forEach((function(e){e!==r&&e instanceof HTMLElement&&(e.contains(r)||o.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}))}));for(var a,l=s(o.keys());!(a=l()).done;){var c=a.value;c.setAttribute("aria-hidden","true"),c.inert=!0}return function(){for(var e,t=s(o.entries());!(e=t()).done;){var n=e.value,r=n[0],i=n[1];null!==r&&(null===i["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",i["aria-hidden"]),r.inert=i.inert)}o.clear()}}}),[t])}(m,P);var A="headlessui-dialog-"+E(),j=o.useMemo((function(){return[{dialogState:x,close:k,setTitle:R,setDescription:T},C]}),[x,C,k,R,T]),U=o.useMemo((function(){return{open:x===F.Open}}),[x]),H={ref:y,id:A,role:"dialog","aria-modal":x===F.Open||void 0,"aria-labelledby":null==(n=C.titleElement)?void 0:n.id,"aria-describedby":null==(u=C.descriptionElement)?void 0:u.id};return i.createElement(M,null,i.createElement(N.Provider,{value:j},d(a({},v,H),U,"div",V,x===F.Open)))})),{Overlay:v((function e(t,n){var r=j([_.name,e.name].join("."))[0],i=r.dialogState,u=r.close,l=h(n),c="headlessui-dialog-overlay-"+E(),s=o.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();u()}),[u]),f=o.useMemo((function(){return{open:i===F.Open}}),[i]);return d(a({},t,{ref:l,id:c,"aria-hidden":!0,onClick:s}),f,"div")})),Title:function e(t){var n=j([_.name,e.name].join("."))[0],r=n.dialogState,i=n.setTitle,u="headlessui-dialog-title-"+E(),l=o.useMemo((function(){return{open:r===F.Open}}),[r]);return d(a({},t,{ref:i,id:u}),l,"h2")},Description:function e(t){var n=j([_.name,e.name].join("."))[0],r=n.dialogState,i=n.setDescription,u="headlessui-dialog-description-"+E(),l=o.useMemo((function(){return{open:r===F.Open}}),[r]);return d(a({},t,{ref:i,id:u}),l,"p")}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(H||(H={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(B||(B={}));var Q=((U={})[B.ToggleDisclosure]=function(e){var t;return a({},e,{disclosureState:f(e.disclosureState,(t={},t[H.Open]=H.Closed,t[H.Closed]=H.Open,t))})},U[B.LinkPanel]=function(e){return!0===e.linkedPanel?e:a({},e,{linkedPanel:!0})},U[B.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:a({},e,{linkedPanel:!1})},U[B.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:a({},e,{buttonId:t.buttonId})},U[B.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:a({},e,{panelId:t.panelId})},U),K=o.createContext(null);function q(e){var t=o.useContext(K);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+J.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,q),n}return t}function W(e,t){return f(t.type,Q,e,t)}K.displayName="DisclosureContext";var Y=o.Fragment;function J(e){var t="headlessui-disclosure-button-"+E(),n="headlessui-disclosure-panel-"+E(),r=o.useReducer(W,{disclosureState:H.Closed,linkedPanel:!1,buttonId:t,panelId:n}),u=r[0].disclosureState,a=r[1];o.useEffect((function(){return a({type:B.SetButtonId,buttonId:t})}),[t,a]),o.useEffect((function(){return a({type:B.SetPanelId,panelId:n})}),[n,a]);var l=o.useMemo((function(){return{open:u===H.Open}}),[u]);return i.createElement(K.Provider,{value:r},d(e,l,Y))}var $,z,X,Z,ee=v((function e(t,n){var i=q([J.name,e.name].join(".")),u=i[0],l=i[1],c=h(n),s=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:e.preventDefault(),l({type:B.ToggleDisclosure})}}),[l]),f=o.useCallback((function(e){y(e.currentTarget)||t.disabled||l({type:B.ToggleDisclosure})}),[l,t.disabled]),p=o.useMemo((function(){return{open:u.disclosureState===H.Open}}),[u]);return d(a({},t,{ref:c,id:u.buttonId,type:"button","aria-expanded":u.disclosureState===H.Open||void 0,"aria-controls":u.linkedPanel?u.panelId:void 0,onKeyDown:s,onClick:f}),p,"button")})),te=t.RenderStrategy|t.Static,ne=v((function e(t,n){var r=q([J.name,e.name].join(".")),i=r[0],u=r[1],l=h(n,(function(){i.linkedPanel||u({type:B.LinkPanel})}));o.useEffect((function(){return function(){return u({type:B.UnlinkPanel})}}),[u]),o.useEffect((function(){var e;i.disclosureState!==H.Closed||null!=(e=t.unmount)&&!e||u({type:B.UnlinkPanel})}),[i.disclosureState,t.unmount,u]);var c=o.useMemo((function(){return{open:i.disclosureState===H.Open}}),[i]);return d(a({},t,{ref:l,id:i.panelId}),c,"div",te,i.disclosureState===H.Open)}));J.Button=ee,J.Panel=ne,function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last"}(z||(z={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(X||(X={})),function(e){e[e.ToggleFlyout=0]="ToggleFlyout",e[e.CloseFlyout=1]="CloseFlyout",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel"}(Z||(Z={}));var re=(($={})[Z.ToggleFlyout]=function(e){var t;return a({},e,{flyoutState:f(e.flyoutState,(t={},t[X.Open]=X.Closed,t[X.Closed]=X.Open,t))})},$[Z.CloseFlyout]=function(e){return e.flyoutState===X.Closed?e:a({},e,{flyoutState:X.Closed})},$[Z.LinkPanel]=function(e){return!0===e.linkedPanel?e:a({},e,{linkedPanel:!0})},$[Z.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:a({},e,{linkedPanel:!1})},$[Z.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:a({},e,{buttonId:t.buttonId})},$[Z.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:a({},e,{panelId:t.panelId})},$),oe=o.createContext(null);function ie(e){var t=o.useContext(oe);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ce.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,ie),n}return t}oe.displayName="FlyoutContext";var ue=o.createContext(null);function ae(){return o.useContext(ue)}function le(e,t){return f(t.type,re,e,t)}function ce(e){var t,n="headlessui-flyout-button-"+E(),r="headlessui-flyout-panel-"+E(),u=o.useReducer(le,{flyoutState:X.Closed,linkedPanel:!1,buttonId:n,panelId:r}),a=u[0].flyoutState,l=u[1];o.useEffect((function(){return l({type:Z.SetButtonId,buttonId:n})}),[n,l]),o.useEffect((function(){return l({type:Z.SetPanelId,panelId:r})}),[r,l]);var c=o.useMemo((function(){return{buttonId:n,panelId:r,close:function(){return l({type:Z.CloseFlyout})}}}),[n,r,l]),s=ae(),f=null==s?void 0:s.registerFlyoutMenu,p=null!=(t=null==s?void 0:s.isFocusWithinFlyoutGroup)?t:function(){var e,t;return(null==(e=document.getElementById(n))?void 0:e.contains(document.activeElement))||(null==(t=document.getElementById(r))?void 0:t.contains(document.activeElement))};o.useEffect((function(){return null==f?void 0:f(c)}),[f,c]),o.useEffect((function(){if(a===X.Open)return window.addEventListener("focus",e,!0),function(){return window.removeEventListener("focus",e,!0)};function e(){(null==p?void 0:p())||l({type:Z.CloseFlyout})}}),[a,p,s,n,r,l]);var v=o.useMemo((function(){return{open:a===X.Open}}),[a]);return i.createElement(oe.Provider,{value:u},d(e,v,"div"))}ue.displayName="FlyoutGroupContext";var se,fe,de,pe,ve=v((function e(t,n){var i=ie([ce.name,e.name].join(".")),u=i[0],l=i[1],c=o.useRef(null),s=h(c,n),f=ae(),p=null!==f,v=null==f?void 0:f.closeOthers,m=null==f?void 0:f.focusButton,b=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:e.preventDefault(),u.flyoutState===X.Closed&&(null==v||v(u.buttonId)),l({type:Z.ToggleFlyout});break;case r.Escape:if(u.flyoutState!==X.Open)return null==v?void 0:v(u.buttonId);if(!c.current)return;if(!c.current.contains(document.activeElement))return;e.preventDefault(),l({type:Z.CloseFlyout})}if(p)switch(e.key){case r.Home:return e.preventDefault(),null==m?void 0:m(z.First);case r.ArrowLeft:return e.preventDefault(),null==m?void 0:m(z.Previous);case r.End:return e.preventDefault(),null==m?void 0:m(z.Last);case r.ArrowRight:return e.preventDefault(),null==m?void 0:m(z.Next)}}),[l,u,c,v,m,p]),g=o.useCallback((function(e){y(e.currentTarget)||t.disabled||(u.flyoutState===X.Closed&&(null==v||v(u.buttonId)),l({type:Z.ToggleFlyout}))}),[l,u.flyoutState,u.buttonId,t.disabled,v]),S=o.useMemo((function(){return{open:u.flyoutState===X.Open}}),[u]);return d(a({},t,{ref:s,id:u.buttonId,type:"button","aria-expanded":u.flyoutState===X.Open||void 0,"aria-controls":u.linkedPanel?u.panelId:void 0,onKeyDown:b,onClick:g}),S,"button")})),me=t.RenderStrategy|t.Static,he=v((function e(t,n){var i=ie([ce.name,e.name].join(".")),u=i[0],l=i[1],c=o.useRef(null),s=h(c,n,(function(){u.linkedPanel||l({type:Z.LinkPanel})})),f=o.useCallback((function(e){var t;switch(e.key){case r.Escape:if(u.flyoutState!==X.Open)return;if(!c.current)return;if(!c.current.contains(document.activeElement))return;e.preventDefault(),l({type:Z.CloseFlyout}),null==(t=document.getElementById(u.buttonId))||t.focus({preventScroll:!0})}}),[u,c,l]);o.useEffect((function(){return function(){return l({type:Z.UnlinkPanel})}}),[l]),o.useEffect((function(){var e;u.flyoutState!==X.Closed||null!=(e=t.unmount)&&!e||l({type:Z.UnlinkPanel})}),[u.flyoutState,t.unmount,l]);var p=o.useMemo((function(){return{open:u.flyoutState===X.Open}}),[u]);return d(a({},t,{ref:s,id:u.panelId,onKeyDown:f}),p,"div",me,u.flyoutState===X.Open)}));function ye(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=s(e.splice(0));!(t=n()).done;)(0,t.value)()}};return t}function be(){var e=o.useState(ye)[0];return o.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function ge(e,t){var n=o.useState(e),r=n[0],i=n[1],u=o.useRef(e);return b((function(){u.current=e}),[e]),b((function(){return i(u.current)}),[u,i].concat(t)),r}function Se(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case se.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case se.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o||t.resolveDisabled(e))}));return-1===r?r:n.length-1-r;case se.Next:return n.findIndex((function(e,n){return!(n<=o||t.resolveDisabled(e))}));case se.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case se.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case se.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}function xe(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}ce.Button=ve,ce.Panel=he,ce.Group=function(e){var t=o.useMemo((function(){return{}}),[]),n=e,r=o.useState([]),u=r[0],l=r[1],c=o.useCallback((function(e){l((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[l]),p=o.useCallback((function(e){return l((function(t){return[].concat(t,[e])})),function(){return c(e)}}),[l,c]),v=o.useCallback((function(){var e=document.activeElement;return u.some((function(t){var n,r;return(null==(n=document.getElementById(t.buttonId))?void 0:n.contains(e))||(null==(r=document.getElementById(t.panelId))?void 0:r.contains(e))}))}),[u]),m=o.useCallback((function(e){for(var t,n=s(u);!(t=n()).done;){var r=t.value;r.buttonId!==e&&r.close()}}),[u]),h=o.useCallback((function(e){var t;if(document.activeElement){var n=u.reduce((function(e,t){var n=document.getElementById(t.buttonId);return n?(e[t.buttonId]=n,e):e}),{}),r=Array.from(document.querySelectorAll(w)).filter((function(e){return void 0!==n[e.id]})),o=r.indexOf(document.activeElement);if(-1!==o){var i=f(e,((t={})[z.First]=function(){return 0},t[z.Previous]=function(){return Math.max(0,o-1)},t[z.Next]=function(){return Math.min(r.length-1,o+1)},t[z.Last]=function(){return r.length-1},t));r[i].focus({preventScroll:!0})}}}),[u]),y=o.useMemo((function(){return{registerFlyoutMenu:p,unregisterFlyoutMenu:c,isFocusWithinFlyoutGroup:v,closeOthers:m,focusButton:h}}),[p,c,v,m,h]);return i.createElement(ue.Provider,{value:y},d(a({},n,{}),t,"div"))},function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(se||(se={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(de||(de={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(pe||(pe={}));var Ee=((fe={})[pe.CloseListbox]=function(e){return e.disabled||e.listboxState===de.Closed?e:a({},e,{activeOptionIndex:null,listboxState:de.Closed})},fe[pe.OpenListbox]=function(e){return e.disabled||e.listboxState===de.Open?e:a({},e,{listboxState:de.Open})},fe[pe.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:a({},e,{disabled:t.disabled})},fe[pe.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===de.Closed)return e;var n=Se(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:a({},e,{searchQuery:"",activeOptionIndex:n})},fe[pe.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===de.Closed)return e;var n=e.searchQuery+t.value,r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return a({},e,-1===r||r===e.activeOptionIndex?{searchQuery:n}:{searchQuery:n,activeOptionIndex:r})},fe[pe.ClearSearch]=function(e){return e.disabled||e.listboxState===de.Closed||""===e.searchQuery?e:a({},e,{searchQuery:""})},fe[pe.RegisterOption]=function(e,t){return a({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},fe[pe.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),a({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},fe),we=o.createContext(null);function Ce(e){var t=o.useContext(we);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+ke.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ce),n}return t}function Ie(e,t){return f(t.type,Ee,e,t)}we.displayName="ListboxContext";var Oe=o.Fragment;function ke(e){var t=e.value,n=e.onChange,r=e.disabled,u=void 0!==r&&r,a=l(e,["value","onChange","disabled"]),c=be(),s=o.useReducer(Ie,{listboxState:de.Closed,propsRef:{current:{value:t,onChange:n}},labelRef:o.createRef(),buttonRef:o.createRef(),optionsRef:o.createRef(),disabled:u,options:[],searchQuery:"",activeOptionIndex:null}),f=s[0],p=f.listboxState,v=f.propsRef,m=f.optionsRef,h=f.buttonRef,y=s[1];b((function(){v.current.value=t}),[t,v]),b((function(){v.current.onChange=n}),[n,v]),b((function(){return y({type:pe.SetDisabled,disabled:u})}),[u]),o.useEffect((function(){function e(e){var t,n,r,o=e.target,i=document.activeElement;p===de.Open&&((null==(t=h.current)?void 0:t.contains(o))||((null==(n=m.current)?void 0:n.contains(o))||y({type:pe.CloseListbox}),i!==document.body&&(null==i?void 0:i.contains(o))||e.defaultPrevented||null==(r=h.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[p,m,h,c,y]);var g=o.useMemo((function(){return{open:p===de.Open,disabled:u}}),[p,u]);return i.createElement(we.Provider,{value:s},d(a,g,Oe))}var Re,Le,Te,Fe=v((function e(t,n){var i,u=Ce([ke.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.buttonRef,n),f="headlessui-listbox-button-"+E(),p=be(),v=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:case r.ArrowDown:e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;null==(e=l.optionsRef.current)||e.focus({preventScroll:!0}),l.propsRef.current.value||c({type:pe.GoToOption,focus:se.First})}));break;case r.ArrowUp:e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;null==(e=l.optionsRef.current)||e.focus({preventScroll:!0}),l.propsRef.current.value||c({type:pe.GoToOption,focus:se.Last})}))}}),[c,l,p]),m=o.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();l.listboxState===de.Open?(c({type:pe.CloseListbox}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;return null==(e=l.optionsRef.current)?void 0:e.focus({preventScroll:!0})})))}),[c,p,l]),b=ge((function(){if(l.labelRef.current)return[l.labelRef.current.id,f].join(" ")}),[l.labelRef.current,f]),g=o.useMemo((function(){return{open:l.listboxState===de.Open,disabled:l.disabled}}),[l]);return d(a({},t,{ref:s,id:f,type:"button","aria-haspopup":!0,"aria-controls":null==(i=l.optionsRef.current)?void 0:i.id,"aria-expanded":l.listboxState===de.Open||void 0,"aria-labelledby":b,disabled:l.disabled,onKeyDown:v,onClick:m}),g,"button")})),De=t.RenderStrategy|t.Static,Pe=v((function e(t,n){var i,u=Ce([ke.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.optionsRef,n),f="headlessui-listbox-options-"+E(),p=be(),v=be(),m=o.useCallback((function(e){switch(v.dispose(),e.key){case r.Space:if(""!==l.searchQuery)return e.preventDefault(),c({type:pe.Search,value:e.key});case r.Enter:e.preventDefault(),c({type:pe.CloseListbox}),null!==l.activeOptionIndex&&l.propsRef.current.onChange(l.options[l.activeOptionIndex].dataRef.current.value),ye().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.ArrowDown:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Next});case r.ArrowUp:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Previous});case r.Home:case r.PageUp:return e.preventDefault(),c({type:pe.GoToOption,focus:se.First});case r.End:case r.PageDown:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Last});case r.Escape:return e.preventDefault(),c({type:pe.CloseListbox}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case r.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:pe.Search,value:e.key}),v.setTimeout((function(){return c({type:pe.ClearSearch})}),350))}}),[p,c,v,l]),y=ge((function(){var e,t,n;return null!=(e=null==(t=l.labelRef.current)?void 0:t.id)?e:null==(n=l.buttonRef.current)?void 0:n.id}),[l.labelRef.current,l.buttonRef.current]),b=o.useMemo((function(){return{open:l.listboxState===de.Open}}),[l]);return d(a({},t,{"aria-activedescendant":null===l.activeOptionIndex||null==(i=l.options[l.activeOptionIndex])?void 0:i.id,"aria-labelledby":y,id:f,onKeyDown:m,role:"listbox",tabIndex:0,ref:s}),b,"ul",De,l.listboxState===de.Open)}));ke.Button=Fe,ke.Label=function e(t){var n=Ce([ke.name,e.name].join("."))[0],r="headlessui-listbox-label-"+E(),i=o.useCallback((function(){var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[n.buttonRef]),u=o.useMemo((function(){return{open:n.listboxState===de.Open,disabled:n.disabled}}),[n]);return d(a({},t,{ref:n.labelRef,id:r,onClick:i}),u,"label")},ke.Options=Pe,ke.Option=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.value,u=t.className,c=l(t,["disabled","value","className"]),s=Ce([ke.name,e.name].join(".")),f=s[0],p=s[1],v="headlessui-listbox-option-"+E(),m=null!==f.activeOptionIndex&&f.options[f.activeOptionIndex].id===v,h=f.propsRef.current.value===i,y=o.useRef({disabled:r,value:i});b((function(){y.current.disabled=r}),[y,r]),b((function(){y.current.value=i}),[y,i]),b((function(){var e,t;y.current.textValue=null==(e=document.getElementById(v))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[y,v]);var g=o.useCallback((function(){return f.propsRef.current.onChange(i)}),[f.propsRef,i]);b((function(){return p({type:pe.RegisterOption,id:v,dataRef:y}),function(){return p({type:pe.UnregisterOption,id:v})}}),[y,v]),b((function(){var e;f.listboxState===de.Open&&h&&(p({type:pe.GoToOption,focus:se.Specific,id:v}),null==(e=document.getElementById(v))||null==e.focus||e.focus())}),[f.listboxState]),b((function(){if(f.listboxState===de.Open&&m){var e=ye();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[v,m,f.listboxState]);var S=o.useCallback((function(e){if(r)return e.preventDefault();g(),p({type:pe.CloseListbox}),ye().nextFrame((function(){var e;return null==(e=f.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[p,f.buttonRef,r,g]),x=o.useCallback((function(){if(r)return p({type:pe.GoToOption,focus:se.Nothing});p({type:pe.GoToOption,focus:se.Specific,id:v})}),[r,v,p]),w=o.useCallback((function(){r||m||p({type:pe.GoToOption,focus:se.Specific,id:v})}),[r,m,v,p]),C=o.useCallback((function(){r||m&&p({type:pe.GoToOption,focus:se.Nothing})}),[r,m,p]),I=o.useMemo((function(){return{active:m,selected:h,disabled:r}}),[m,h,r]);return d(a({},c,{id:v,role:"option",tabIndex:-1,className:xe(u,I),"aria-disabled":!0===r||void 0,"aria-selected":!0===h||void 0,onClick:S,onFocus:x,onPointerMove:w,onMouseMove:w,onPointerLeave:C,onMouseLeave:C}),I,"li")},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Le||(Le={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Te||(Te={}));var Me=((Re={})[Te.CloseMenu]=function(e){return a({},e,{activeItemIndex:null,menuState:Le.Closed})},Re[Te.OpenMenu]=function(e){return a({},e,{menuState:Le.Open})},Re[Te.GoToItem]=function(e,t){var n=Se(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:a({},e,{searchQuery:"",activeItemIndex:n})},Re[Te.Search]=function(e,t){var n=e.searchQuery+t.value,r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return a({},e,-1===r||r===e.activeItemIndex?{searchQuery:n}:{searchQuery:n,activeItemIndex:r})},Re[Te.ClearSearch]=function(e){return a({},e,{searchQuery:""})},Re[Te.RegisterItem]=function(e,t){return a({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},Re[Te.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),a({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},Re),Ae=o.createContext(null);function Ne(e){var t=o.useContext(Ae);if(null===t){var n=new Error("<"+e+" /> is missing a parent <"+Ue.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ne),n}return t}function je(e,t){return f(t.type,Me,e,t)}Ae.displayName="MenuContext";var Ge=o.Fragment;function Ue(e){var t=o.useReducer(je,{menuState:Le.Closed,buttonRef:o.createRef(),itemsRef:o.createRef(),items:[],searchQuery:"",activeItemIndex:null}),n=t[0],r=n.menuState,u=n.itemsRef,a=n.buttonRef,l=t[1];o.useEffect((function(){function e(e){var t,n,o,i=e.target,c=document.activeElement;r===Le.Open&&((null==(t=a.current)?void 0:t.contains(i))||((null==(n=u.current)?void 0:n.contains(i))||l({type:Te.CloseMenu}),c!==document.body&&(null==c?void 0:c.contains(i))||e.defaultPrevented||null==(o=a.current)||o.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[r,u,a,l]);var c=o.useMemo((function(){return{open:r===Le.Open}}),[r]);return i.createElement(Ae.Provider,{value:t},d(e,c,Ge))}var He=v((function e(t,n){var i,u=Ne([Ue.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.buttonRef,n),f="headlessui-menu-button-"+E(),p=be(),v=o.useCallback((function(e){switch(e.key){case r.Space:case r.Enter:case r.ArrowDown:e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;null==(e=l.itemsRef.current)||e.focus({preventScroll:!0}),c({type:Te.GoToItem,focus:se.First})}));break;case r.ArrowUp:e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;null==(e=l.itemsRef.current)||e.focus({preventScroll:!0}),c({type:Te.GoToItem,focus:se.Last})}))}}),[c,l,p]),m=o.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();t.disabled||(l.menuState===Le.Open?(c({type:Te.CloseMenu}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;return null==(e=l.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,p,l,t.disabled]),b=o.useMemo((function(){return{open:l.menuState===Le.Open}}),[l]);return d(a({},t,{ref:s,id:f,type:"button","aria-haspopup":!0,"aria-controls":null==(i=l.itemsRef.current)?void 0:i.id,"aria-expanded":l.menuState===Le.Open||void 0,onKeyDown:v,onClick:m}),b,"button")})),Be=t.RenderStrategy|t.Static,Ve=v((function e(t,n){var i,u,l=Ne([Ue.name,e.name].join(".")),c=l[0],s=l[1],f=h(c.itemsRef,n),p="headlessui-menu-items-"+E(),v=be();b((function(){var e=c.itemsRef.current;if(e&&c.menuState===Le.Open)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")}));var m=o.useCallback((function(e){switch(v.dispose(),e.key){case r.Space:if(""!==c.searchQuery)return e.preventDefault(),s({type:Te.Search,value:e.key});case r.Enter:var t;e.preventDefault(),s({type:Te.CloseMenu}),null!==c.activeItemIndex&&(null==(t=document.getElementById(c.items[c.activeItemIndex].id))||t.click()),ye().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.ArrowDown:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Next});case r.ArrowUp:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Previous});case r.Home:case r.PageUp:return e.preventDefault(),s({type:Te.GoToItem,focus:se.First});case r.End:case r.PageDown:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Last});case r.Escape:e.preventDefault(),s({type:Te.CloseMenu}),ye().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case r.Tab:return e.preventDefault();default:1===e.key.length&&(s({type:Te.Search,value:e.key}),v.setTimeout((function(){return s({type:Te.ClearSearch})}),350))}}),[s,v,c]),y=o.useMemo((function(){return{open:c.menuState===Le.Open}}),[c]);return d(a({},t,{"aria-activedescendant":null===c.activeItemIndex||null==(i=c.items[c.activeItemIndex])?void 0:i.id,"aria-labelledby":null==(u=c.buttonRef.current)?void 0:u.id,id:p,onKeyDown:m,role:"menu",tabIndex:0,ref:f}),y,"div",Be,c.menuState===Le.Open)})),_e=o.Fragment;Ue.Button=He,Ue.Items=Ve,Ue.Item=function e(t){var n=t.disabled,r=void 0!==n&&n,i=t.className,u=t.onClick,c=l(t,["disabled","className","onClick"]),s=Ne([Ue.name,e.name].join(".")),f=s[0],p=s[1],v="headlessui-menu-item-"+E(),m=null!==f.activeItemIndex&&f.items[f.activeItemIndex].id===v;b((function(){if(f.menuState===Le.Open&&m){var e=ye();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[v,m,f.menuState]);var h=o.useRef({disabled:r});b((function(){h.current.disabled=r}),[h,r]),b((function(){var e,t;h.current.textValue=null==(e=document.getElementById(v))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[h,v]),b((function(){return p({type:Te.RegisterItem,id:v,dataRef:h}),function(){return p({type:Te.UnregisterItem,id:v})}}),[h,v]);var y=o.useCallback((function(e){return r?e.preventDefault():(p({type:Te.CloseMenu}),ye().nextFrame((function(){var e;return null==(e=f.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),u?u(e):void 0)}),[p,f.buttonRef,r,u]),g=o.useCallback((function(){if(r)return p({type:Te.GoToItem,focus:se.Nothing});p({type:Te.GoToItem,focus:se.Specific,id:v})}),[r,v,p]),S=o.useCallback((function(){r||m||p({type:Te.GoToItem,focus:se.Specific,id:v})}),[r,m,v,p]),x=o.useCallback((function(){r||m&&p({type:Te.GoToItem,focus:se.Nothing})}),[r,m,p]),w=o.useMemo((function(){return{active:m,disabled:r}}),[m,r]);return d(a({},c,{id:v,role:"menuitem",tabIndex:-1,className:xe(i,w),"aria-disabled":!0===r||void 0,onClick:y,onFocus:g,onPointerMove:S,onMouseMove:S,onPointerLeave:x,onMouseLeave:x}),w,_e)};var Qe=o.createContext(null);function Ke(e){var t=o.useContext(Qe);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Ke),n}return t}Qe.displayName="GroupContext";var qe,We=o.Fragment;function Ye(e){var t,n,i=e.checked,u=e.onChange,c=e.className,s=l(e,["checked","onChange","className"]),f="headlessui-switch-"+E(),p=o.useContext(Qe),v=o.useCallback((function(){return u(!i)}),[u,i]),m=o.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();e.preventDefault(),v()}),[v]),h=o.useCallback((function(e){e.key!==r.Tab&&e.preventDefault(),e.key===r.Space&&v()}),[v]),b=o.useCallback((function(e){return e.preventDefault()}),[]),g=o.useMemo((function(){return{checked:i}}),[i]),S={id:f,ref:null===p?void 0:p.setSwitch,role:"switch",tabIndex:0,className:xe(c,g),"aria-checked":i,"aria-labelledby":null==p||null==(t=p.label)?void 0:t.id,"aria-describedby":null==p||null==(n=p.description)?void 0:n.id,onClick:m,onKeyUp:h,onKeyPress:b};return"button"===s.as&&Object.assign(S,{type:"button"}),d(a({},s,S),g,"button")}function Je(){var e=o.useRef(!0);return o.useEffect((function(){e.current=!1}),[]),e.current}function $e(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function ze(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function Xe(e,t,n,r,o){var i=ye(),u=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return $e.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){ze.apply(void 0,[e].concat(n)),$e.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=ye();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0];return 0!==i?n.setTimeout((function(){t(qe.Finished)}),i+o[1]):t(qe.Finished),n.add((function(){return t(qe.Cancelled)})),n.dispose}(e,(function(n){return ze.apply(void 0,[e].concat(r,t)),u(n)})))})),i.add((function(){return ze.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return u(qe.Cancelled)})),i.dispose}function Ze(e){return void 0===e&&(e=""),o.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}Ye.Group=function(e){var t=o.useState(null),n=t[0],r=t[1],u=o.useState(null),a=u[0],l=u[1],c=o.useState(null),s=c[0],f=c[1],p=o.useMemo((function(){return{switch:n,setSwitch:r,label:a,setLabel:l,description:s,setDescription:f}}),[n,r,a,l,s,f]);return i.createElement(Qe.Provider,{value:p},d(e,{},We))},Ye.Label=function e(t){var n=Ke([Ye.name,e.name].join(".")),r="headlessui-switch-label-"+E(),i=o.useCallback((function(){n.switch&&(n.switch.click(),n.switch.focus({preventScroll:!0}))}),[n.switch]);return d(a({},t,{ref:n.setLabel,id:r,onClick:i}),{},"label")},Ye.Description=function e(t){var n=Ke([Ye.name,e.name].join(".")),r="headlessui-switch-description-"+E();return d(a({},t,{ref:n.setDescription,id:r}),{},"p")},function(e){e.Finished="finished",e.Cancelled="cancelled"}(qe||(qe={}));var et,tt=o.createContext(null);tt.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(et||(et={}));var nt=o.createContext(null);function rt(e){return"children"in e?rt(e.children):e.current.filter((function(e){return e.state===et.Visible})).length>0}function ot(e){var t=o.useRef(e),r=o.useRef([]),i=function(){var e=o.useRef(!0);return o.useEffect((function(){return function(){e.current=!1}}),[]),e}();o.useEffect((function(){t.current=e}),[e]);var u=o.useCallback((function(e,o){var u;void 0===o&&(o=n.Hidden);var a=r.current.findIndex((function(t){return t.id===e}));-1!==a&&(f(o,((u={})[n.Unmount]=function(){r.current.splice(a,1)},u[n.Hidden]=function(){r.current[a].state=et.Hidden},u)),!rt(r)&&i.current&&(null==t.current||t.current()))}),[t,i,r]),a=o.useCallback((function(e){var t=r.current.find((function(t){return t.id===e}));return t?t.state!==et.Visible&&(t.state=et.Visible):r.current.push({id:e,state:et.Visible}),function(){return u(e,n.Unmount)}}),[r,u]);return o.useMemo((function(){return{children:r,register:a,unregister:u}}),[a,u,r])}function it(){}nt.displayName="NestingContext";var ut=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function at(e){for(var t,n={},r=s(ut);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:it}return n}var lt=t.RenderStrategy;function ct(e){var t=e.beforeEnter,r=e.afterEnter,u=e.beforeLeave,c=e.afterLeave,s=e.enter,p=e.enterFrom,v=e.enterTo,m=e.leave,h=e.leaveFrom,y=e.leaveTo,g=l(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),S=o.useRef(null),x=o.useState(et.Visible),w=x[0],C=x[1],I=g.unmount?n.Unmount:n.Hidden,O=function(){var e=o.useContext(tt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),k=O.show,R=O.appear,L=function(){var e=o.useContext(nt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),T=L.register,F=L.unregister,D=Je(),P=E(),M=o.useRef(!1),A=ot((function(){M.current||(C(et.Hidden),F(P),V.current.afterLeave())}));b((function(){if(P)return T(P)}),[T,P]),b((function(){var e;I===n.Hidden&&P&&(k&&w!==et.Visible?C(et.Visible):f(w,((e={})[et.Hidden]=function(){return F(P)},e[et.Visible]=function(){return T(P)},e)))}),[w,P,T,F,k,I]);var N=Ze(s),j=Ze(p),G=Ze(v),U=Ze(m),H=Ze(h),B=Ze(y),V=function(e){var t=o.useRef(at(e));return o.useEffect((function(){t.current=at(e)}),[e]),t}({beforeEnter:t,afterEnter:r,beforeLeave:u,afterLeave:c});o.useEffect((function(){if(w===et.Visible&&null===S.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[S,w]);var _=D&&!R;return b((function(){var e=S.current;if(e&&!_)return M.current=!0,k&&V.current.beforeEnter(),k||V.current.beforeLeave(),k?Xe(e,N,j,G,(function(e){M.current=!1,e===qe.Finished&&V.current.afterEnter()})):Xe(e,U,H,B,(function(e){M.current=!1,e===qe.Finished&&(rt(A)||(C(et.Hidden),F(P),V.current.afterLeave()))}))}),[V,P,M,F,A,S,_,k,N,j,G,U,H,B]),i.createElement(nt.Provider,{value:A},d(a({},g,{ref:S}),{},"div",lt,w===et.Visible))}function st(e){var t=e.show,n=e.appear,r=void 0!==n&&n,u=e.unmount,c=l(e,["show","appear","unmount"]);if(![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=o.useState(t?et.Visible:et.Hidden),f=s[0],p=s[1],v=ot((function(){p(et.Hidden)})),m=Je(),h=o.useMemo((function(){return{show:t,appear:r||!m}}),[t,r,m]);o.useEffect((function(){t?p(et.Visible):rt(v)||p(et.Hidden)}),[t,v]);var y={unmount:u};return i.createElement(nt.Provider,{value:v},i.createElement(tt.Provider,{value:h},d(a({},y,{as:o.Fragment,children:i.createElement(ct,Object.assign({},y,c))}),{},o.Fragment,lt,f===et.Visible)))}st.Child=ct,exports.Dialog=_,exports.Disclosure=J,exports.Flyout=ce,exports.FocusTrap=function(e){var t=o.useRef(null),n=e.initialFocus,r=l(e,["initialFocus"]);return I(t,!0,{initialFocus:n}),d(a({},r,{ref:t}),{},"div")},exports.Listbox=ke,exports.Menu=Ue,exports.Portal=M,exports.Switch=Ye,exports.Transition=st; | ||
//# sourceMappingURL=headlessui.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).headlessui={},e.React)}(this,(function(e,n){"use strict";var t="default"in n?n.default:n;function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function o(e,n){if(null==e)return{};var t,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n.indexOf(t=u[r])>=0||(o[t]=e[t]);return o}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function i(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return u(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(e,void 0):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}var a,c,l,s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,f={serverHandoffComplete:!1},d=0;function v(){return++d}function p(){var e=n.useState(f.serverHandoffComplete?v:null),t=e[0],r=e[1];return s((function(){null===t&&r(v())}),[t]),n.useEffect((function(){!1===f.serverHandoffComplete&&(f.serverHandoffComplete=!0)}),[]),null!=t?""+t:void 0}function m(){var e=n.useRef(!0);return n.useEffect((function(){e.current=!1}),[]),e.current}function b(e,n){if(e in n){for(var t=n[e],r=arguments.length,o=new Array(r>2?r-2:0),u=2;u<r;u++)o[u-2]=arguments[u];return"function"==typeof t?t.apply(void 0,o):t}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(n).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,b),i}function y(e,n,t,u,i){if(void 0===i&&(i=!0),i)return h(e,n,t);var l=null!=u?u:a.None;if(l&a.Static){var s=e.static,f=void 0!==s&&s,d=o(e,["static"]);if(f)return h(d,n,t)}if(l&a.RenderStrategy){var v,p=e.unmount,m=void 0===p||p,y=o(e,["unmount"]);return b(m?c.Unmount:c.Hidden,((v={})[c.Unmount]=function(){return null},v[c.Hidden]=function(){return h(r({},y,{hidden:!0,style:{display:"none"}}),n,t)},v))}return h(e,n,t)}function h(e,t,r){var u,a=S(e,["unmount","static"]),c=a.as,l=void 0===c?r:c,s=a.children,f=a.refName,d=void 0===f?"ref":f,v=o(a,["as","children","refName"]),p=void 0!==e.ref?((u={})[d]=e.ref,u):{},m="function"==typeof s?s(t):s;if(l===n.Fragment&&Object.keys(v).length>0){if(Array.isArray(m)&&m.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,h),b}if(!n.isValidElement(m)){var y=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(y,h),y}return n.cloneElement(m,Object.assign({},function(e,n,t){for(var r,o=Object.assign({},e),u=function(){var t,u=r.value;void 0!==e[u]&&void 0!==n[u]&&Object.assign(o,((t={})[u]=function(t){t.defaultPrevented||e[u](t),t.defaultPrevented||n[u](t)},t))},a=i(["onClick"]);!(r=a()).done;)u();return o}(function(e){var n=Object.assign({},e);for(var t in n)void 0===n[t]&&delete n[t];return n}(S(v,["ref"])),m.props),p))}return n.createElement(l,Object.assign({},S(v,["ref"]),l!==n.Fragment&&p),m)}function x(e){return n.forwardRef(e)}function S(e,n){void 0===n&&(n=[]);for(var t,r=Object.assign({},e),o=i(n);!(t=o()).done;){var u=t.value;u in r&&delete r[u]}return r}function g(){var e=[],n={requestAnimationFrame:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=requestAnimationFrame.apply(void 0,arguments);n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n.requestAnimationFrame((function(){n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function n(){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(){var e=setTimeout.apply(void 0,arguments);n.add((function(){return clearTimeout(e)}))})),add:function(n){e.push(n)},dispose:function(){for(var n,t=i(e.splice(0));!(n=t()).done;)(0,n.value)()}};return n}function I(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).add.apply(n,r)}function C(e){for(var n,t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];e&&r.length>0&&(n=e.classList).remove.apply(n,r)}function O(e,n,t,r,o){var u=g(),i=void 0!==o?function(e){var n={called:!1};return function(){if(!n.called)return n.called=!0,e.apply(void 0,arguments)}}(o):function(){};return I.apply(void 0,[e].concat(n,t)),u.nextFrame((function(){C.apply(void 0,[e].concat(t)),I.apply(void 0,[e].concat(r)),u.add(function(e,n){var t=g();if(!e)return t.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var n=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,n){return n-e}))[0];return void 0===n?0:n})),u=o[0];return 0!==u?t.setTimeout((function(){n(l.Finished)}),u+o[1]):n(l.Finished),t.add((function(){return n(l.Cancelled)})),t.dispose}(e,(function(t){return C.apply(void 0,[e].concat(r,n)),i(t)})))})),u.add((function(){return C.apply(void 0,[e].concat(n,t,r))})),u.add((function(){return i(l.Cancelled)})),u.dispose}function R(e){return void 0===e&&(e=""),n.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(a||(a={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(c||(c={})),function(e){e.Finished="finished",e.Cancelled="cancelled"}(l||(l={}));var w,E=n.createContext(null);E.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(w||(w={}));var k=n.createContext(null);function T(e){return"children"in e?T(e.children):e.current.filter((function(e){return e.state===w.Visible})).length>0}function L(e){var t=n.useRef(e),r=n.useRef([]),o=function(){var e=n.useRef(!0);return n.useEffect((function(){return function(){e.current=!1}}),[]),e}();n.useEffect((function(){t.current=e}),[e]);var u=n.useCallback((function(e,n){var u;void 0===n&&(n=c.Hidden);var i=r.current.findIndex((function(n){return n.id===e}));-1!==i&&(b(n,((u={})[c.Unmount]=function(){r.current.splice(i,1)},u[c.Hidden]=function(){r.current[i].state=w.Hidden},u)),!T(r)&&o.current&&(null==t.current||t.current()))}),[t,o,r]),i=n.useCallback((function(e){var n=r.current.find((function(n){return n.id===e}));return n?n.state!==w.Visible&&(n.state=w.Visible):r.current.push({id:e,state:w.Visible}),function(){return u(e,c.Unmount)}}),[r,u]);return n.useMemo((function(){return{children:r,register:i,unregister:u}}),[i,u,r])}function D(){}k.displayName="NestingContext";var F=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function M(e){return F.reduce((function(n,t){return n[t]=e[t]||D,n}),{})}var A,N,P,G,j,H=a.RenderStrategy;function U(e){var u=e.beforeEnter,i=e.afterEnter,a=e.beforeLeave,f=e.afterLeave,d=e.enter,v=e.enterFrom,h=e.enterTo,x=e.leave,S=e.leaveFrom,g=e.leaveTo,I=o(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),C=n.useRef(null),D=n.useState(w.Visible),F=D[0],A=D[1],N=I.unmount?c.Unmount:c.Hidden,P=function(){var e=n.useContext(E);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),G=P.show,j=P.appear,U=function(){var e=n.useContext(k);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),V=U.register,Q=U.unregister,B=m(),K=p(),_=n.useRef(!1),q=L((function(){_.current||(A(w.Hidden),Q(K),Z.current.afterLeave())}));s((function(){if(K)return V(K)}),[V,K]),s((function(){var e;N===c.Hidden&&K&&(G&&F!==w.Visible?A(w.Visible):b(F,((e={})[w.Hidden]=function(){return Q(K)},e[w.Visible]=function(){return V(K)},e)))}),[F,K,V,Q,G,N]);var W=R(d),Y=R(v),J=R(h),$=R(x),z=R(S),X=R(g),Z=function(e){var t=n.useRef(M(e));return n.useEffect((function(){t.current=M(e)}),[e]),t}({beforeEnter:u,afterEnter:i,beforeLeave:a,afterLeave:f});n.useEffect((function(){if(F===w.Visible&&null===C.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[C,F]);var ee=B&&!j;return s((function(){var e=C.current;if(e&&!ee)return _.current=!0,G&&Z.current.beforeEnter(),G||Z.current.beforeLeave(),G?O(e,W,Y,J,(function(e){_.current=!1,e===l.Finished&&Z.current.afterEnter()})):O(e,$,z,X,(function(e){_.current=!1,e===l.Finished&&(T(q)||(A(w.Hidden),Q(K),Z.current.afterLeave()))}))}),[Z,K,_,Q,q,C,ee,G,W,Y,J,$,z,X]),t.createElement(k.Provider,{value:q},y(r({},I,{ref:C}),{},"div",H,F===w.Visible))}function V(e){var u=e.show,i=e.appear,a=void 0!==i&&i,c=e.unmount,l=o(e,["show","appear","unmount"]);if(![!0,!1].includes(u))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=n.useState(u?w.Visible:w.Hidden),f=s[0],d=s[1],v=L((function(){d(w.Hidden)})),p=m(),b=n.useMemo((function(){return{show:u,appear:a||!p}}),[u,a,p]);n.useEffect((function(){u?d(w.Visible):T(v)||d(w.Hidden)}),[u,v]);var h={unmount:c};return t.createElement(k.Provider,{value:v},t.createElement(E.Provider,{value:b},y(r({},h,{as:n.Fragment,children:t.createElement(U,Object.assign({},h,l))}),{},n.Fragment,H,f===w.Visible)))}function Q(){var e=n.useState(g)[0];return n.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.useCallback((function(e){t.forEach((function(n){if(null!==n)return"function"==typeof n?n(e):void(n.current=e)}))}),[t])}function K(e,n){var t=n.resolveItems();if(t.length<=0)return null;var r=n.resolveActiveIndex(),o=null!=r?r:-1,u=function(){switch(e.focus){case N.First:return t.findIndex((function(e){return!n.resolveDisabled(e)}));case N.Previous:var r=t.slice().reverse().findIndex((function(e,t,r){return!(-1!==o&&r.length-t-1>=o||n.resolveDisabled(e))}));return-1===r?r:t.length-1-r;case N.Next:return t.findIndex((function(e,t){return!(t<=o||n.resolveDisabled(e))}));case N.Last:var u=t.slice().reverse().findIndex((function(e){return!n.resolveDisabled(e)}));return-1===u?u:t.length-1-u;case N.Specific:return t.findIndex((function(t){return n.resolveId(t)===e.id}));case N.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===u?r:u}function _(e,n){if(void 0!==e)return"function"==typeof e?e(n):e}function q(e){for(var n,t,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var u=null!=(n=""===(null==(t=r)?void 0:t.getAttribute("disabled")))&&n;return(!u||!function(e){if(!e)return!1;for(var n=e.previousElementSibling;null!==n;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}(o))&&u}V.Child=U,function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(A||(A={})),function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(N||(N={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(G||(G={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(j||(j={}));var W=((P={})[j.CloseMenu]=function(e){return r({},e,{activeItemIndex:null,menuState:G.Closed})},P[j.OpenMenu]=function(e){return r({},e,{menuState:G.Open})},P[j.GoToItem]=function(e,n){var t=K(n,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===t?e:r({},e,{searchQuery:"",activeItemIndex:t})},P[j.Search]=function(e,n){var t=e.searchQuery+n.value,o=e.items.findIndex((function(e){var n;return(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))&&!e.dataRef.current.disabled}));return r({},e,-1===o||o===e.activeItemIndex?{searchQuery:t}:{searchQuery:t,activeItemIndex:o})},P[j.ClearSearch]=function(e){return r({},e,{searchQuery:""})},P[j.RegisterItem]=function(e,n){return r({},e,{items:[].concat(e.items,[{id:n.id,dataRef:n.dataRef}])})},P[j.UnregisterItem]=function(e,n){var t=e.items.slice(),o=null!==e.activeItemIndex?t[e.activeItemIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{items:t,activeItemIndex:u===e.activeItemIndex||null===o?null:t.indexOf(o)})},P),Y=n.createContext(null);function J(e){var t=n.useContext(Y);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+X.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,J),r}return t}function $(e,n){return b(n.type,W,e,n)}Y.displayName="MenuContext";var z=n.Fragment;function X(e){var r=n.useReducer($,{menuState:G.Closed,buttonRef:n.createRef(),itemsRef:n.createRef(),items:[],searchQuery:"",activeItemIndex:null}),o=r[0],u=o.menuState,i=o.itemsRef,a=o.buttonRef,c=r[1];n.useEffect((function(){function e(e){var n,t,r,o=e.target,l=document.activeElement;u===G.Open&&((null==(n=a.current)?void 0:n.contains(o))||((null==(t=i.current)?void 0:t.contains(o))||c({type:j.CloseMenu}),l!==document.body&&(null==l?void 0:l.contains(o))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[u,i,a,c]);var l=n.useMemo((function(){return{open:u===G.Open}}),[u]);return t.createElement(Y.Provider,{value:r},y(e,l,z))}var Z,ee,ne,te=x((function e(t,o){var u,i=J([X.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-menu-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;null==(e=a.itemsRef.current)||e.focus({preventScroll:!0}),c({type:j.GoToItem,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();t.disabled||(a.menuState===G.Open?(c({type:j.CloseMenu}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:j.OpenMenu}),f.nextFrame((function(){var e;return null==(e=a.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,f,a,t.disabled]),m=n.useMemo((function(){return{open:a.menuState===G.Open}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.itemsRef.current)?void 0:u.id,"aria-expanded":a.menuState===G.Open||void 0,onKeyDown:d,onClick:v}),m,"button")})),re=a.RenderStrategy|a.Static,oe=x((function e(t,o){var u,i,a=J([X.name,e.name].join(".")),c=a[0],l=a[1],f=B(c.itemsRef,o),d="headlessui-menu-items-"+p(),v=Q();s((function(){var e=c.itemsRef.current;if(e&&c.menuState===G.Open)for(var n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});n.nextNode();)n.currentNode.setAttribute("role","none")}));var m=n.useCallback((function(e){switch(v.dispose(),e.key){case A.Space:if(""!==c.searchQuery)return e.preventDefault(),l({type:j.Search,value:e.key});case A.Enter:var n;e.preventDefault(),l({type:j.CloseMenu}),null!==c.activeItemIndex&&(null==(n=document.getElementById(c.items[c.activeItemIndex].id))||n.click()),g().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Next});case A.ArrowUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),l({type:j.GoToItem,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),l({type:j.GoToItem,focus:N.Last});case A.Escape:e.preventDefault(),l({type:j.CloseMenu}),g().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.Tab:return e.preventDefault();default:1===e.key.length&&(l({type:j.Search,value:e.key}),v.setTimeout((function(){return l({type:j.ClearSearch})}),350))}}),[l,v,c]),b=n.useMemo((function(){return{open:c.menuState===G.Open}}),[c]);return y(r({},t,{"aria-activedescendant":null===c.activeItemIndex||null==(u=c.items[c.activeItemIndex])?void 0:u.id,"aria-labelledby":null==(i=c.buttonRef.current)?void 0:i.id,id:d,onKeyDown:m,role:"menu",tabIndex:0,ref:f}),b,"div",re,c.menuState===G.Open)})),ue=n.Fragment;function ie(e,t){var r=n.useState(e),o=r[0],u=r[1],i=n.useRef(e);return s((function(){i.current=e}),[e]),s((function(){return u(i.current)}),[i,u].concat(t)),o}X.Button=te,X.Items=oe,X.Item=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.className,c=t.onClick,l=o(t,["disabled","className","onClick"]),f=J([X.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-menu-item-"+p(),b=null!==d.activeItemIndex&&d.items[d.activeItemIndex].id===m;s((function(){if(d.menuState===G.Open&&b){var e=g();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.menuState]);var h=n.useRef({disabled:i});s((function(){h.current.disabled=i}),[h,i]),s((function(){var e,n;h.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[h,m]),s((function(){return v({type:j.RegisterItem,id:m,dataRef:h}),function(){return v({type:j.UnregisterItem,id:m})}}),[h,m]);var x=n.useCallback((function(e){return i?e.preventDefault():(v({type:j.CloseMenu}),g().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),c?c(e):void 0)}),[v,d.buttonRef,i,c]),S=n.useCallback((function(){if(i)return v({type:j.GoToItem,focus:N.Nothing});v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,m,v]),I=n.useCallback((function(){i||b||v({type:j.GoToItem,focus:N.Specific,id:m})}),[i,b,m,v]),C=n.useCallback((function(){i||b&&v({type:j.GoToItem,focus:N.Nothing})}),[i,b,v]),O=n.useMemo((function(){return{active:b,disabled:i}}),[b,i]);return y(r({},l,{id:m,role:"menuitem",tabIndex:-1,className:_(a,O),"aria-disabled":!0===i||void 0,onClick:x,onFocus:S,onPointerMove:I,onMouseMove:I,onPointerLeave:C,onMouseLeave:C}),O,ue)},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(ee||(ee={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(ne||(ne={}));var ae=((Z={})[ne.CloseListbox]=function(e){return e.disabled||e.listboxState===ee.Closed?e:r({},e,{activeOptionIndex:null,listboxState:ee.Closed})},Z[ne.OpenListbox]=function(e){return e.disabled||e.listboxState===ee.Open?e:r({},e,{listboxState:ee.Open})},Z[ne.SetDisabled]=function(e,n){return e.disabled===n.disabled?e:r({},e,{disabled:n.disabled})},Z[ne.GoToOption]=function(e,n){if(e.disabled)return e;if(e.listboxState===ee.Closed)return e;var t=K(n,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===t?e:r({},e,{searchQuery:"",activeOptionIndex:t})},Z[ne.Search]=function(e,n){if(e.disabled)return e;if(e.listboxState===ee.Closed)return e;var t=e.searchQuery+n.value,o=e.options.findIndex((function(e){var n;return!e.dataRef.current.disabled&&(null==(n=e.dataRef.current.textValue)?void 0:n.startsWith(t))}));return r({},e,-1===o||o===e.activeOptionIndex?{searchQuery:t}:{searchQuery:t,activeOptionIndex:o})},Z[ne.ClearSearch]=function(e){return e.disabled||e.listboxState===ee.Closed||""===e.searchQuery?e:r({},e,{searchQuery:""})},Z[ne.RegisterOption]=function(e,n){return r({},e,{options:[].concat(e.options,[{id:n.id,dataRef:n.dataRef}])})},Z[ne.UnregisterOption]=function(e,n){var t=e.options.slice(),o=null!==e.activeOptionIndex?t[e.activeOptionIndex]:null,u=t.findIndex((function(e){return e.id===n.id}));return-1!==u&&t.splice(u,1),r({},e,{options:t,activeOptionIndex:u===e.activeOptionIndex||null===o?null:t.indexOf(o)})},Z),ce=n.createContext(null);function le(e){var t=n.useContext(ce);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+de.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,le),r}return t}function se(e,n){return b(n.type,ae,e,n)}ce.displayName="ListboxContext";var fe=n.Fragment;function de(e){var r=e.value,u=e.onChange,i=e.disabled,a=void 0!==i&&i,c=o(e,["value","onChange","disabled"]),l=Q(),f=n.useReducer(se,{listboxState:ee.Closed,propsRef:{current:{value:r,onChange:u}},labelRef:n.createRef(),buttonRef:n.createRef(),optionsRef:n.createRef(),disabled:a,options:[],searchQuery:"",activeOptionIndex:null}),d=f[0],v=d.listboxState,p=d.propsRef,m=d.optionsRef,b=d.buttonRef,h=f[1];s((function(){p.current.value=r}),[r,p]),s((function(){p.current.onChange=u}),[u,p]),s((function(){return h({type:ne.SetDisabled,disabled:a})}),[a]),n.useEffect((function(){function e(e){var n,t,r,o=e.target,u=document.activeElement;v===ee.Open&&((null==(n=b.current)?void 0:n.contains(o))||((null==(t=m.current)?void 0:t.contains(o))||h({type:ne.CloseListbox}),u!==document.body&&(null==u?void 0:u.contains(o))||e.defaultPrevented||null==(r=b.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[v,m,b,l,h]);var x=n.useMemo((function(){return{open:v===ee.Open,disabled:a}}),[v,a]);return t.createElement(ce.Provider,{value:f},y(c,x,fe))}var ve=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.buttonRef,o),s="headlessui-listbox-button-"+p(),f=Q(),d=n.useCallback((function(e){switch(e.key){case A.Space:case A.Enter:case A.ArrowDown:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.First})}));break;case A.ArrowUp:e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;null==(e=a.optionsRef.current)||e.focus({preventScroll:!0}),a.propsRef.current.value||c({type:ne.GoToOption,focus:N.Last})}))}}),[c,a,f]),v=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();a.listboxState===ee.Open?(c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:ne.OpenListbox}),f.nextFrame((function(){var e;return null==(e=a.optionsRef.current)?void 0:e.focus({preventScroll:!0})})))}),[c,f,a]),m=ie((function(){if(a.labelRef.current)return[a.labelRef.current.id,s].join(" ")}),[a.labelRef.current,s]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open,disabled:a.disabled}}),[a]);return y(r({},t,{ref:l,id:s,type:"button","aria-haspopup":!0,"aria-controls":null==(u=a.optionsRef.current)?void 0:u.id,"aria-expanded":a.listboxState===ee.Open||void 0,"aria-labelledby":m,disabled:a.disabled,onKeyDown:d,onClick:v}),b,"button")})),pe=a.RenderStrategy|a.Static,me=x((function e(t,o){var u,i=le([de.name,e.name].join(".")),a=i[0],c=i[1],l=B(a.optionsRef,o),s="headlessui-listbox-options-"+p(),f=Q(),d=Q(),v=n.useCallback((function(e){switch(d.dispose(),e.key){case A.Space:if(""!==a.searchQuery)return e.preventDefault(),c({type:ne.Search,value:e.key});case A.Enter:e.preventDefault(),c({type:ne.CloseListbox}),null!==a.activeOptionIndex&&a.propsRef.current.onChange(a.options[a.activeOptionIndex].dataRef.current.value),g().nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A.ArrowDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Next});case A.ArrowUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Previous});case A.Home:case A.PageUp:return e.preventDefault(),c({type:ne.GoToOption,focus:N.First});case A.End:case A.PageDown:return e.preventDefault(),c({type:ne.GoToOption,focus:N.Last});case A.Escape:return e.preventDefault(),c({type:ne.CloseListbox}),f.nextFrame((function(){var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case A.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:ne.Search,value:e.key}),d.setTimeout((function(){return c({type:ne.ClearSearch})}),350))}}),[f,c,d,a]),m=ie((function(){var e,n,t;return null!=(e=null==(n=a.labelRef.current)?void 0:n.id)?e:null==(t=a.buttonRef.current)?void 0:t.id}),[a.labelRef.current,a.buttonRef.current]),b=n.useMemo((function(){return{open:a.listboxState===ee.Open}}),[a]);return y(r({},t,{"aria-activedescendant":null===a.activeOptionIndex||null==(u=a.options[a.activeOptionIndex])?void 0:u.id,"aria-labelledby":m,id:s,onKeyDown:v,role:"listbox",tabIndex:0,ref:l}),b,"ul",pe,a.listboxState===ee.Open)}));de.Button=ve,de.Label=function e(t){var o=le([de.name,e.name].join("."))[0],u="headlessui-listbox-label-"+p(),i=n.useCallback((function(){var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[o.buttonRef]),a=n.useMemo((function(){return{open:o.listboxState===ee.Open,disabled:o.disabled}}),[o]);return y(r({},t,{ref:o.labelRef,id:u,onClick:i}),a,"label")},de.Options=me,de.Option=function e(t){var u=t.disabled,i=void 0!==u&&u,a=t.value,c=t.className,l=o(t,["disabled","value","className"]),f=le([de.name,e.name].join(".")),d=f[0],v=f[1],m="headlessui-listbox-option-"+p(),b=null!==d.activeOptionIndex&&d.options[d.activeOptionIndex].id===m,h=d.propsRef.current.value===a,x=n.useRef({disabled:i,value:a});s((function(){x.current.disabled=i}),[x,i]),s((function(){x.current.value=a}),[x,a]),s((function(){var e,n;x.current.textValue=null==(e=document.getElementById(m))||null==(n=e.textContent)?void 0:n.toLowerCase()}),[x,m]);var S=n.useCallback((function(){return d.propsRef.current.onChange(a)}),[d.propsRef,a]);s((function(){return v({type:ne.RegisterOption,id:m,dataRef:x}),function(){return v({type:ne.UnregisterOption,id:m})}}),[x,m]),s((function(){var e;d.listboxState===ee.Open&&h&&(v({type:ne.GoToOption,focus:N.Specific,id:m}),null==(e=document.getElementById(m))||null==e.focus||e.focus())}),[d.listboxState]),s((function(){if(d.listboxState===ee.Open&&b){var e=g();return e.nextFrame((function(){var e;return null==(e=document.getElementById(m))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[m,b,d.listboxState]);var I=n.useCallback((function(e){if(i)return e.preventDefault();S(),v({type:ne.CloseListbox}),g().nextFrame((function(){var e;return null==(e=d.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[v,d.buttonRef,i,S]),C=n.useCallback((function(){if(i)return v({type:ne.GoToOption,focus:N.Nothing});v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,m,v]),O=n.useCallback((function(){i||b||v({type:ne.GoToOption,focus:N.Specific,id:m})}),[i,b,m,v]),R=n.useCallback((function(){i||b&&v({type:ne.GoToOption,focus:N.Nothing})}),[i,b,v]),w=n.useMemo((function(){return{active:b,selected:h,disabled:i}}),[b,h,i]);return y(r({},l,{id:m,role:"option",tabIndex:-1,className:_(c,w),"aria-disabled":!0===i||void 0,"aria-selected":!0===h||void 0,onClick:I,onFocus:C,onPointerMove:O,onMouseMove:O,onPointerLeave:R,onMouseLeave:R}),w,"li")};var be=n.createContext(null);function ye(e){var t=n.useContext(be);if(null===t){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,ye),r}return t}be.displayName="GroupContext";var he=n.Fragment;function xe(e){var t,u=e.checked,i=e.onChange,a=e.className,c=o(e,["checked","onChange","className"]),l="headlessui-switch-"+p(),s=n.useContext(be),f=n.useCallback((function(){return i(!u)}),[i,u]),d=n.useCallback((function(e){if(q(e.currentTarget))return e.preventDefault();e.preventDefault(),f()}),[f]),v=n.useCallback((function(e){e.key!==A.Tab&&e.preventDefault(),e.key===A.Space&&f()}),[f]),m=n.useCallback((function(e){return e.preventDefault()}),[]),b=n.useMemo((function(){return{checked:u}}),[u]),h={id:l,ref:null===s?void 0:s.setSwitch,role:"switch",tabIndex:0,className:_(a,b),"aria-checked":u,"aria-labelledby":null==s||null==(t=s.label)?void 0:t.id,onClick:d,onKeyUp:v,onKeyPress:m};return"button"===c.as&&Object.assign(h,{type:"button"}),y(r({},c,h),b,"button")}xe.Group=function(e){var r=n.useState(null),o=r[0],u=r[1],i=n.useState(null),a=i[0],c=i[1],l=n.useMemo((function(){return{switch:o,label:a,setSwitch:u,setLabel:c}}),[o,u,a,c]);return t.createElement(be.Provider,{value:l},y(e,{},he))},xe.Label=function e(t){var o=ye([xe.name,e.name].join(".")),u="headlessui-switch-label-"+p(),i=n.useCallback((function(){o.switch&&(o.switch.click(),o.switch.focus({preventScroll:!0}))}),[o.switch]);return y(r({},t,{ref:o.setLabel,id:u,onClick:i}),{},"label")},e.Listbox=de,e.Menu=X,e.Switch=xe,e.Transition=V,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self).headlessui={},e.React,e.reactDom)}(this,(function(e,t,n){"use strict";var r,o,i,u="default"in t?t.default:t;function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function f(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var u=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(u,f),u}function d(e,t,n,i,u){if(void 0===u&&(u=!0),u)return p(e,t,n);var c=null!=i?i:r.None;if(c&r.Static){var s=e.static,d=void 0!==s&&s,v=l(e,["static"]);if(d)return p(v,t,n)}if(c&r.RenderStrategy){var m,h=e.unmount,y=void 0===h||h,b=l(e,["unmount"]);return f(y?o.Unmount:o.Hidden,((m={})[o.Unmount]=function(){return null},m[o.Hidden]=function(){return p(a({},b,{hidden:!0,style:{display:"none"}}),t,n)},m))}return p(e,t,n)}function p(e,n,r){var o,i=m(e,["unmount","static"]),u=i.as,a=void 0===u?r:u,c=i.children,f=i.refName,d=void 0===f?"ref":f,v=l(i,["as","children","refName"]),h=void 0!==e.ref?((o={})[d]=e.ref,o):{},y="function"==typeof c?c(n):c;if(a===t.Fragment&&Object.keys(v).length>0){if(Array.isArray(y)&&y.length>1){var b=new Error("You should only render 1 child");throw Error.captureStackTrace&&Error.captureStackTrace(b,p),b}if(!t.isValidElement(y)){var g=new Error('You should render an element as a child. Did you forget the as="..." prop?');throw Error.captureStackTrace&&Error.captureStackTrace(g,p),g}return t.cloneElement(y,Object.assign({},function(e,t,n){for(var r,o=Object.assign({},e),i=function(){var n,i=r.value;void 0!==e[i]&&void 0!==t[i]&&Object.assign(o,((n={})[i]=function(n){n.defaultPrevented||e[i](n),n.defaultPrevented||t[i](n)},n))},u=s(["onClick"]);!(r=u()).done;)i();return o}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(m(v,["ref"])),y.props),h))}return t.createElement(a,Object.assign({},m(v,["ref"]),a!==t.Fragment&&h),y)}function v(e){return Object.assign(t.forwardRef(e),{name:e.name})}function m(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),o=s(t);!(n=o()).done;){var i=n.value;i in r&&delete r[i]}return r}function h(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.useCallback((function(e){n.forEach((function(t){if(null!=t)return"function"==typeof t?t(e):void(t.current=e)}))}),[n])}function y(e){for(var t,n,r=e.parentElement,o=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(o=r),r=r.parentElement;var i=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!i||!function(e){if(!e)return!1;for(var t=e.previousElementSibling;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(o))&&i}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(r||(r={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(o||(o={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(i||(i={}));var b="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,g={serverHandoffComplete:!1},S=0;function E(){return++S}function x(){var e=t.useState(g.serverHandoffComplete?E:null),n=e[0],r=e[1];return b((function(){null===n&&r(E())}),[n]),t.useEffect((function(){!1===g.serverHandoffComplete&&(g.serverHandoffComplete=!0)}),[]),null!=n?""+n:void 0}var w=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");function C(e){e&&e.focus({preventScroll:!0})}function I(e,n,r){void 0===n&&(n=!0),void 0===r&&(r={});var o=t.useRef("undefined"!=typeof window?document.activeElement:null),u=t.useRef(null),a=t.useRef(!1),l=t.useCallback((function(){return e.current?Array.from(e.current.querySelectorAll(w)):[]}),[e]);b((function(){var t,i,c,s;if(n){a.current=!0;var f,d=document.activeElement;if(null==(t=r.initialFocus)?void 0:t.current){if((null==(f=r.initialFocus)?void 0:f.current)===d)return}else if(null==(i=e.current)?void 0:i.contains(d))return;o.current=d;var p=l();if(p.length<=0)throw new Error("There are no focusable elements inside the <FocusTrap />");return function e(t){void 0!==t&&(C(t),document.activeElement!==t?e(p[p.indexOf(t)+1]):u.current=t)}(null!=(c=null==(s=r.initialFocus)?void 0:s.current)?c:p[0]),function(){a.current=!1,C(o.current),o.current=null,u.current=null}}}),[n,a,r.initialFocus]),b((function(){if(n)return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)};function e(e){if(e.key===i.Tab&&document.activeElement){e.preventDefault();var t=e.shiftKey?-1:1,n=l(),r=n.length,o=n.indexOf(document.activeElement);!function e(i){void 0===i&&(i=0);var a=(n.indexOf(document.activeElement)+r+t+i)%r,l=n[a];if(C(l),l!==document.activeElement){if(o===a)return;e(i+t)}else u.current=l}()}}}),[n,l]),b((function(){if(n&&e.current){var t=e.current;return window.addEventListener("focus",r,!0),function(){return window.removeEventListener("focus",r,!0)}}function r(e){var n=u.current;if(n&&a.current){var r=e.target;r&&r instanceof HTMLElement?t.contains(r)?(u.current=r,C(r)):(e.preventDefault(),e.stopPropagation(),C(n)):C(u.current)}}}),[n,a,e])}function O(e,t){return e(t={exports:{}},t.exports),t.exports}var k=O((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=Object.create((t&&t.prototype instanceof f?t:f).prototype),i=new w(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var a=S(u,n);if(a){if(a===s)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,i),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var s={};function f(){}function d(){}function p(){}var v={};v[o]=function(){return this};var m=Object.getPrototypeOf,h=m&&m(m(C([])));h&&h!==t&&n.call(h,o)&&(v=h);var y=p.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function g(e,t){var r;this._invoke=function(o,i){function u(){return new t((function(r,u){!function r(o,i,u,a){var l=c(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,a)}),(function(e){r("throw",e,u,a)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,a)}))}a(l.arg)}(o,i,r,u)}))}return r=r?r.then(u,u):u()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,s;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return d.prototype=y.constructor=p,p.constructor=d,d.displayName=a(p,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,u,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(g.prototype),g.prototype[i]=function(){return this},e.AsyncIterator=g,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var u=new g(l(t,n,r,o),i);return e.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},b(y),a(y,u,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return u.type="throw",u.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var a=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(a&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=e,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),R=k.mark(L);function L(e){var t;return k.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.parentElement){n.next=2;break}return n.abrupt("return");case 2:t=e.parentElement.firstChild;case 3:if(!t){n.next=10;break}if(!(t!==e&&t instanceof HTMLElement)){n.next=7;break}return n.next=7,t;case 7:t=t.nextSibling,n.next=3;break;case 10:case"end":return n.stop()}}),R)}var T,F,D,P=t.Fragment;function M(e){var r=t.useState((function(){if("undefined"==typeof window)return null;var e=document.getElementById("headlessui-portal-root");if(e)return e;var t=document.createElement("div");return t.setAttribute("id","headlessui-portal-root"),document.body.appendChild(t)}))[0],o=t.useState((function(){return"undefined"==typeof window?null:document.createElement("div")}))[0];return b((function(){if(r&&o)return r.appendChild(o),function(){r&&o&&(r.removeChild(o),r.childNodes.length<=0&&document.body.removeChild(r))}}),[r]),r&&o?n.createPortal(d(e,{},P),o):null}!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(F||(F={})),function(e){e[e.SetTitleElement=0]="SetTitleElement",e[e.SetDescriptionElement=1]="SetDescriptionElement"}(D||(D={}));var A=((T={})[D.SetTitleElement]=function(e,t){return e.titleElement===t.element?e:a({},e,{titleElement:t.element})},T[D.SetDescriptionElement]=function(e,t){return e.descriptionElement===t.element?e:a({},e,{descriptionElement:t.element})},T),N=t.createContext(null);function j(e){var n=t.useContext(N);if(null===n){var r=new Error("<"+e+" /> is missing a parent <"+_.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,j),r}return n}function G(e,t){return f(t.type,A,e,t)}N.displayName="DialogContext";var U,H,B,V=r.RenderStrategy|r.Static,_=Object.assign(v((function(e,n){var r,o,c=e.open,f=e.onClose,p=e.initialFocus,v=l(e,["open","onClose","initialFocus"]),m=t.useRef(null),y=h(m,n),g=e.hasOwnProperty("open"),S=e.hasOwnProperty("onClose");if(!g)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof c)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+c);if("function"!=typeof f)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+f);var E=c?F.Open:F.Closed,w=t.useReducer(G,{titleElement:null,descriptionElement:null}),C=w[0],O=w[1],k=t.useCallback((function(){return f(!1)}),[f]),R=t.useCallback((function(e){return O({type:D.SetTitleElement,element:e})}),[O]),T=t.useCallback((function(e){return O({type:D.SetDescriptionElement,element:e})}),[O]);t.useEffect((function(){function e(e){e.key===i.Escape&&E===F.Open&&k()}return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[k,E]),t.useEffect((function(){if(E===F.Open){var e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=n+"px",function(){document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}}),[E]),t.useEffect((function(){if(E===F.Open&&m.current){var e=new IntersectionObserver((function(e){for(var t,n=s(e);!(t=n()).done;){var r=t.value;0===r.boundingClientRect.x&&0===r.boundingClientRect.y&&0===r.boundingClientRect.width&&0===r.boundingClientRect.height&&k()}}));return e.observe(m.current),function(){return e.disconnect()}}}),[E,m,k]);var P=!!e.static||E===F.Open;I(m,P,{initialFocus:p}),function(e,t){void 0===t&&(t=!0),b((function(){if(t&&e.current){for(var n,r=e.current,o=new Map,i=s(L(r));!(n=i()).done;){var u=n.value;o.set(u,{"aria-hidden":u.getAttribute("aria-hidden"),inert:u.inert})}document.querySelectorAll("body > *").forEach((function(e){e!==r&&e instanceof HTMLElement&&(e.contains(r)||o.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}))}));for(var a,l=s(o.keys());!(a=l()).done;){var c=a.value;c.setAttribute("aria-hidden","true"),c.inert=!0}return function(){for(var e,t=s(o.entries());!(e=t()).done;){var n=e.value,r=n[0],i=n[1];null!==r&&(null===i["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",i["aria-hidden"]),r.inert=i.inert)}o.clear()}}}),[t])}(m,P);var A="headlessui-dialog-"+x(),j=t.useMemo((function(){return[{dialogState:E,close:k,setTitle:R,setDescription:T},C]}),[E,C,k,R,T]),U=t.useMemo((function(){return{open:E===F.Open}}),[E]),H={ref:y,id:A,role:"dialog","aria-modal":E===F.Open||void 0,"aria-labelledby":null==(r=C.titleElement)?void 0:r.id,"aria-describedby":null==(o=C.descriptionElement)?void 0:o.id};return u.createElement(M,null,u.createElement(N.Provider,{value:j},d(a({},v,H),U,"div",V,E===F.Open)))})),{Overlay:v((function e(n,r){var o=j([_.name,e.name].join("."))[0],i=o.dialogState,u=o.close,l=h(r),c="headlessui-dialog-overlay-"+x(),s=t.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();u()}),[u]),f=t.useMemo((function(){return{open:i===F.Open}}),[i]);return d(a({},n,{ref:l,id:c,"aria-hidden":!0,onClick:s}),f,"div")})),Title:function e(n){var r=j([_.name,e.name].join("."))[0],o=r.dialogState,i=r.setTitle,u="headlessui-dialog-title-"+x(),l=t.useMemo((function(){return{open:o===F.Open}}),[o]);return d(a({},n,{ref:i,id:u}),l,"h2")},Description:function e(n){var r=j([_.name,e.name].join("."))[0],o=r.dialogState,i=r.setDescription,u="headlessui-dialog-description-"+x(),l=t.useMemo((function(){return{open:o===F.Open}}),[o]);return d(a({},n,{ref:i,id:u}),l,"p")}});!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(H||(H={})),function(e){e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.SetButtonId=1]="SetButtonId",e[e.SetPanelId=2]="SetPanelId",e[e.LinkPanel=3]="LinkPanel",e[e.UnlinkPanel=4]="UnlinkPanel"}(B||(B={}));var Q=((U={})[B.ToggleDisclosure]=function(e){var t;return a({},e,{disclosureState:f(e.disclosureState,(t={},t[H.Open]=H.Closed,t[H.Closed]=H.Open,t))})},U[B.LinkPanel]=function(e){return!0===e.linkedPanel?e:a({},e,{linkedPanel:!0})},U[B.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:a({},e,{linkedPanel:!1})},U[B.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:a({},e,{buttonId:t.buttonId})},U[B.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:a({},e,{panelId:t.panelId})},U),K=t.createContext(null);function q(e){var n=t.useContext(K);if(null===n){var r=new Error("<"+e+" /> is missing a parent <"+J.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,q),r}return n}function W(e,t){return f(t.type,Q,e,t)}K.displayName="DisclosureContext";var Y=t.Fragment;function J(e){var n="headlessui-disclosure-button-"+x(),r="headlessui-disclosure-panel-"+x(),o=t.useReducer(W,{disclosureState:H.Closed,linkedPanel:!1,buttonId:n,panelId:r}),i=o[0].disclosureState,a=o[1];t.useEffect((function(){return a({type:B.SetButtonId,buttonId:n})}),[n,a]),t.useEffect((function(){return a({type:B.SetPanelId,panelId:r})}),[r,a]);var l=t.useMemo((function(){return{open:i===H.Open}}),[i]);return u.createElement(K.Provider,{value:o},d(e,l,Y))}var $,z,X,Z,ee=v((function e(n,r){var o=q([J.name,e.name].join(".")),u=o[0],l=o[1],c=h(r),s=t.useCallback((function(e){switch(e.key){case i.Space:case i.Enter:e.preventDefault(),l({type:B.ToggleDisclosure})}}),[l]),f=t.useCallback((function(e){y(e.currentTarget)||n.disabled||l({type:B.ToggleDisclosure})}),[l,n.disabled]),p=t.useMemo((function(){return{open:u.disclosureState===H.Open}}),[u]);return d(a({},n,{ref:c,id:u.buttonId,type:"button","aria-expanded":u.disclosureState===H.Open||void 0,"aria-controls":u.linkedPanel?u.panelId:void 0,onKeyDown:s,onClick:f}),p,"button")})),te=r.RenderStrategy|r.Static,ne=v((function e(n,r){var o=q([J.name,e.name].join(".")),i=o[0],u=o[1],l=h(r,(function(){i.linkedPanel||u({type:B.LinkPanel})}));t.useEffect((function(){return function(){return u({type:B.UnlinkPanel})}}),[u]),t.useEffect((function(){var e;i.disclosureState!==H.Closed||null!=(e=n.unmount)&&!e||u({type:B.UnlinkPanel})}),[i.disclosureState,n.unmount,u]);var c=t.useMemo((function(){return{open:i.disclosureState===H.Open}}),[i]);return d(a({},n,{ref:l,id:i.panelId}),c,"div",te,i.disclosureState===H.Open)}));J.Button=ee,J.Panel=ne,function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last"}(z||(z={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(X||(X={})),function(e){e[e.ToggleFlyout=0]="ToggleFlyout",e[e.CloseFlyout=1]="CloseFlyout",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel"}(Z||(Z={}));var re=(($={})[Z.ToggleFlyout]=function(e){var t;return a({},e,{flyoutState:f(e.flyoutState,(t={},t[X.Open]=X.Closed,t[X.Closed]=X.Open,t))})},$[Z.CloseFlyout]=function(e){return e.flyoutState===X.Closed?e:a({},e,{flyoutState:X.Closed})},$[Z.LinkPanel]=function(e){return!0===e.linkedPanel?e:a({},e,{linkedPanel:!0})},$[Z.UnlinkPanel]=function(e){return!1===e.linkedPanel?e:a({},e,{linkedPanel:!1})},$[Z.SetButtonId]=function(e,t){return e.buttonId===t.buttonId?e:a({},e,{buttonId:t.buttonId})},$[Z.SetPanelId]=function(e,t){return e.panelId===t.panelId?e:a({},e,{panelId:t.panelId})},$),oe=t.createContext(null);function ie(e){var n=t.useContext(oe);if(null===n){var r=new Error("<"+e+" /> is missing a parent <"+ce.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,ie),r}return n}oe.displayName="FlyoutContext";var ue=t.createContext(null);function ae(){return t.useContext(ue)}function le(e,t){return f(t.type,re,e,t)}function ce(e){var n,r="headlessui-flyout-button-"+x(),o="headlessui-flyout-panel-"+x(),i=t.useReducer(le,{flyoutState:X.Closed,linkedPanel:!1,buttonId:r,panelId:o}),a=i[0].flyoutState,l=i[1];t.useEffect((function(){return l({type:Z.SetButtonId,buttonId:r})}),[r,l]),t.useEffect((function(){return l({type:Z.SetPanelId,panelId:o})}),[o,l]);var c=t.useMemo((function(){return{buttonId:r,panelId:o,close:function(){return l({type:Z.CloseFlyout})}}}),[r,o,l]),s=ae(),f=null==s?void 0:s.registerFlyoutMenu,p=null!=(n=null==s?void 0:s.isFocusWithinFlyoutGroup)?n:function(){var e,t;return(null==(e=document.getElementById(r))?void 0:e.contains(document.activeElement))||(null==(t=document.getElementById(o))?void 0:t.contains(document.activeElement))};t.useEffect((function(){return null==f?void 0:f(c)}),[f,c]),t.useEffect((function(){if(a===X.Open)return window.addEventListener("focus",e,!0),function(){return window.removeEventListener("focus",e,!0)};function e(){(null==p?void 0:p())||l({type:Z.CloseFlyout})}}),[a,p,s,r,o,l]);var v=t.useMemo((function(){return{open:a===X.Open}}),[a]);return u.createElement(oe.Provider,{value:i},d(e,v,"div"))}ue.displayName="FlyoutGroupContext";var se,fe,de,pe,ve=v((function e(n,r){var o=ie([ce.name,e.name].join(".")),u=o[0],l=o[1],c=t.useRef(null),s=h(c,r),f=ae(),p=null!==f,v=null==f?void 0:f.closeOthers,m=null==f?void 0:f.focusButton,b=t.useCallback((function(e){switch(e.key){case i.Space:case i.Enter:e.preventDefault(),u.flyoutState===X.Closed&&(null==v||v(u.buttonId)),l({type:Z.ToggleFlyout});break;case i.Escape:if(u.flyoutState!==X.Open)return null==v?void 0:v(u.buttonId);if(!c.current)return;if(!c.current.contains(document.activeElement))return;e.preventDefault(),l({type:Z.CloseFlyout})}if(p)switch(e.key){case i.Home:return e.preventDefault(),null==m?void 0:m(z.First);case i.ArrowLeft:return e.preventDefault(),null==m?void 0:m(z.Previous);case i.End:return e.preventDefault(),null==m?void 0:m(z.Last);case i.ArrowRight:return e.preventDefault(),null==m?void 0:m(z.Next)}}),[l,u,c,v,m,p]),g=t.useCallback((function(e){y(e.currentTarget)||n.disabled||(u.flyoutState===X.Closed&&(null==v||v(u.buttonId)),l({type:Z.ToggleFlyout}))}),[l,u.flyoutState,u.buttonId,n.disabled,v]),S=t.useMemo((function(){return{open:u.flyoutState===X.Open}}),[u]);return d(a({},n,{ref:s,id:u.buttonId,type:"button","aria-expanded":u.flyoutState===X.Open||void 0,"aria-controls":u.linkedPanel?u.panelId:void 0,onKeyDown:b,onClick:g}),S,"button")})),me=r.RenderStrategy|r.Static,he=v((function e(n,r){var o=ie([ce.name,e.name].join(".")),u=o[0],l=o[1],c=t.useRef(null),s=h(c,r,(function(){u.linkedPanel||l({type:Z.LinkPanel})})),f=t.useCallback((function(e){var t;switch(e.key){case i.Escape:if(u.flyoutState!==X.Open)return;if(!c.current)return;if(!c.current.contains(document.activeElement))return;e.preventDefault(),l({type:Z.CloseFlyout}),null==(t=document.getElementById(u.buttonId))||t.focus({preventScroll:!0})}}),[u,c,l]);t.useEffect((function(){return function(){return l({type:Z.UnlinkPanel})}}),[l]),t.useEffect((function(){var e;u.flyoutState!==X.Closed||null!=(e=n.unmount)&&!e||l({type:Z.UnlinkPanel})}),[u.flyoutState,n.unmount,l]);var p=t.useMemo((function(){return{open:u.flyoutState===X.Open}}),[u]);return d(a({},n,{ref:s,id:u.panelId,onKeyDown:f}),p,"div",me,u.flyoutState===X.Open)}));function ye(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=s(e.splice(0));!(t=n()).done;)(0,t.value)()}};return t}function be(){var e=t.useState(ye)[0];return t.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function ge(e,n){var r=t.useState(e),o=r[0],i=r[1],u=t.useRef(e);return b((function(){u.current=e}),[e]),b((function(){return i(u.current)}),[u,i].concat(n)),o}function Se(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),o=null!=r?r:-1,i=function(){switch(e.focus){case se.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case se.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==o&&r.length-n-1>=o||t.resolveDisabled(e))}));return-1===r?r:n.length-1-r;case se.Next:return n.findIndex((function(e,n){return!(n<=o||t.resolveDisabled(e))}));case se.Last:var i=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===i?i:n.length-1-i;case se.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case se.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===i?r:i}function Ee(e,t){if(void 0!==e)return"function"==typeof e?e(t):e}ce.Button=ve,ce.Panel=he,ce.Group=function(e){var n=t.useMemo((function(){return{}}),[]),r=e,o=t.useState([]),i=o[0],l=o[1],c=t.useCallback((function(e){l((function(t){var n=t.indexOf(e);if(-1!==n){var r=t.slice();return r.splice(n,1),r}return t}))}),[l]),p=t.useCallback((function(e){return l((function(t){return[].concat(t,[e])})),function(){return c(e)}}),[l,c]),v=t.useCallback((function(){var e=document.activeElement;return i.some((function(t){var n,r;return(null==(n=document.getElementById(t.buttonId))?void 0:n.contains(e))||(null==(r=document.getElementById(t.panelId))?void 0:r.contains(e))}))}),[i]),m=t.useCallback((function(e){for(var t,n=s(i);!(t=n()).done;){var r=t.value;r.buttonId!==e&&r.close()}}),[i]),h=t.useCallback((function(e){var t;if(document.activeElement){var n=i.reduce((function(e,t){var n=document.getElementById(t.buttonId);return n?(e[t.buttonId]=n,e):e}),{}),r=Array.from(document.querySelectorAll(w)).filter((function(e){return void 0!==n[e.id]})),o=r.indexOf(document.activeElement);if(-1!==o){var u=f(e,((t={})[z.First]=function(){return 0},t[z.Previous]=function(){return Math.max(0,o-1)},t[z.Next]=function(){return Math.min(r.length-1,o+1)},t[z.Last]=function(){return r.length-1},t));r[u].focus({preventScroll:!0})}}}),[i]),y=t.useMemo((function(){return{registerFlyoutMenu:p,unregisterFlyoutMenu:c,isFocusWithinFlyoutGroup:v,closeOthers:m,focusButton:h}}),[p,c,v,m,h]);return u.createElement(ue.Provider,{value:y},d(a({},r,{}),n,"div"))},function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(se||(se={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(de||(de={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.GoToOption=3]="GoToOption",e[e.Search=4]="Search",e[e.ClearSearch=5]="ClearSearch",e[e.RegisterOption=6]="RegisterOption",e[e.UnregisterOption=7]="UnregisterOption"}(pe||(pe={}));var xe=((fe={})[pe.CloseListbox]=function(e){return e.disabled||e.listboxState===de.Closed?e:a({},e,{activeOptionIndex:null,listboxState:de.Closed})},fe[pe.OpenListbox]=function(e){return e.disabled||e.listboxState===de.Open?e:a({},e,{listboxState:de.Open})},fe[pe.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:a({},e,{disabled:t.disabled})},fe[pe.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===de.Closed)return e;var n=Se(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:a({},e,{searchQuery:"",activeOptionIndex:n})},fe[pe.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===de.Closed)return e;var n=e.searchQuery+t.value,r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return a({},e,-1===r||r===e.activeOptionIndex?{searchQuery:n}:{searchQuery:n,activeOptionIndex:r})},fe[pe.ClearSearch]=function(e){return e.disabled||e.listboxState===de.Closed||""===e.searchQuery?e:a({},e,{searchQuery:""})},fe[pe.RegisterOption]=function(e,t){return a({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},fe[pe.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),a({},e,{options:n,activeOptionIndex:o===e.activeOptionIndex||null===r?null:n.indexOf(r)})},fe),we=t.createContext(null);function Ce(e){var n=t.useContext(we);if(null===n){var r=new Error("<"+e+" /> is missing a parent <"+ke.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Ce),r}return n}function Ie(e,t){return f(t.type,xe,e,t)}we.displayName="ListboxContext";var Oe=t.Fragment;function ke(e){var n=e.value,r=e.onChange,o=e.disabled,i=void 0!==o&&o,a=l(e,["value","onChange","disabled"]),c=be(),s=t.useReducer(Ie,{listboxState:de.Closed,propsRef:{current:{value:n,onChange:r}},labelRef:t.createRef(),buttonRef:t.createRef(),optionsRef:t.createRef(),disabled:i,options:[],searchQuery:"",activeOptionIndex:null}),f=s[0],p=f.listboxState,v=f.propsRef,m=f.optionsRef,h=f.buttonRef,y=s[1];b((function(){v.current.value=n}),[n,v]),b((function(){v.current.onChange=r}),[r,v]),b((function(){return y({type:pe.SetDisabled,disabled:i})}),[i]),t.useEffect((function(){function e(e){var t,n,r,o=e.target,i=document.activeElement;p===de.Open&&((null==(t=h.current)?void 0:t.contains(o))||((null==(n=m.current)?void 0:n.contains(o))||y({type:pe.CloseListbox}),i!==document.body&&(null==i?void 0:i.contains(o))||e.defaultPrevented||null==(r=h.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[p,m,h,c,y]);var g=t.useMemo((function(){return{open:p===de.Open,disabled:i}}),[p,i]);return u.createElement(we.Provider,{value:s},d(a,g,Oe))}var Re,Le,Te,Fe=v((function e(n,r){var o,u=Ce([ke.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.buttonRef,r),f="headlessui-listbox-button-"+x(),p=be(),v=t.useCallback((function(e){switch(e.key){case i.Space:case i.Enter:case i.ArrowDown:e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;null==(e=l.optionsRef.current)||e.focus({preventScroll:!0}),l.propsRef.current.value||c({type:pe.GoToOption,focus:se.First})}));break;case i.ArrowUp:e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;null==(e=l.optionsRef.current)||e.focus({preventScroll:!0}),l.propsRef.current.value||c({type:pe.GoToOption,focus:se.Last})}))}}),[c,l,p]),m=t.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();l.listboxState===de.Open?(c({type:pe.CloseListbox}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:pe.OpenListbox}),p.nextFrame((function(){var e;return null==(e=l.optionsRef.current)?void 0:e.focus({preventScroll:!0})})))}),[c,p,l]),b=ge((function(){if(l.labelRef.current)return[l.labelRef.current.id,f].join(" ")}),[l.labelRef.current,f]),g=t.useMemo((function(){return{open:l.listboxState===de.Open,disabled:l.disabled}}),[l]);return d(a({},n,{ref:s,id:f,type:"button","aria-haspopup":!0,"aria-controls":null==(o=l.optionsRef.current)?void 0:o.id,"aria-expanded":l.listboxState===de.Open||void 0,"aria-labelledby":b,disabled:l.disabled,onKeyDown:v,onClick:m}),g,"button")})),De=r.RenderStrategy|r.Static,Pe=v((function e(n,r){var o,u=Ce([ke.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.optionsRef,r),f="headlessui-listbox-options-"+x(),p=be(),v=be(),m=t.useCallback((function(e){switch(v.dispose(),e.key){case i.Space:if(""!==l.searchQuery)return e.preventDefault(),c({type:pe.Search,value:e.key});case i.Enter:e.preventDefault(),c({type:pe.CloseListbox}),null!==l.activeOptionIndex&&l.propsRef.current.onChange(l.options[l.activeOptionIndex].dataRef.current.value),ye().nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case i.ArrowDown:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Next});case i.ArrowUp:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Previous});case i.Home:case i.PageUp:return e.preventDefault(),c({type:pe.GoToOption,focus:se.First});case i.End:case i.PageDown:return e.preventDefault(),c({type:pe.GoToOption,focus:se.Last});case i.Escape:return e.preventDefault(),c({type:pe.CloseListbox}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case i.Tab:return e.preventDefault();default:1===e.key.length&&(c({type:pe.Search,value:e.key}),v.setTimeout((function(){return c({type:pe.ClearSearch})}),350))}}),[p,c,v,l]),y=ge((function(){var e,t,n;return null!=(e=null==(t=l.labelRef.current)?void 0:t.id)?e:null==(n=l.buttonRef.current)?void 0:n.id}),[l.labelRef.current,l.buttonRef.current]),b=t.useMemo((function(){return{open:l.listboxState===de.Open}}),[l]);return d(a({},n,{"aria-activedescendant":null===l.activeOptionIndex||null==(o=l.options[l.activeOptionIndex])?void 0:o.id,"aria-labelledby":y,id:f,onKeyDown:m,role:"listbox",tabIndex:0,ref:s}),b,"ul",De,l.listboxState===de.Open)}));ke.Button=Fe,ke.Label=function e(n){var r=Ce([ke.name,e.name].join("."))[0],o="headlessui-listbox-label-"+x(),i=t.useCallback((function(){var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[r.buttonRef]),u=t.useMemo((function(){return{open:r.listboxState===de.Open,disabled:r.disabled}}),[r]);return d(a({},n,{ref:r.labelRef,id:o,onClick:i}),u,"label")},ke.Options=Pe,ke.Option=function e(n){var r=n.disabled,o=void 0!==r&&r,i=n.value,u=n.className,c=l(n,["disabled","value","className"]),s=Ce([ke.name,e.name].join(".")),f=s[0],p=s[1],v="headlessui-listbox-option-"+x(),m=null!==f.activeOptionIndex&&f.options[f.activeOptionIndex].id===v,h=f.propsRef.current.value===i,y=t.useRef({disabled:o,value:i});b((function(){y.current.disabled=o}),[y,o]),b((function(){y.current.value=i}),[y,i]),b((function(){var e,t;y.current.textValue=null==(e=document.getElementById(v))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[y,v]);var g=t.useCallback((function(){return f.propsRef.current.onChange(i)}),[f.propsRef,i]);b((function(){return p({type:pe.RegisterOption,id:v,dataRef:y}),function(){return p({type:pe.UnregisterOption,id:v})}}),[y,v]),b((function(){var e;f.listboxState===de.Open&&h&&(p({type:pe.GoToOption,focus:se.Specific,id:v}),null==(e=document.getElementById(v))||null==e.focus||e.focus())}),[f.listboxState]),b((function(){if(f.listboxState===de.Open&&m){var e=ye();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[v,m,f.listboxState]);var S=t.useCallback((function(e){if(o)return e.preventDefault();g(),p({type:pe.CloseListbox}),ye().nextFrame((function(){var e;return null==(e=f.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[p,f.buttonRef,o,g]),E=t.useCallback((function(){if(o)return p({type:pe.GoToOption,focus:se.Nothing});p({type:pe.GoToOption,focus:se.Specific,id:v})}),[o,v,p]),w=t.useCallback((function(){o||m||p({type:pe.GoToOption,focus:se.Specific,id:v})}),[o,m,v,p]),C=t.useCallback((function(){o||m&&p({type:pe.GoToOption,focus:se.Nothing})}),[o,m,p]),I=t.useMemo((function(){return{active:m,selected:h,disabled:o}}),[m,h,o]);return d(a({},c,{id:v,role:"option",tabIndex:-1,className:Ee(u,I),"aria-disabled":!0===o||void 0,"aria-selected":!0===h||void 0,onClick:S,onFocus:E,onPointerMove:w,onMouseMove:w,onPointerLeave:C,onMouseLeave:C}),I,"li")},function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(Le||(Le={})),function(e){e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem"}(Te||(Te={}));var Me=((Re={})[Te.CloseMenu]=function(e){return a({},e,{activeItemIndex:null,menuState:Le.Closed})},Re[Te.OpenMenu]=function(e){return a({},e,{menuState:Le.Open})},Re[Te.GoToItem]=function(e,t){var n=Se(t,{resolveItems:function(){return e.items},resolveActiveIndex:function(){return e.activeItemIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeItemIndex===n?e:a({},e,{searchQuery:"",activeItemIndex:n})},Re[Te.Search]=function(e,t){var n=e.searchQuery+t.value,r=e.items.findIndex((function(e){var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))&&!e.dataRef.current.disabled}));return a({},e,-1===r||r===e.activeItemIndex?{searchQuery:n}:{searchQuery:n,activeItemIndex:r})},Re[Te.ClearSearch]=function(e){return a({},e,{searchQuery:""})},Re[Te.RegisterItem]=function(e,t){return a({},e,{items:[].concat(e.items,[{id:t.id,dataRef:t.dataRef}])})},Re[Te.UnregisterItem]=function(e,t){var n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,o=n.findIndex((function(e){return e.id===t.id}));return-1!==o&&n.splice(o,1),a({},e,{items:n,activeItemIndex:o===e.activeItemIndex||null===r?null:n.indexOf(r)})},Re),Ae=t.createContext(null);function Ne(e){var n=t.useContext(Ae);if(null===n){var r=new Error("<"+e+" /> is missing a parent <"+Ue.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Ne),r}return n}function je(e,t){return f(t.type,Me,e,t)}Ae.displayName="MenuContext";var Ge=t.Fragment;function Ue(e){var n=t.useReducer(je,{menuState:Le.Closed,buttonRef:t.createRef(),itemsRef:t.createRef(),items:[],searchQuery:"",activeItemIndex:null}),r=n[0],o=r.menuState,i=r.itemsRef,a=r.buttonRef,l=n[1];t.useEffect((function(){function e(e){var t,n,r,u=e.target,c=document.activeElement;o===Le.Open&&((null==(t=a.current)?void 0:t.contains(u))||((null==(n=i.current)?void 0:n.contains(u))||l({type:Te.CloseMenu}),c!==document.body&&(null==c?void 0:c.contains(u))||e.defaultPrevented||null==(r=a.current)||r.focus({preventScroll:!0})))}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[o,i,a,l]);var c=t.useMemo((function(){return{open:o===Le.Open}}),[o]);return u.createElement(Ae.Provider,{value:n},d(e,c,Ge))}var He=v((function e(n,r){var o,u=Ne([Ue.name,e.name].join(".")),l=u[0],c=u[1],s=h(l.buttonRef,r),f="headlessui-menu-button-"+x(),p=be(),v=t.useCallback((function(e){switch(e.key){case i.Space:case i.Enter:case i.ArrowDown:e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;null==(e=l.itemsRef.current)||e.focus({preventScroll:!0}),c({type:Te.GoToItem,focus:se.First})}));break;case i.ArrowUp:e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;null==(e=l.itemsRef.current)||e.focus({preventScroll:!0}),c({type:Te.GoToItem,focus:se.Last})}))}}),[c,l,p]),m=t.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();n.disabled||(l.menuState===Le.Open?(c({type:Te.CloseMenu}),p.nextFrame((function(){var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),c({type:Te.OpenMenu}),p.nextFrame((function(){var e;return null==(e=l.itemsRef.current)?void 0:e.focus({preventScroll:!0})}))))}),[c,p,l,n.disabled]),b=t.useMemo((function(){return{open:l.menuState===Le.Open}}),[l]);return d(a({},n,{ref:s,id:f,type:"button","aria-haspopup":!0,"aria-controls":null==(o=l.itemsRef.current)?void 0:o.id,"aria-expanded":l.menuState===Le.Open||void 0,onKeyDown:v,onClick:m}),b,"button")})),Be=r.RenderStrategy|r.Static,Ve=v((function e(n,r){var o,u,l=Ne([Ue.name,e.name].join(".")),c=l[0],s=l[1],f=h(c.itemsRef,r),p="headlessui-menu-items-"+x(),v=be();b((function(){var e=c.itemsRef.current;if(e&&c.menuState===Le.Open)for(var t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});t.nextNode();)t.currentNode.setAttribute("role","none")}));var m=t.useCallback((function(e){switch(v.dispose(),e.key){case i.Space:if(""!==c.searchQuery)return e.preventDefault(),s({type:Te.Search,value:e.key});case i.Enter:var t;e.preventDefault(),s({type:Te.CloseMenu}),null!==c.activeItemIndex&&(null==(t=document.getElementById(c.items[c.activeItemIndex].id))||t.click()),ye().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case i.ArrowDown:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Next});case i.ArrowUp:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Previous});case i.Home:case i.PageUp:return e.preventDefault(),s({type:Te.GoToItem,focus:se.First});case i.End:case i.PageDown:return e.preventDefault(),s({type:Te.GoToItem,focus:se.Last});case i.Escape:e.preventDefault(),s({type:Te.CloseMenu}),ye().nextFrame((function(){var e;return null==(e=c.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case i.Tab:return e.preventDefault();default:1===e.key.length&&(s({type:Te.Search,value:e.key}),v.setTimeout((function(){return s({type:Te.ClearSearch})}),350))}}),[s,v,c]),y=t.useMemo((function(){return{open:c.menuState===Le.Open}}),[c]);return d(a({},n,{"aria-activedescendant":null===c.activeItemIndex||null==(o=c.items[c.activeItemIndex])?void 0:o.id,"aria-labelledby":null==(u=c.buttonRef.current)?void 0:u.id,id:p,onKeyDown:m,role:"menu",tabIndex:0,ref:f}),y,"div",Be,c.menuState===Le.Open)})),_e=t.Fragment;Ue.Button=He,Ue.Items=Ve,Ue.Item=function e(n){var r=n.disabled,o=void 0!==r&&r,i=n.className,u=n.onClick,c=l(n,["disabled","className","onClick"]),s=Ne([Ue.name,e.name].join(".")),f=s[0],p=s[1],v="headlessui-menu-item-"+x(),m=null!==f.activeItemIndex&&f.items[f.activeItemIndex].id===v;b((function(){if(f.menuState===Le.Open&&m){var e=ye();return e.nextFrame((function(){var e;return null==(e=document.getElementById(v))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[v,m,f.menuState]);var h=t.useRef({disabled:o});b((function(){h.current.disabled=o}),[h,o]),b((function(){var e,t;h.current.textValue=null==(e=document.getElementById(v))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[h,v]),b((function(){return p({type:Te.RegisterItem,id:v,dataRef:h}),function(){return p({type:Te.UnregisterItem,id:v})}}),[h,v]);var y=t.useCallback((function(e){return o?e.preventDefault():(p({type:Te.CloseMenu}),ye().nextFrame((function(){var e;return null==(e=f.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),u?u(e):void 0)}),[p,f.buttonRef,o,u]),g=t.useCallback((function(){if(o)return p({type:Te.GoToItem,focus:se.Nothing});p({type:Te.GoToItem,focus:se.Specific,id:v})}),[o,v,p]),S=t.useCallback((function(){o||m||p({type:Te.GoToItem,focus:se.Specific,id:v})}),[o,m,v,p]),E=t.useCallback((function(){o||m&&p({type:Te.GoToItem,focus:se.Nothing})}),[o,m,p]),w=t.useMemo((function(){return{active:m,disabled:o}}),[m,o]);return d(a({},c,{id:v,role:"menuitem",tabIndex:-1,className:Ee(i,w),"aria-disabled":!0===o||void 0,onClick:y,onFocus:g,onPointerMove:S,onMouseMove:S,onPointerLeave:E,onMouseLeave:E}),w,_e)};var Qe=t.createContext(null);function Ke(e){var n=t.useContext(Qe);if(null===n){var r=new Error("<"+e+" /> is missing a parent <Switch.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Ke),r}return n}Qe.displayName="GroupContext";var qe,We=t.Fragment;function Ye(e){var n,r,o=e.checked,u=e.onChange,c=e.className,s=l(e,["checked","onChange","className"]),f="headlessui-switch-"+x(),p=t.useContext(Qe),v=t.useCallback((function(){return u(!o)}),[u,o]),m=t.useCallback((function(e){if(y(e.currentTarget))return e.preventDefault();e.preventDefault(),v()}),[v]),h=t.useCallback((function(e){e.key!==i.Tab&&e.preventDefault(),e.key===i.Space&&v()}),[v]),b=t.useCallback((function(e){return e.preventDefault()}),[]),g=t.useMemo((function(){return{checked:o}}),[o]),S={id:f,ref:null===p?void 0:p.setSwitch,role:"switch",tabIndex:0,className:Ee(c,g),"aria-checked":o,"aria-labelledby":null==p||null==(n=p.label)?void 0:n.id,"aria-describedby":null==p||null==(r=p.description)?void 0:r.id,onClick:m,onKeyUp:h,onKeyPress:b};return"button"===s.as&&Object.assign(S,{type:"button"}),d(a({},s,S),g,"button")}function Je(){var e=t.useRef(!0);return t.useEffect((function(){e.current=!1}),[]),e.current}function $e(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function ze(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function Xe(e,t,n,r,o){var i=ye(),u=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return $e.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){ze.apply(void 0,[e].concat(n)),$e.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=ye();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),i=o[0];return 0!==i?n.setTimeout((function(){t(qe.Finished)}),i+o[1]):t(qe.Finished),n.add((function(){return t(qe.Cancelled)})),n.dispose}(e,(function(n){return ze.apply(void 0,[e].concat(r,t)),u(n)})))})),i.add((function(){return ze.apply(void 0,[e].concat(t,n,r))})),i.add((function(){return u(qe.Cancelled)})),i.dispose}function Ze(e){return void 0===e&&(e=""),t.useMemo((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}Ye.Group=function(e){var n=t.useState(null),r=n[0],o=n[1],i=t.useState(null),a=i[0],l=i[1],c=t.useState(null),s=c[0],f=c[1],p=t.useMemo((function(){return{switch:r,setSwitch:o,label:a,setLabel:l,description:s,setDescription:f}}),[r,o,a,l,s,f]);return u.createElement(Qe.Provider,{value:p},d(e,{},We))},Ye.Label=function e(n){var r=Ke([Ye.name,e.name].join(".")),o="headlessui-switch-label-"+x(),i=t.useCallback((function(){r.switch&&(r.switch.click(),r.switch.focus({preventScroll:!0}))}),[r.switch]);return d(a({},n,{ref:r.setLabel,id:o,onClick:i}),{},"label")},Ye.Description=function e(t){var n=Ke([Ye.name,e.name].join(".")),r="headlessui-switch-description-"+x();return d(a({},t,{ref:n.setDescription,id:r}),{},"p")},function(e){e.Finished="finished",e.Cancelled="cancelled"}(qe||(qe={}));var et,tt=t.createContext(null);tt.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(et||(et={}));var nt=t.createContext(null);function rt(e){return"children"in e?rt(e.children):e.current.filter((function(e){return e.state===et.Visible})).length>0}function ot(e){var n=t.useRef(e),r=t.useRef([]),i=function(){var e=t.useRef(!0);return t.useEffect((function(){return function(){e.current=!1}}),[]),e}();t.useEffect((function(){n.current=e}),[e]);var u=t.useCallback((function(e,t){var u;void 0===t&&(t=o.Hidden);var a=r.current.findIndex((function(t){return t.id===e}));-1!==a&&(f(t,((u={})[o.Unmount]=function(){r.current.splice(a,1)},u[o.Hidden]=function(){r.current[a].state=et.Hidden},u)),!rt(r)&&i.current&&(null==n.current||n.current()))}),[n,i,r]),a=t.useCallback((function(e){var t=r.current.find((function(t){return t.id===e}));return t?t.state!==et.Visible&&(t.state=et.Visible):r.current.push({id:e,state:et.Visible}),function(){return u(e,o.Unmount)}}),[r,u]);return t.useMemo((function(){return{children:r,register:a,unregister:u}}),[a,u,r])}function it(){}nt.displayName="NestingContext";var ut=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function at(e){for(var t,n={},r=s(ut);!(t=r()).done;){var o,i=t.value;n[i]=null!=(o=e[i])?o:it}return n}var lt=r.RenderStrategy;function ct(e){var n=e.beforeEnter,r=e.afterEnter,i=e.beforeLeave,c=e.afterLeave,s=e.enter,p=e.enterFrom,v=e.enterTo,m=e.leave,h=e.leaveFrom,y=e.leaveTo,g=l(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo"]),S=t.useRef(null),E=t.useState(et.Visible),w=E[0],C=E[1],I=g.unmount?o.Unmount:o.Hidden,O=function(){var e=t.useContext(tt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),k=O.show,R=O.appear,L=function(){var e=t.useContext(nt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition />.");return e}(),T=L.register,F=L.unregister,D=Je(),P=x(),M=t.useRef(!1),A=ot((function(){M.current||(C(et.Hidden),F(P),V.current.afterLeave())}));b((function(){if(P)return T(P)}),[T,P]),b((function(){var e;I===o.Hidden&&P&&(k&&w!==et.Visible?C(et.Visible):f(w,((e={})[et.Hidden]=function(){return F(P)},e[et.Visible]=function(){return T(P)},e)))}),[w,P,T,F,k,I]);var N=Ze(s),j=Ze(p),G=Ze(v),U=Ze(m),H=Ze(h),B=Ze(y),V=function(e){var n=t.useRef(at(e));return t.useEffect((function(){n.current=at(e)}),[e]),n}({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:c});t.useEffect((function(){if(w===et.Visible&&null===S.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[S,w]);var _=D&&!R;return b((function(){var e=S.current;if(e&&!_)return M.current=!0,k&&V.current.beforeEnter(),k||V.current.beforeLeave(),k?Xe(e,N,j,G,(function(e){M.current=!1,e===qe.Finished&&V.current.afterEnter()})):Xe(e,U,H,B,(function(e){M.current=!1,e===qe.Finished&&(rt(A)||(C(et.Hidden),F(P),V.current.afterLeave()))}))}),[V,P,M,F,A,S,_,k,N,j,G,U,H,B]),u.createElement(nt.Provider,{value:A},d(a({},g,{ref:S}),{},"div",lt,w===et.Visible))}function st(e){var n=e.show,r=e.appear,o=void 0!==r&&r,i=e.unmount,c=l(e,["show","appear","unmount"]);if(![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var s=t.useState(n?et.Visible:et.Hidden),f=s[0],p=s[1],v=ot((function(){p(et.Hidden)})),m=Je(),h=t.useMemo((function(){return{show:n,appear:o||!m}}),[n,o,m]);t.useEffect((function(){n?p(et.Visible):rt(v)||p(et.Hidden)}),[n,v]);var y={unmount:i};return u.createElement(nt.Provider,{value:v},u.createElement(tt.Provider,{value:h},d(a({},y,{as:t.Fragment,children:u.createElement(ct,Object.assign({},y,c))}),{},t.Fragment,lt,f===et.Visible)))}st.Child=ct,e.Dialog=_,e.Disclosure=J,e.Flyout=ce,e.FocusTrap=function(e){var n=t.useRef(null),r=e.initialFocus,o=l(e,["initialFocus"]);return I(n,!0,{initialFocus:r}),d(a({},o,{ref:n}),{},"div")},e.Listbox=ke,e.Menu=Ue,e.Portal=M,e.Switch=Ye,e.Transition=st,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=headlessui.umd.production.min.js.map |
@@ -1,4 +0,9 @@ | ||
export * from './components/transitions/transition'; | ||
export * from './components/dialog/dialog'; | ||
export * from './components/disclosure/disclosure'; | ||
export * from './components/flyout/flyout'; | ||
export * from './components/focus-trap/focus-trap'; | ||
export * from './components/listbox/listbox'; | ||
export * from './components/menu/menu'; | ||
export * from './components/listbox/listbox'; | ||
export * from './components/portal/portal'; | ||
export * from './components/switch/switch'; | ||
export * from './components/transitions/transition'; |
@@ -82,6 +82,82 @@ export declare function getMenuButton(): HTMLElement | null; | ||
label?: string; | ||
description?: string; | ||
}, switchElement?: HTMLElement | null): void; | ||
export declare function getDisclosureButton(): HTMLElement | null; | ||
export declare function getDisclosurePanel(): HTMLElement | null; | ||
export declare enum DisclosureState { | ||
/** The disclosure is visible to the user. */ | ||
Visible = 0, | ||
/** The disclosure is **not** visible to the user. It's still in the DOM, but it is hidden. */ | ||
InvisibleHidden = 1, | ||
/** The disclosure is **not** visible to the user. It's not in the DOM, it is unmounted. */ | ||
InvisibleUnmounted = 2 | ||
} | ||
export declare function assertDisclosureButton(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DisclosureState; | ||
}, button?: HTMLElement | null): void; | ||
export declare function assertDisclosurePanel(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DisclosureState; | ||
}, panel?: HTMLElement | null): void; | ||
export declare function getFlyoutButton(): HTMLElement | null; | ||
export declare function getFlyoutPanel(): HTMLElement | null; | ||
export declare enum FlyoutState { | ||
/** The flyout is visible to the user. */ | ||
Visible = 0, | ||
/** The flyout is **not** visible to the user. It's still in the DOM, but it is hidden. */ | ||
InvisibleHidden = 1, | ||
/** The flyout is **not** visible to the user. It's not in the DOM, it is unmounted. */ | ||
InvisibleUnmounted = 2 | ||
} | ||
export declare function assertFlyoutButton(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: FlyoutState; | ||
}, button?: HTMLElement | null): void; | ||
export declare function assertFlyoutPanel(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: FlyoutState; | ||
}, panel?: HTMLElement | null): void; | ||
export declare function assertLabelValue(element: HTMLElement | null, value: string): void; | ||
export declare function assertDescriptionValue(element: HTMLElement | null, value: string): void; | ||
export declare function getDialog(): HTMLElement | null; | ||
export declare function getDialogTitle(): HTMLElement | null; | ||
export declare function getDialogDescription(): HTMLElement | null; | ||
export declare function getDialogOverlay(): HTMLElement | null; | ||
export declare enum DialogState { | ||
/** The dialog is visible to the user. */ | ||
Visible = 0, | ||
/** The dialog is **not** visible to the user. It's still in the DOM, but it is hidden. */ | ||
InvisibleHidden = 1, | ||
/** The dialog is **not** visible to the user. It's not in the DOM, it is unmounted. */ | ||
InvisibleUnmounted = 2 | ||
} | ||
export declare function assertDialog(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DialogState; | ||
}, dialog?: HTMLElement | null): void; | ||
export declare function assertDialogTitle(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DialogState; | ||
}, title?: HTMLElement | null, dialog?: HTMLElement | null): void; | ||
export declare function assertDialogDescription(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DialogState; | ||
}, description?: HTMLElement | null, dialog?: HTMLElement | null): void; | ||
export declare function assertDialogOverlay(options: { | ||
attributes?: Record<string, string | null>; | ||
textContent?: string; | ||
state: DialogState; | ||
}, overlay?: HTMLElement | null): void; | ||
export declare function assertActiveElement(element: HTMLElement | null): void; | ||
export declare function assertContainsActiveElement(element: HTMLElement | null): void; | ||
export declare function assertHidden(element: HTMLElement | null): void; | ||
export declare function assertVisible(element: HTMLElement | null): void; | ||
export declare function getByText(text: string): HTMLElement | null; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import { ReactNode, ReactElement } from 'react'; | ||
declare const __: unique symbol; | ||
@@ -8,7 +8,7 @@ export declare type __ = typeof __; | ||
export declare type PropsOf<TTag = any> = TTag extends React.ElementType ? React.ComponentProps<TTag> : never; | ||
export declare type Props<TTag, TSlot = {}, TOmitableProps extends keyof any = __> = { | ||
export declare type Props<TTag, TSlot = any, TOmitableProps extends keyof any = __> = (TOmitableProps extends __ ? Omit<PropsOf<TTag>, 'as' | 'children' | 'refName'> : Omit<PropsOf<TTag>, TOmitableProps | 'as' | 'children' | 'refName'>) & { | ||
as?: TTag; | ||
children?: React.ReactNode | ((bag: TSlot) => React.ReactElement); | ||
children?: ReactNode | ((bag: TSlot) => ReactElement); | ||
refName?: string; | ||
} & (TOmitableProps extends __ ? PropsOf<TTag> : Omit<PropsOf<TTag>, TOmitableProps>); | ||
}; | ||
declare type Without<T, U> = { | ||
@@ -15,0 +15,0 @@ [P in Exclude<keyof T, keyof U>]?: never; |
@@ -37,3 +37,5 @@ import { ElementType, ReactElement } from 'react'; | ||
*/ | ||
export declare function forwardRefWithAs<T>(component: T): T; | ||
export declare function forwardRefWithAs<T extends { | ||
name: string; | ||
}>(component: T): T; | ||
export {}; |
{ | ||
"name": "@headlessui/react", | ||
"version": "0.3.0", | ||
"version": "0.3.1-1fd5e21", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1860391
49
12318
2
5