@aiquants/console-ui 0.8.2 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +22 -6
- package/dist/index.d.ts +22 -6
- package/dist/index.js +1 -1
- package/dist/styles/console-ui.css +43 -9
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -43,6 +43,7 @@ type ButtonProps = {
|
|
|
43
43
|
readonly controls?: string;
|
|
44
44
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
45
45
|
readonly dataAttributes?: DataAttributes;
|
|
46
|
+
readonly keyShortcuts?: string;
|
|
46
47
|
} & ({
|
|
47
48
|
readonly busy?: undefined;
|
|
48
49
|
readonly busyLabel?: undefined;
|
|
@@ -50,22 +51,24 @@ type ButtonProps = {
|
|
|
50
51
|
readonly busy: boolean;
|
|
51
52
|
readonly busyLabel: ReactNode;
|
|
52
53
|
});
|
|
53
|
-
declare const Button: ({ variant, children, testId, type, onClick, unavailable, describedBy, expanded, controls, ref, dataAttributes, busy, busyLabel }: ButtonProps) => react.JSX.Element;
|
|
54
|
+
declare const Button: ({ variant, children, testId, type, onClick, unavailable, describedBy, expanded, controls, ref, dataAttributes, keyShortcuts, busy, busyLabel }: ButtonProps) => react.JSX.Element;
|
|
54
55
|
type LinkProps = {
|
|
55
56
|
readonly onNavigate: () => void;
|
|
56
57
|
readonly children: ReactNode;
|
|
57
58
|
readonly testId: string;
|
|
58
59
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
60
|
+
readonly keyShortcuts?: string;
|
|
59
61
|
};
|
|
60
|
-
declare const Link: ({ onNavigate, children, testId, ref }: LinkProps) => react.JSX.Element;
|
|
62
|
+
declare const Link: ({ onNavigate, children, testId, ref, keyShortcuts }: LinkProps) => react.JSX.Element;
|
|
61
63
|
type FragmentLinkProps = {
|
|
62
64
|
readonly targetId: string;
|
|
63
65
|
readonly children: ReactNode;
|
|
64
66
|
readonly testId: string;
|
|
65
67
|
readonly onFollow?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
66
68
|
readonly dataAttributes?: DataAttributes;
|
|
69
|
+
readonly keyShortcuts?: string;
|
|
67
70
|
};
|
|
68
|
-
declare const FragmentLink: ({ targetId, children, testId, onFollow, dataAttributes }: FragmentLinkProps) => react.JSX.Element;
|
|
71
|
+
declare const FragmentLink: ({ targetId, children, testId, onFollow, dataAttributes, keyShortcuts }: FragmentLinkProps) => react.JSX.Element;
|
|
69
72
|
type CardProps = {
|
|
70
73
|
readonly id?: string;
|
|
71
74
|
readonly title: string;
|
|
@@ -137,10 +140,11 @@ type ConsoleUiRootProps = {
|
|
|
137
140
|
readonly timeZone: string;
|
|
138
141
|
readonly accessFailure: AccessFailurePresenter<ReactNode>;
|
|
139
142
|
readonly contrast?: ContrastLevel;
|
|
143
|
+
readonly reducedMotion?: boolean;
|
|
140
144
|
readonly testId: string;
|
|
141
145
|
readonly children: ReactNode;
|
|
142
146
|
};
|
|
143
|
-
declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
|
|
147
|
+
declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, reducedMotion, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
|
|
144
148
|
declare const useConsoleUi: () => ConsoleUiContextValue;
|
|
145
149
|
declare const useAnnounce: () => ((text: string) => void);
|
|
146
150
|
declare const useAccessFailure: () => AccessFailurePresenter<ReactNode>;
|
|
@@ -570,9 +574,21 @@ type RowButtonProps = {
|
|
|
570
574
|
readonly testId: string;
|
|
571
575
|
readonly dataAttributes?: DataAttributes;
|
|
572
576
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
577
|
+
readonly keyShortcuts?: string;
|
|
573
578
|
readonly children: ReactNode;
|
|
574
579
|
};
|
|
575
|
-
declare const RowButton: ({ selected, controls, onSelect, testId, dataAttributes, ref, children }: RowButtonProps) => react.JSX.Element;
|
|
580
|
+
declare const RowButton: ({ selected, controls, onSelect, testId, dataAttributes, ref, keyShortcuts, children }: RowButtonProps) => react.JSX.Element;
|
|
581
|
+
type RowLinkProps = {
|
|
582
|
+
readonly href: string;
|
|
583
|
+
readonly current: boolean;
|
|
584
|
+
readonly onNavigate: (href: string) => void;
|
|
585
|
+
readonly testId: string;
|
|
586
|
+
readonly dataAttributes?: DataAttributes;
|
|
587
|
+
readonly ref?: Ref<HTMLAnchorElement>;
|
|
588
|
+
readonly keyShortcuts?: string;
|
|
589
|
+
readonly children: ReactNode;
|
|
590
|
+
};
|
|
591
|
+
declare const RowLink: ({ href, current, onNavigate, testId, dataAttributes, ref, keyShortcuts, children }: RowLinkProps) => react.JSX.Element;
|
|
576
592
|
type SelectableListProps<T> = {
|
|
577
593
|
readonly label: string;
|
|
578
594
|
readonly items: readonly T[];
|
|
@@ -722,4 +738,4 @@ type VisuallyHiddenProps = {
|
|
|
722
738
|
readonly children: ReactNode;
|
|
723
739
|
};
|
|
724
740
|
declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
|
|
725
|
-
export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
|
|
741
|
+
export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, RowLink, type RowLinkProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ type ButtonProps = {
|
|
|
43
43
|
readonly controls?: string;
|
|
44
44
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
45
45
|
readonly dataAttributes?: DataAttributes;
|
|
46
|
+
readonly keyShortcuts?: string;
|
|
46
47
|
} & ({
|
|
47
48
|
readonly busy?: undefined;
|
|
48
49
|
readonly busyLabel?: undefined;
|
|
@@ -50,22 +51,24 @@ type ButtonProps = {
|
|
|
50
51
|
readonly busy: boolean;
|
|
51
52
|
readonly busyLabel: ReactNode;
|
|
52
53
|
});
|
|
53
|
-
declare const Button: ({ variant, children, testId, type, onClick, unavailable, describedBy, expanded, controls, ref, dataAttributes, busy, busyLabel }: ButtonProps) => react.JSX.Element;
|
|
54
|
+
declare const Button: ({ variant, children, testId, type, onClick, unavailable, describedBy, expanded, controls, ref, dataAttributes, keyShortcuts, busy, busyLabel }: ButtonProps) => react.JSX.Element;
|
|
54
55
|
type LinkProps = {
|
|
55
56
|
readonly onNavigate: () => void;
|
|
56
57
|
readonly children: ReactNode;
|
|
57
58
|
readonly testId: string;
|
|
58
59
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
60
|
+
readonly keyShortcuts?: string;
|
|
59
61
|
};
|
|
60
|
-
declare const Link: ({ onNavigate, children, testId, ref }: LinkProps) => react.JSX.Element;
|
|
62
|
+
declare const Link: ({ onNavigate, children, testId, ref, keyShortcuts }: LinkProps) => react.JSX.Element;
|
|
61
63
|
type FragmentLinkProps = {
|
|
62
64
|
readonly targetId: string;
|
|
63
65
|
readonly children: ReactNode;
|
|
64
66
|
readonly testId: string;
|
|
65
67
|
readonly onFollow?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
66
68
|
readonly dataAttributes?: DataAttributes;
|
|
69
|
+
readonly keyShortcuts?: string;
|
|
67
70
|
};
|
|
68
|
-
declare const FragmentLink: ({ targetId, children, testId, onFollow, dataAttributes }: FragmentLinkProps) => react.JSX.Element;
|
|
71
|
+
declare const FragmentLink: ({ targetId, children, testId, onFollow, dataAttributes, keyShortcuts }: FragmentLinkProps) => react.JSX.Element;
|
|
69
72
|
type CardProps = {
|
|
70
73
|
readonly id?: string;
|
|
71
74
|
readonly title: string;
|
|
@@ -137,10 +140,11 @@ type ConsoleUiRootProps = {
|
|
|
137
140
|
readonly timeZone: string;
|
|
138
141
|
readonly accessFailure: AccessFailurePresenter<ReactNode>;
|
|
139
142
|
readonly contrast?: ContrastLevel;
|
|
143
|
+
readonly reducedMotion?: boolean;
|
|
140
144
|
readonly testId: string;
|
|
141
145
|
readonly children: ReactNode;
|
|
142
146
|
};
|
|
143
|
-
declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
|
|
147
|
+
declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, reducedMotion, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
|
|
144
148
|
declare const useConsoleUi: () => ConsoleUiContextValue;
|
|
145
149
|
declare const useAnnounce: () => ((text: string) => void);
|
|
146
150
|
declare const useAccessFailure: () => AccessFailurePresenter<ReactNode>;
|
|
@@ -570,9 +574,21 @@ type RowButtonProps = {
|
|
|
570
574
|
readonly testId: string;
|
|
571
575
|
readonly dataAttributes?: DataAttributes;
|
|
572
576
|
readonly ref?: Ref<HTMLButtonElement>;
|
|
577
|
+
readonly keyShortcuts?: string;
|
|
573
578
|
readonly children: ReactNode;
|
|
574
579
|
};
|
|
575
|
-
declare const RowButton: ({ selected, controls, onSelect, testId, dataAttributes, ref, children }: RowButtonProps) => react.JSX.Element;
|
|
580
|
+
declare const RowButton: ({ selected, controls, onSelect, testId, dataAttributes, ref, keyShortcuts, children }: RowButtonProps) => react.JSX.Element;
|
|
581
|
+
type RowLinkProps = {
|
|
582
|
+
readonly href: string;
|
|
583
|
+
readonly current: boolean;
|
|
584
|
+
readonly onNavigate: (href: string) => void;
|
|
585
|
+
readonly testId: string;
|
|
586
|
+
readonly dataAttributes?: DataAttributes;
|
|
587
|
+
readonly ref?: Ref<HTMLAnchorElement>;
|
|
588
|
+
readonly keyShortcuts?: string;
|
|
589
|
+
readonly children: ReactNode;
|
|
590
|
+
};
|
|
591
|
+
declare const RowLink: ({ href, current, onNavigate, testId, dataAttributes, ref, keyShortcuts, children }: RowLinkProps) => react.JSX.Element;
|
|
576
592
|
type SelectableListProps<T> = {
|
|
577
593
|
readonly label: string;
|
|
578
594
|
readonly items: readonly T[];
|
|
@@ -722,4 +738,4 @@ type VisuallyHiddenProps = {
|
|
|
722
738
|
readonly children: ReactNode;
|
|
723
739
|
};
|
|
724
740
|
declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
|
|
725
|
-
export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
|
|
741
|
+
export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, RowLink, type RowLinkProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as wt,A as za,B as Ja,C as Xa,D as ja,E as Ya,F as Za,G as Qa,H as ei,I as bt,J as ht,K as Rt,L as J,M as U,N as ti,O as F,P as ni,Q as Tt,R as Et,S as ri,T as vt,U as oi,V as ai,W as ii,X as $e,Y as Fe,Z as xt,_ as Ae,a as ct,aa as Pt,b as pt,ba as Nt,c as ce,ca as Ct,d as Ca,da as De,e as yt,ea as si,f as ka,fa as di,g as La,ga as li,h as H,ha as ui,i as Sa,ia as ci,j as Ma,k as Ia,l as $a,m as Fa,n as Aa,o as Da,p as ft,q as Ie,r as Ba,s as z,t as _a,u as gt,v as M,w as qa,x as Ga,y as Va,z as Wa}from"./chunk-HROMRBBM.js";import{a as Ha,e as Oa,f as Ka,g as Ua,h as Me,i as mt}from"./chunk-RA33TN5N.js";import{useEffect as Yn,useRef as Zn}from"react";import{useId as qn,useRef as Gn}from"react";import{createContext as Cn,useCallback as kn,useContext as $t,useLayoutEffect as Ln,useMemo as kt,useRef as Lt}from"react";import{jsx as It,jsxs as Hn}from"react/jsx-runtime";var He=Cn(null),Ft=" ",St='[inert], [aria-hidden="true" i]',Oe="data-cui-dialog-announcer",Sn=`:scope > [${Oe}]`,Mn=e=>{if(e.closest(St)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=pt(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(Sn);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(St)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},In=e=>{try{e.querySelectorAll(ct)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe=150,$n=1e3,Mt=new WeakMap,Fn=(e,t)=>{let n=Mt.get(e)??new Set,r={text:t};Mt.set(e,n.add(r)),setTimeout(()=>n.delete(r),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ft),e.replaceChildren(a)},An=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",testId:o,children:s})=>{if($t(He)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!Me.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${Me.join(", ")}: ${String(a)}`);let i=ft(e),[d]=Intl.getCanonicalLocales(t),p=kt(()=>new Intl.DateTimeFormat(d,{timeZone:n}).resolvedOptions().timeZone,[d,n]),u=Lt(null),c=Lt(null);Ln(()=>{In(u.current.ownerDocument)},[]);let b=kn(f=>{if(f.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let h=()=>{let{texts:E,settle:R,deadline:T}=c.current;c.current=null,clearTimeout(R),clearTimeout(T);let v=u.current;if(v===null)return;let k=E.join(Ft),I=Mn(v);if("hidden"in I)throw new Error(`announce: the live region is hidden from assistive technology (${I.hidden}), so this announcement would be lost: ${k}`);Fn(I.region,k)},y=c.current;if(y===null){c.current={texts:[f],settle:setTimeout(h,pe),deadline:setTimeout(h,$n)};return}y.texts.push(f),clearTimeout(y.settle),y.settle=setTimeout(h,pe)},[]),m=kt(()=>({locale:e,formatLocale:d,timeZone:p,labels:i,announce:b,accessFailure:r}),[e,d,p,i,b,r]);return It(He.Provider,{value:m,children:Hn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":o,children:[s,It("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${o}-announcer`,ref:u})]})})},C=()=>{let e=$t(He);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Ke=()=>C().announce,Dn=()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as On}from"react";var Kn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Un=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Kn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},O=(e,{testId:t,part:n,host:r})=>{On(()=>{let a=Un(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as Bn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),Bn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var _n=/\s/,Ue=(e,t)=>{if(e===""||_n.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ue(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Xn}from"react/jsx-runtime";var Vn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Be=({subject:e,children:t})=>{let n=Gn(null);return O(n,e),K("span",{ref:n,children:t})},$=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=qn(),m=X(o,b),f=u===!0||o!==void 0,h=Vn[e],y=E=>{if(ye(E),f){E.preventDefault();return}a?.(E)};return Xn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":l,"aria-controls":i,onClick:y,ref:d,...w(p),children:K(Be,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Wn=({onNavigate:e,children:t,testId:n,ref:r})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:K(Be,{subject:{testId:n,part:"label",host:"button"},children:t})})),zn=/^[^\s#]+$/,Jn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!zn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:K(Be,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as At}from"react/jsx-runtime";var jn=({gap:e,testId:t,children:n})=>(g(),At("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),_e=({gap:e,as:t="div",testId:n,children:r})=>(g(),At(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as fe,jsxs as Dt}from"react/jsx-runtime";var Qn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),er=" ",tr=({view:e,handlers:t,testId:n})=>{let r=Ke(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(er):null,s=Zn(null);return Yn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Dt("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Dt("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[fe("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>fe("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:fe(_e,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>fe($,{variant:Qn.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ne,jsxs as Ht}from"react/jsx-runtime";var nr=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ne("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Ht("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Ht("li",{className:"cui-breadcrumb-item",children:[ne("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>me(s,o.href,n),children:o.label}),ne("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ne("li",{className:"cui-breadcrumb-item",children:ne("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ot}from"react";import{useCallback as rr}from"react";var or=229,ar=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&ar.has(e.type)&&(e.value!==""||e.validity.badInput),qe=e=>e.nativeEvent.isComposing||e.keyCode===or,_=(e,t)=>{e.key!=="Escape"||qe(e)||ge(e.target)||(e.stopPropagation(),t())},ir=e=>rr(t=>_(t,e),[e]);import{Fragment as lr,jsx as q,jsxs as re}from"react/jsx-runtime";var Kt=e=>e===void 0?void 0:t=>_(t,e),Ge=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let p=Ot(),u=Kt(a);return re("section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[re("div",{className:"cui-card-header",children:[re("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:q("div",{className:"cui-card-actions",children:r})]}),d]})},sr={3:"h3",4:"h4"},dr=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:p})=>{g();let u=Ot(),c=Kt(o),b=sr[r],m=re(lr,{children:[re("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:m}):q("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:m})};import{jsx as Ut}from"react/jsx-runtime";var ur=({label:e,code:t,testId:n})=>(g(),Ut("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:Ut("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as pr}from"react";import{jsx as cr}from"react/jsx-runtime";var j=({ruleKey:e,css:t})=>cr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as G}from"react/jsx-runtime";var yr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=pr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(j,{ruleKey:i,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:G("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>G("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(m=>G("div",{children:[L("dt",{children:m.label}),L("dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};import{Fragment as hr,useCallback as Rr,useId as Tr,useLayoutEffect as qt,useRef as Je}from"react";var oe="[data-cui-row-focus]",Ve="[data-cui-row-detail]",fr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Bt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ve)&&n.set(a,r);return n},_t=(e,t,n,r)=>{let a=fr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as mr,useLayoutEffect as We,useReducer as gr,useRef as ze}from"react";var br=e=>e+1,ae=e=>{let t=ze(e),n=ze(null),r=ze(!1),[,a]=gr(br,0),o=mr((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return We(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),We(()=>{t.current=e}),We(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as be}from"react/jsx-runtime";var Er=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',xr=(e,t,n)=>{qt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${z} px target does not fit its ${gt} px; use row-control), not <${a.localName}>`)})},wr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Pr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),Nr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Cr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:p,ref:u})=>{g();let c=Tr(),b=Je(null);xr(b,l,p);let m=Je(null),f=Je(Er),h=ae(R=>_t(R,b.current,m.current,f.current));qt(()=>{f.current=Bt(b.current,m.current)});let y=Rr(R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=Et(n);return wr(n,p),S("div",{className:"cui-container","data-testid":p,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:d}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:be("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(R=>S("col",{style:R.width.fixedPx===void 0?void 0:{width:F(R.width.fixedPx)}},R.key))}),S("thead",{children:S("tr",{children:n.map(R=>be("th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:S("div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),S("tbody",{ref:b,children:r.map(R=>be(hr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(s?.(R)),children:n.map(T=>T.rowHeader===!0?be("th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:Pr(T.rowHeaderNote(R))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:Nr(i,R,n.length,o,h)]},a(R)))})]})})})};import{jsx as Xe,jsxs as Lr}from"react/jsx-runtime";var kr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Xe("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Lr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Xe("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Xe("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Gt,useLayoutEffect as Vt,useRef as je}from"react";import{jsx as ie,jsxs as zt}from"react/jsx-runtime";var Wt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Sr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},Mr=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Ir=e=>e instanceof HTMLInputElement&&e.type==="search",$r=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Gt(),d=Gt(),p=je(null),u=je(null),c=je(!1);return Vt(()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Sr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Mr(y,E)}else!n&&y.open&&y.close()},[n,a]),Vt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Wt(u.current),u.current=null)}},[]),zt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:y=>{y.currentTarget.open||(Wt(u.current),u.current=null,n&&r())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=qe(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Ir(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[zt("div",{className:"cui-dialog-header",children:[ie("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ie("div",{className:"cui-dialog-actions",children:ie($,{variant:"secondary",testId:`${o}-close`,onClick:()=>p.current?.close(),children:l.close})})]}),t===void 0?null:ie("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ie("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Oe]:"","data-testid":`${o}-announcer`})]})};import{useId as Fr,useRef as Ar}from"react";import{jsx as Ye,jsxs as Jt}from"react/jsx-runtime";var Dr=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Fr(),s=Ar(null);return O(s,{testId:r,part:"summary",host:"button"}),Jt("div",{className:"cui-disclosure","data-testid":r,children:[Jt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Ye("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Ye("span",{ref:s,children:e})]}),Ye("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Or}from"@aiquants/auth-core";import{Fragment as Kr}from"react";import{jsx as Xt}from"react/jsx-runtime";var Hr=({tone:e,testId:t,children:n})=>(g(),Xt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),se=({occurrence:e,testId:t,children:n})=>(g(),Xt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as jt}from"react/jsx-runtime";var Ze=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Or(e.status);return i===null?jt(se,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):jt(Kr,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as Y}from"react";import{Fragment as Jr,jsx as x,jsxs as A}from"react/jsx-runtime";var Ur=/\s/,Qe=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Ur.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Yt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let r=Y(),a=Y(),o=Y(),s=n===void 0?o:Ue(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Jr,{children:[e===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:x(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),he=({htmlFor:e,hidden:t,children:n})=>x("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Br=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=Z({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[x(he,{htmlFor:s.id,hidden:void 0,children:e}),o(s),x(Q,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},Zt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:r}),T=Y();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=x("input",{className:"cui-input",type:s,name:Qe(l),maxLength:Yt(i),value:a,list:d,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:I=>o(I.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[x(he,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[x("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),x(Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},_r=e=>x(Zt,{...e}),qr=e=>x(Zt,{...e,type:"password"}),Gr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[x(he,{htmlFor:u.id,hidden:void 0,children:e}),x("textarea",{className:"cui-input cui-textarea",name:Qe(s),maxLength:Yt(l),value:a,required:i,onChange:m=>o(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:p,...u}),x(Q,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},Vr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:r}),f=Y(),h=X(d,f);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[x(he,{htmlFor:c.id,hidden:i,children:e}),x("select",{className:"cui-input",name:Qe(l),value:a,onChange:y=>{d===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:o.map(y=>x("option",{value:y.value,children:y.label},y.value))}),x(Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),d?.reason===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:d.reason})]})},Wr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=Y(),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[x("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:m===0?i:void 0}),x("span",{children:b.label})]},b.value)),x(Q,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},zr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:r}),c=o.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((f,h)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[x("input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${f.value}`,ref:h===0?i:void 0}),x("span",{children:f.label})]},f.value)),x(Q,{description:t,error:n,descriptionId:p,errorId:u,testId:l})]})};import{createContext as Xr,useContext as jr,useId as rn,useMemo as Yr}from"react";import{Fragment as dn,jsx as N,jsxs as Re}from"react/jsx-runtime";var on=Xr(null),Qt="surface",en={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},tn={face:"info-tint",line:"info-accent"},an={normal:"border-control",high:"info-accent"},Zr=["normal","high"],Qr=[1,2,3,4],D=M.space["space-2"],eo="fg",to="fg-secondary",sn=e=>{let t=jr(on);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},et=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},no=e=>{g();let t=rn(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;et(o,"widthPx",r),et(o,"heightPx",a);let i=Yr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Re(dn,{children:[N("defs",{children:Zr.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${D} ${D}`,refX:D,refY:D/2,markerWidth:D,markerHeight:D,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${D} ${D/2} L 0 ${D} z`,"data-cui-stroke":an[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(on.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!H(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":Qt,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":o,...w(s),children:d})})}let{viewBox:p,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Qt,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),...u?.handlers,children:d})})},nn=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ro=(e,t,n)=>{for(let r of t){let a=mt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},oo=e=>{g();let t=sn("FigureNode"),n=rn(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!H(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?tn:en[s];ro(c,m,[en[s].face,tn.face]);let h,y,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=nn(c,()=>bt({name:d,notes:m.map(k=>k.text)}));if(et(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=ht(m.length);y=Re("g",{"data-cui-surface":f.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:M.type.body.size,"data-cui-fg":eo,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),m.map((k,I)=>N("text",{x:v.insetPx,y:v.notesPx[I],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${I}`,children:k.text},I))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=nn(c,()=>Rt(d,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},y=Re(dn,{children:[N("g",{"data-cui-surface":f.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":to,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<z||h.height<z)throw new RangeError(`${c}: a pressable node must be at least the ${z} px target: ${h.width} \xD7 ${h.height}`);if(h.left<J||h.top<J||h.left+h.width+J>t.widthPx||h.top+h.height+J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${J} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Re("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...R,"data-testid":c,...w(b),children:[p===void 0?null:N("title",{children:p}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ao=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=sn("FigureEdge");if(!Qr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":an[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as lo}from"react/jsx-runtime";var io={1:"h1",2:"h2",3:"h3"},so=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=io[e];return lo(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as po}from"react/jsx-runtime";var uo={removed:"danger-tint",added:"success-tint"},co=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return po(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":uo[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as mo}from"react/jsx-runtime";var yo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},fo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},tt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?yo[e]:{fg:"on-solid",surface:fo[e]};return mo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};import{useId as go}from"react";import{jsx as de,jsxs as bo}from"react/jsx-runtime";var nt=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=go();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return bo("div",{className:"cui-progress","data-testid":a,children:[de(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),de("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:de("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),de("div",{"aria-hidden":"true",children:de(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as Te,jsxs as ln}from"react/jsx-runtime";var ho=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>ln(Ge,{title:e,actions:r===void 0?void 0:Te($,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[ln("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[Te("span",{className:"cui-visually-hidden",children:`${e} `}),Te(tt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:Te(nt,{...n,testId:`${a}-progress`}),o]});import{createContext as Ro,useContext as To}from"react";import{jsx as le}from"react/jsx-runtime";var rt=Ro(null),Eo="space-2",vo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!H(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return le(rt.Provider,{value:e.marker,children:le(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Eo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},xo=({testId:e,dataAttributes:t,children:n})=>{g();let r=To(rt);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return le("li",{className:"cui-list-item","data-testid":e,...w(t),children:le("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:le(rt.Provider,{value:null,children:n})})})};import{useCallback as un,useLayoutEffect as wo,useRef as Ee}from"react";import{jsx as ve,jsxs as ko}from"react/jsx-runtime";var cn=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ve);return n===null||!e.contains(n)}),Po=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=cn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},No=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Co=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=Ee(null),p=Ee(null),u=Ee(null),c=Ee(!1),b=()=>{let y=o.ref.current;d.current={shown:new Set(y===null?[]:cn(y)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};wo(()=>{let y=c.current;c.current=!1;let E=d.current;if(E===null)return;let R=Po(o);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=No(R,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=un((y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=un((y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?ve("div",{className:"cui-load-more","data-testid":s,children:ve(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${s}-end`,children:i.endOfRecords})}):ko("div",{className:"cui-load-more","data-testid":s,children:[ve($,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:f,testId:`${s}-button`,children:i.loadMore(ce(a,l))}),r===null?null:ve(se,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ot,jsxs as pn}from"react/jsx-runtime";var Lo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=Tt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return pn("div",{className:"cui-container","data-testid":a,children:[ot(j,{ruleKey:o.key,css:o.css}),pn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[ot("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),ot("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as xe}from"react/jsx-runtime";var we=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!H(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return xe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=ce(s,t);return xe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:yt(i,l)})}let{text:a,keep:o}=e;if(a===null)return xe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!H(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return xe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Pe,jsxs as Mo}from"react/jsx-runtime";var So=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return Mo("span",{className:"cui-meter","data-testid":o,children:[Pe("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Pe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Pe("span",{"aria-hidden":"true",children:Pe(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Io,useRef as $o}from"react";import{jsx as at,jsxs as Do}from"react/jsx-runtime";var Fo={ArrowLeft:-1,ArrowRight:1},Ao=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Io(),i=$o(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(f=>f.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let p=d.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=f=>`${l}-tab-${f}`,c=`${l}-panel`,b=f=>{let h=t[f];h.id!==n&&r(h.id),i.current.get(h.id)?.focus()};return Do("div",{className:"cui-panel-tabs","data-testid":a,children:[at("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Fo[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return at("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),at("div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ho}from"@aiquants/auth-core";import{jsx as it,jsxs as Ko}from"react/jsx-runtime";var Oo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=it(Ze,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ho(e.status)!==null?it("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Ko("div",{className:"cui-resource-failed","data-testid":o,children:[l,it($,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as Uo}from"react";import{jsx as V,jsxs as yn}from"react/jsx-runtime";var Bo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=Uo(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?yn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[V("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:V("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):yn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[V("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as _o,useRef as qo}from"react";import{jsx as ee}from"react/jsx-runtime";var fn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:s})=>{g();let l=qo(null);O(l,{testId:r,part:"row",host:"button"});let i=_o(p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return ee("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},Go=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:p,ref:u})=>(g(),ee("div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?ee(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:d}):ee("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return ee("li",{children:ee(fn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Vo}from"react";import{jsx as Ne,jsxs as mn}from"react/jsx-runtime";var Wo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Vo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return mn("div",{className:"cui-field","data-testid":`${l}-field`,children:[Ne("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),mn("div",{className:"cui-slider",children:[Ne("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:p=>s(p.currentTarget.valueAsNumber)}),Ne("span",{className:"cui-slider-value","aria-hidden":"true",children:Ne(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as st,jsxs as bn}from"react/jsx-runtime";var gn={done:0,current:1,pending:2},zo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Jo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&gn[o.state]<gn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return st("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=zo[o.state],i=a[o.state];return bn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[st("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),bn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:st("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Xo,useRef as jo}from"react";import{jsx as Ce,jsxs as hn}from"react/jsx-runtime";var Yo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Xo(),d=jo(null);O(d,{testId:o,part:"label",host:"button"});let p=X(a,i),u=a!==void 0,c=hn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[Ce("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Ce("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Ce("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:hn("span",{className:"cui-button-group",children:[c,Ce(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as Zo,useEffect as Qo,useId as ea,useRef as Rn,useState as ta}from"react";import{jsx as ue,jsxs as Tn}from"react/jsx-runtime";var na=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let l=t.find(m=>m.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=ta(!1),p=Rn(null),u=Rn(null),c=ea(),b=Zo(m=>{d(!1),m&&p.current?.contains(document.activeElement)&&u.current?.focus()},[]);return Qo(()=>{if(!(o&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[o,i,b]),Tn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?m=>_(m,()=>b(!0)):void 0,children:[o?Tn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(m=>!m),children:[ue("span",{className:"cui-tabs-summary-label",children:l.label}),ue("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,ue("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(m=>{let f=m.id===n;return ue("li",{className:"cui-tabs-item",children:ue("a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,r),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};import{Children as ra,Fragment as oa,isValidElement as aa}from"react";import{jsx as W,jsxs as vn}from"react/jsx-runtime";var ia={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},sa=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return vn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[W("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),W("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),W("p",{className:"cui-tile-value","data-cui-fg":ia[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?W(we,{value:e.value,unit:e.unit,testId:l}):W(we,{text:e.text,keep:"wrap",testId:l})})]})},En=e=>ra.toArray(e).flatMap(t=>{if(!aa(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===oa?En(t.props.children):[t]}),da=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=vt(e,t,M.space["space-2"]),o=En(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return vn("div",{className:"cui-container","data-testid":n,children:[W(j,{ruleKey:a.key,css:a.css}),W("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as la,useRef as xn}from"react";import{jsx as ca}from"react/jsx-runtime";var ke=e=>[...e.querySelectorAll("button")],ua=({label:e,testId:t,children:n})=>{g();let r=xn(null),a=xn(null);la(()=>{let i=ke(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let p of i)p.tabIndex=p===d?0:-1});let o=i=>{for(let d of ke(r.current))d.tabIndex=d===i?0:-1;a.current=i};return ca("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=ke(i.currentTarget).find(p=>p.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=ke(i.currentTarget),p=d.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%d.length,[c]:(p-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=d[m];o(f),f.focus()},children:n})};import{useState as pa}from"react";var ya=e=>{let[t,n]=pa({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as te,useEffect as ga,useLayoutEffect as Pn,useRef as ut}from"react";import{useCallback as Le,useEffect as fa,useLayoutEffect as ma,useRef as dt,useState as lt}from"react";var wn=e=>e===null?$e:Fe,Se=(e,t,n,r,a)=>{let[o,s]=lt(()=>({key:e,state:wn(e)})),[l,i]=lt(0),[d,p]=lt(0),u=dt(t),c=dt(null),b=dt(l);ma(()=>{u.current=t}),fa(()=>{if(e===null){s({key:null,state:$e});return}let R=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:Fe}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,l,d]);let m=Le(()=>i(R=>R+1),[]),f=Le(()=>p(R=>R+1),[]),h=Le((R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=Le((R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(o.key,e)?o.state:wn(e),reload:m,refresh:f,update:h,write:y}};var ba=(e,t,n)=>{let r=ut(t);Pn(()=>{r.current=t});let a=te(y=>r.current.first(y),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Se(e,a,n,wt,Pt),p=ut({key:e,state:o});Pn(()=>{p.current={key:e,state:o}});let u=ut(null),c=te(()=>{u.current?.controller.abort(),u.current=null},[]);ga(()=>c,[e,n,c]);let b=te(()=>{c(),s()},[c,s]),m=te(()=>{c(),l()},[c,l]),f=te(()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,Nt),r.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((I,Nn)=>De(I,Nn),Ct(k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=te((y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),d(y,T=>De(T,E))},[d]);return{state:o,reload:b,refresh:m,loadMore:f,updateList:h}};import{useCallback as ha,useRef as Ra,useState as Ta}from"react";var Ea=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",va=()=>{let[e,t]=Ta(null),n=Ra(null),r=ha((a,o)=>{let s=o();if(!Ea(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as xa}from"react";var wa=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Se(e,t,n,xt,Ae),l=xa((i,d)=>s(i,p=>Ae(p,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as Na}from"react/jsx-runtime";var Pa=({testId:e,children:t})=>(g(),Na("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{pe as ANNOUNCE_SETTLE_MS,tr as AccessFailureNotice,se as AlertMessage,nr as Breadcrumb,$ as Button,gt as COMPACT_ROW_PX,Da as CONSOLE_UI_LABEL_CATALOGS,Ka as CONTRAST_MINIMUM,mt as CONTRAST_PAIRS,Ge as Card,dr as CardSection,zr as CheckboxGroup,_e as Cluster,ur as CodeBlock,yr as ComparisonGrid,An as ConsoleUiRoot,Cr as DataTable,kr as DescriptionList,$r as Dialog,Dr as Disclosure,J as FIGURE_RING_REACH_PX,Xa as FLEXIBLE_COLUMN_MIN_PX,Ze as FailureMessage,Br as Field,no as Figure,ao as FigureEdge,oo as FigureNode,Jn as FragmentLink,oi as HTTP_FORBIDDEN,so as Heading,co as InlineChange,ho as JobCard,Ie as LATTICE_PX,Wn as Link,vo as List,xo as ListItem,Co as LoadMore,Ua as MORE_CONTRAST_MINIMUM,Lo as MasterDetail,we as Measured,So as Meter,sa as MetricTile,Hr as Notice,Ao as PanelTabs,qr as PasswordInput,tt as Pill,nt as ProgressBar,_a as ROW_WITH_CONTROL_PX,Wr as RadioGroup,Oo as ResourceFailed,fn as RowButton,Bo as SegmentedControl,Vr as Select,Go as SelectableList,Wo as Slider,jn as Stack,Jo as Stepper,Yo as Switch,z as TARGET_PX,M as TOKENS,ci as TONES,li as TONE_HUES,ui as TONE_ROLES,na as Tabs,P as Text,Gr as TextArea,_r as TextInput,da as TileGrid,ua as Toolbar,Pa as VisuallyHidden,Sa as ZonedTimeError,Nt as beginPage,wt as beginPagedReload,xt as beginReload,Wa as ceil8,Ba as ceilToLattice,za as cellContentInlinePx,ja as comparisonAttributePx,Oa as contrastRatio,Za as countSampleText,qa as cssVar,bt as figureBoxPlan,Rt as figureDiscLabelPlan,Fa as fillLabel,Ja as fixedColumnPx,ii as flatMapOutcome,Ca as formatByteSize,ce as formatCount,$a as formatInstant,ti as goldenSectionPx,Ha as hexToSrgb,Ya as instantSampleText,H as isReadableText,Ae as keepLastGood,si as lightDark,ai as mapOutcome,De as mapPagedList,ni as masterDetailPlan,Va as monoTextWidthEm,di as placeholderRule,F as pxToRem,ka as readDecimalText,La as readIntegerText,Aa as reasonAside,ft as resolveConsoleUiLabels,Pt as settleFirstPage,Ct as settlePage,ei as spacedTextWidthEm,ri as tableFrameMinInlinePx,Et as tableMinInlinePx,Ga as textWidthEm,vt as tileGridPlan,Qa as tileMinInlinePx,Ma as toOffsetIso,Ia as toWallTime,pt as topmostModalOf,Dn as useAccessFailure,Ke as useAnnounce,C as useConsoleUi,ir as useEscapeToClose,ya as useFailureOccurrence,ae as useFocusRescue,ba as usePagedResource,va as usePendingPress,wa as useResource};
|
|
1
|
+
import{$ as Nt,A as Xa,B as Ya,C as Za,D as Qa,E as ei,F as ti,G as ni,H as ri,I as Rt,J as Tt,K as Et,L as X,M as U,N as oi,O as F,P as ai,Q as vt,R as xt,S as ii,T as wt,U as si,V as di,W as li,X as Ae,Y as De,Z as Pt,_ as He,a as yt,aa as Ct,b as ft,ba as kt,c as me,ca as Lt,d as Sa,da as Oe,e as mt,ea as ui,f as Ma,fa as ci,g as Ia,ga as pi,h as O,ha as yi,i as $a,ia as fi,j as Fa,k as Aa,l as Da,m as Ha,n as Oa,o as Ka,p as gt,q as Fe,r as Ga,s as j,t as Va,u as ht,v as M,w as Wa,x as za,y as Ja,z as ja}from"./chunk-HROMRBBM.js";import{a as Ua,e as Ba,f as _a,g as qa,h as $e,i as bt}from"./chunk-RA33TN5N.js";import{useEffect as Qn,useRef as er}from"react";import{useId as Vn,useRef as Wn}from"react";import{createContext as Ln,useCallback as Sn,useContext as At,useLayoutEffect as Mn,useMemo as St,useRef as Mt}from"react";import{jsx as Ft,jsxs as Kn}from"react/jsx-runtime";var Ke=Ln(null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=ft(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(yt)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ge=150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=$t.get(e)??new Set,r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(At(Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!$e.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${$e.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=gt(e),[y]=Intl.getCanonicalLocales(t),u=St(()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=Mt(null),b=Mt(null);Mn(()=>{Fn(c.current.ownerDocument)},[]);let f=Sn(R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:v}=b.current;b.current=null,clearTimeout(T),clearTimeout(v);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=St(()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return Ft(Ke.Provider,{value:m,children:Kn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,Ft("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C=()=>{let e=At(Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be=()=>C().announce,On=()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};import{useLayoutEffect as Un}from"react";var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{Un(()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as qn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),qn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Yn}from"react/jsx-runtime";var zn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},qe=({subject:e,children:t})=>{let n=Wn(null);return D(n,e),K("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=Vn(),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}a?.(h)};return Yn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...w(y),children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn=({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...w(a),children:K(qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ht}from"react/jsx-runtime";var Zn=({gap:e,testId:t,children:n})=>(g(),Ht("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge=({gap:e,as:t="div",testId:n,children:r})=>(g(),Ht(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as be,jsxs as Ot}from"react/jsx-runtime";var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr=({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=er(null);return Qn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Ot("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ot("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[be("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>be("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:be(Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>be(I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ie,jsxs as Kt}from"react/jsx-runtime";var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ie("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Kt("li",{className:"cui-breadcrumb-item",children:[ie("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),ie("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ie("li",{className:"cui-breadcrumb-item",children:ie("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ut}from"react";import{useCallback as ar}from"react";var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||e.nativeEvent.defaultPrevented||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr=e=>ar(t=>q(t,e),[e]);import{Fragment as cr,jsx as G,jsxs as se}from"react/jsx-runtime";var Bt=e=>e===void 0?void 0:t=>q(t,e),We=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=Ut(),u=Bt(a);return se("section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[se("div",{className:"cui-card-header",children:[se("div",{className:"cui-card-heading",children:[G("h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:G("div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=Ut(),c=Bt(o),b=lr[r],f=se(cr,{children:[se("div",{className:"cui-card-section-heading",children:[G(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?G("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:f}):G("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:f})};import{jsx as _t}from"react/jsx-runtime";var pr=({label:e,code:t,testId:n})=>(g(),_t("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_t("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as fr}from"react";import{jsx as yr}from"react/jsx-runtime";var Q=({ruleKey:e,css:t})=>yr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as V}from"react/jsx-runtime";var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=fr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return V("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(Q,{ruleKey:i,css:y}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:V("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),V("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:V("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>V("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return V("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(f=>V("div",{children:[L("dt",{children:f.label}),L("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as Tr,useCallback as Er,useId as vr,useLayoutEffect as Vt,useRef as Xe}from"react";var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as br,useLayoutEffect as Je,useReducer as hr,useRef as je}from"react";var Rr=e=>e+1,le=e=>{let t=je(e),n=je(null),r=je(!1),[,a]=hr(Rr,0),o=br((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return Je(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Je(()=>{t.current=e}),Je(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as Re}from"react/jsx-runtime";var xr=new Map,wr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{Vt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(wr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${j} px target does not fit its ${ht} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=vr(),b=Xe(null);Pr(b,l,y);let f=Xe(null),m=Xe(xr),R=le(h=>Gt(h,b.current,f.current,m.current));Vt(()=>{m.current=qt(b.current,f.current)});let p=Er(h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=xt(n);return Nr(n,y),S("div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):S("section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:Re("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(h=>S("col",{style:h.width.fixedPx===void 0?void 0:{width:F(h.width.fixedPx)}},h.key))}),S("thead",{children:S("tr",{children:n.map(h=>Re("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:S("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),S("tbody",{ref:b,children:r.map(h=>Re(Tr,{children:[S("tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(s?.(h)),children:n.map(T=>T.rowHeader===!0?Re("th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};import{jsx as Ye,jsxs as Mr}from"react/jsx-runtime";var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ye("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ye("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Wt,useLayoutEffect as zt,useRef as Ze}from"react";import{jsx as ue,jsxs as jt}from"react/jsx-runtime";var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Wt(),d=Wt(),y=Ze(null),u=Ze(null),c=Ze(!1);return zt(()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),zt(()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),jt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[jt("div",{className:"cui-dialog-header",children:[ue("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ue("div",{className:"cui-dialog-actions",children:ue(I,{variant:"secondary",testId:`${o}-close`,onClick:()=>y.current?.close(),children:l.close})})]}),t===void 0?null:ue("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ue("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};import{useId as Dr,useRef as Hr}from"react";import{jsx as Qe,jsxs as Xt}from"react/jsx-runtime";var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Dr(),s=Hr(null);return D(s,{testId:r,part:"summary",host:"button"}),Xt("div",{className:"cui-disclosure","data-testid":r,children:[Xt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Qe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Qe("span",{ref:s,children:e})]}),Qe("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ur}from"@aiquants/auth-core";import{Fragment as Br}from"react";import{jsx as Yt}from"react/jsx-runtime";var Kr=({tone:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),ce=({occurrence:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as Zt}from"react/jsx-runtime";var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Ur(e.status);return i===null?Zt(ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):Zt(Br,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as ee}from"react";import{Fragment as Xr,jsx as x,jsxs as A}from"react/jsx-runtime";var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=ee(),a=ee(),o=ee(),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Xr,{children:[e===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:x(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>x("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[x(Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),x(ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=ee();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=x("input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[x(Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[x("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),x(ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr=e=>x(en,{...e}),Vr=e=>x(en,{...e,type:"password"}),Wr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[x(Te,{htmlFor:u.id,hidden:void 0,children:e}),x("textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),x(ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=ee(),R=Y(d,m);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[x(Te,{htmlFor:c.id,hidden:i,children:e}),x("select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>x("option",{value:p.value,children:p.label},p.value))}),x(ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),d?.reason===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=ee(),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[x("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),x("span",{children:b.label})]},b.value)),x(ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[x("input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),x("span",{children:m.label})]},m.value)),x(ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};import{createContext as Yr,useContext as Zr,useId as an,useMemo as Qr}from"react";import{Fragment as un,jsx as N,jsxs as Ee}from"react/jsx-runtime";var sn=Yr(null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=M.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=Zr(sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo=e=>{g();let t=an(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=Qr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Ee(un,{children:[N("defs",{children:eo.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!O(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...w(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),...u?.handlers,children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=bt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io=e=>{g();let t=ln("FigureNode"),n=an(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!O(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>Rt({name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=Tt(f.length);p=Ee("g",{"data-cui-surface":m.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:M.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>N("text",{x:v.insetPx,y:v.notesPx[$],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>Et(d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=Ee(un,{children:[N("g",{"data-cui-surface":m.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<j||R.height<j)throw new RangeError(`${c}: a pressable node must be at least the ${j} px target: ${R.width} \xD7 ${R.height}`);if(R.left<X||R.top<X||R.left+R.width+X>t.widthPx||R.top+R.height+X>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${X} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Ee("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...w(b),children:[y===void 0?null:N("title",{children:y}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as co}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},uo=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return co(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as fo}from"react/jsx-runtime";var po={removed:"danger-tint",added:"success-tint"},yo=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return fo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as bo}from"react/jsx-runtime";var mo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return bo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};import{useId as ho}from"react";import{jsx as pe,jsxs as Ro}from"react/jsx-runtime";var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=ho();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return Ro("div",{className:"cui-progress","data-testid":a,children:[pe(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),pe("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:pe("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),pe("div",{"aria-hidden":"true",children:pe(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as ve,jsxs as cn}from"react/jsx-runtime";var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>cn(We,{title:e,actions:r===void 0?void 0:ve(I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[cn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[ve("span",{className:"cui-visually-hidden",children:`${e} `}),ve(rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:ve(ot,{...n,testId:`${a}-progress`}),o]});import{createContext as Eo,useContext as vo}from"react";import{jsx as ye}from"react/jsx-runtime";var at=Eo(null),xo="space-2",wo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!O(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return ye(at.Provider,{value:e.marker,children:ye(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?xo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po=({testId:e,dataAttributes:t,children:n})=>{g();let r=vo(at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return ye("li",{className:"cui-list-item","data-testid":e,...w(t),children:ye("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:ye(at.Provider,{value:null,children:n})})})};import{useCallback as pn,useLayoutEffect as No,useRef as xe}from"react";import{jsx as we,jsxs as So}from"react/jsx-runtime";var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=xe(null),y=xe(null),u=xe(null),c=xe(!1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};No(()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=pn((p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=pn((p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?we("div",{className:"cui-load-more","data-testid":s,children:we(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):So("div",{className:"cui-load-more","data-testid":s,children:[we(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(me(a,l))}),r===null?null:we(ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=vt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return fn("div",{className:"cui-container","data-testid":a,children:[it(Q,{ruleKey:o.key,css:o.css}),fn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[it("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),it("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Pe}from"react/jsx-runtime";var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!O(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=me(s,t);return Pe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:mt(i,l)})}let{text:a,keep:o}=e;if(a===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!O(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Pe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Ce,jsxs as $o}from"react/jsx-runtime";var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return $o("span",{className:"cui-meter","data-testid":o,children:[Ce("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Ce("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Ce("span",{"aria-hidden":"true",children:Ce(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Fo,useRef as Ao}from"react";import{jsx as st,jsxs as Oo}from"react/jsx-runtime";var Do={ArrowLeft:-1,ArrowRight:1},Ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Fo(),i=Ao(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),i.current.get(R.id)?.focus()};return Oo("div",{className:"cui-panel-tabs","data-testid":a,children:[st("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return st("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),st("div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ko}from"@aiquants/auth-core";import{jsx as dt,jsxs as Bo}from"react/jsx-runtime";var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=dt(et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ko(e.status)!==null?dt("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Bo("div",{className:"cui-resource-failed","data-testid":o,children:[l,dt(I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as _o}from"react";import{jsx as W,jsxs as mn}from"react/jsx-runtime";var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_o(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?mn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[W("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:W("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):mn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[W("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as Go,useRef as Vo}from"react";import{jsx as z}from"react/jsx-runtime";var gn=e=>{let t=Vo(null),n=Go(r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return z("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},Wo=({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return z("a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...w(a),children:l})},zo=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),z("div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?z(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):z("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return z("li",{children:z(bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Jo}from"react";import{jsx as ke,jsxs as hn}from"react/jsx-runtime";var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Jo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return hn("div",{className:"cui-field","data-testid":`${l}-field`,children:[ke("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),hn("div",{className:"cui-slider",children:[ke("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),ke("span",{className:"cui-slider-value","aria-hidden":"true",children:ke(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as lt,jsxs as Tn}from"react/jsx-runtime";var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return lt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return Tn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[lt("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),Tn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:lt("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Zo,useRef as Qo}from"react";import{jsx as Le,jsxs as En}from"react/jsx-runtime";var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Zo(),d=Qo(null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=En("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[Le("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Le("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Le("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:En("span",{className:"cui-button-group",children:[c,Le(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as ta,useEffect as na,useId as ra,useRef as vn,useState as oa}from"react";import{jsx as fe,jsxs as xn}from"react/jsx-runtime";var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=oa(!1),y=vn(null),u=vn(null),c=ra(),b=ta(f=>{d(!1),f&&y.current?.contains(document.activeElement)&&u.current?.focus()},[]);return na(()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),xn("nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?xn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[fe("span",{className:"cui-tabs-summary-label",children:l.label}),fe("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,fe("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return fe("li",{className:"cui-tabs-item",children:fe("a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as ia,Fragment as sa,isValidElement as da}from"react";import{jsx as J,jsxs as Pn}from"react/jsx-runtime";var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return Pn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[J("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),J("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),J("p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?J(Ne,{value:e.value,unit:e.unit,testId:l}):J(Ne,{text:e.text,keep:"wrap",testId:l})})]})},wn=e=>ia.toArray(e).flatMap(t=>{if(!da(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===sa?wn(t.props.children):[t]}),ca=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=wt(e,t,M.space["space-2"]),o=wn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return Pn("div",{className:"cui-container","data-testid":n,children:[J(Q,{ruleKey:a.key,css:a.css}),J("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as pa,useRef as Nn}from"react";import{jsx as fa}from"react/jsx-runtime";var Se=e=>[...e.querySelectorAll("button")],ya=({label:e,testId:t,children:n})=>{g();let r=Nn(null),a=Nn(null);pa(()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return fa("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};import{useState as ma}from"react";var ga=e=>{let[t,n]=ma({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as re,useEffect as Ra,useLayoutEffect as kn,useRef as pt}from"react";import{useCallback as Me,useEffect as ba,useLayoutEffect as ha,useRef as ut,useState as ct}from"react";var Cn=e=>e===null?Ae:De,Ie=(e,t,n,r,a)=>{let[o,s]=ct(()=>({key:e,state:Cn(e)})),[l,i]=ct(0),[d,y]=ct(0),u=ut(t),c=ut(null),b=ut(l);ha(()=>{u.current=t}),ba(()=>{if(e===null){s({key:null,state:Ae});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:De}),u.current(h.signal).then(v=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{h.signal.aborted||s(()=>{throw v})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=Me(()=>i(h=>h+1),[]),m=Me(()=>y(h=>h+1),[]),R=Me((h,T)=>{s(v=>Object.is(v.key,h)?{key:h,state:T(v.state)}:v)},[]),p=Me((h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=pt(t);kn(()=>{r.current=t});let a=re(p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,Nt,Ct),y=pt({key:e,state:o});kn(()=>{y.current={key:e,state:o}});let u=pt(null),c=re(()=>{u.current?.controller.abort(),u.current=null},[]);Ra(()=>c,[e,n,c]);let b=re(()=>{c(),s()},[c,s]),f=re(()=>{c(),l()},[c,l]),m=re(()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,kt),r.current.next(h,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>Oe($,oe),Lt(k,h,v))))},v=>{u.current===T&&i(p,()=>{throw v})})},[i]),R=re((p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>Oe(T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};import{useCallback as Ea,useRef as va,useState as xa}from"react";var wa=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa=()=>{let[e,t]=xa(null),n=va(null),r=Ea((a,o)=>{let s=o();if(!wa(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as Na}from"react";var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,Pt,He),l=Na((i,d)=>s(i,y=>He(y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as La}from"react/jsx-runtime";var ka=({testId:e,children:t})=>(g(),La("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ge as ANNOUNCE_SETTLE_MS,rr as AccessFailureNotice,ce as AlertMessage,or as Breadcrumb,I as Button,ht as COMPACT_ROW_PX,Ka as CONSOLE_UI_LABEL_CATALOGS,_a as CONTRAST_MINIMUM,bt as CONTRAST_PAIRS,We as Card,ur as CardSection,jr as CheckboxGroup,Ge as Cluster,pr as CodeBlock,mr as ComparisonGrid,Hn as ConsoleUiRoot,Lr as DataTable,Sr as DescriptionList,Ar as Dialog,Or as Disclosure,X as FIGURE_RING_REACH_PX,Za as FLEXIBLE_COLUMN_MIN_PX,et as FailureMessage,qr as Field,oo as Figure,so as FigureEdge,io as FigureNode,Xn as FragmentLink,si as HTTP_FORBIDDEN,uo as Heading,yo as InlineChange,To as JobCard,Fe as LATTICE_PX,Jn as Link,wo as List,Po as ListItem,Lo as LoadMore,qa as MORE_CONTRAST_MINIMUM,Mo as MasterDetail,Ne as Measured,Io as Meter,ua as MetricTile,Kr as Notice,Ho as PanelTabs,Vr as PasswordInput,rt as Pill,ot as ProgressBar,Va as ROW_WITH_CONTROL_PX,Jr as RadioGroup,Uo as ResourceFailed,bn as RowButton,Wo as RowLink,qo as SegmentedControl,zr as Select,zo as SelectableList,jo as Slider,Zn as Stack,Yo as Stepper,ea as Switch,j as TARGET_PX,M as TOKENS,fi as TONES,pi as TONE_HUES,yi as TONE_ROLES,aa as Tabs,P as Text,Wr as TextArea,Gr as TextInput,ca as TileGrid,ya as Toolbar,ka as VisuallyHidden,$a as ZonedTimeError,kt as beginPage,Nt as beginPagedReload,Pt as beginReload,ja as ceil8,Ga as ceilToLattice,Xa as cellContentInlinePx,Qa as comparisonAttributePx,Ba as contrastRatio,ti as countSampleText,Wa as cssVar,Rt as figureBoxPlan,Et as figureDiscLabelPlan,Ha as fillLabel,Ya as fixedColumnPx,li as flatMapOutcome,Sa as formatByteSize,me as formatCount,Da as formatInstant,oi as goldenSectionPx,Ua as hexToSrgb,ei as instantSampleText,O as isReadableText,He as keepLastGood,ui as lightDark,di as mapOutcome,Oe as mapPagedList,ai as masterDetailPlan,Ja as monoTextWidthEm,ci as placeholderRule,F as pxToRem,Ma as readDecimalText,Ia as readIntegerText,Oa as reasonAside,gt as resolveConsoleUiLabels,Ct as settleFirstPage,Lt as settlePage,ri as spacedTextWidthEm,ii as tableFrameMinInlinePx,xt as tableMinInlinePx,za as textWidthEm,wt as tileGridPlan,ni as tileMinInlinePx,Fa as toOffsetIso,Aa as toWallTime,ft as topmostModalOf,On as useAccessFailure,Be as useAnnounce,C as useConsoleUi,dr as useEscapeToClose,ga as useFailureOccurrence,le as useFocusRescue,Ta as usePagedResource,Pa as usePendingPress,Ca as useResource};
|