@aiquants/console-ui 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,19 @@
1
- import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, ResourceFailure, SpaceToken, FgRole, TypeToken, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
- export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, MasterDetailOptions, MasterDetailPlan, PageFailure, PagedValue, RadiusToken, ReloadCause, SizeToken, Srgb, StrokeToken, SurfaceRole, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.js";
1
+ import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, TypeToken, ResourceFailure, SpaceToken, FgRole, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
+ export { AccentRole, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, ColorScheme, ColorToken, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TileGridPlan, TileGridStep, TokenName, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, contrastRatio, cssVar, flatMapOutcome, formatCount, formatInstant, hexToSrgb, keepLastGood, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, tableMinInlinePx, textWidthEm, tileGridPlan, toOffsetIso, toWallTime } from "./core.js";
3
3
  import * as react from "react";
4
4
  import { ReactNode, MouseEvent, Ref, RefObject, RefCallback, KeyboardEvent } from "react";
5
+ type BreadcrumbItem = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ readonly href: string;
9
+ };
10
+ type BreadcrumbProps = {
11
+ readonly items: readonly BreadcrumbItem[];
12
+ readonly current: string;
13
+ readonly onNavigate: (href: string) => void;
14
+ readonly testId: string;
15
+ };
16
+ declare const Breadcrumb: ({ items, current, onNavigate, testId }: BreadcrumbProps) => react.JSX.Element;
5
17
  type DataAttributes = Readonly<Record<`data-${string}`, string | number | boolean>>;
6
18
  type ButtonVariant = "primary" | "secondary" | "danger" | "link";
7
19
  type ButtonProps = {
@@ -114,6 +126,32 @@ type DataTableProps<T> = {
114
126
  readonly ref?: Ref<HTMLDivElement>;
115
127
  };
116
128
  declare const DataTable: <T>({ caption, captionHidden, columns, rows, rowKey, rowTestId, rowData, rowSize, empty, testId, ref }: DataTableProps<T>) => react.JSX.Element;
129
+ type DescriptionItem = {
130
+ readonly key: string;
131
+ readonly term: string;
132
+ readonly description: ReactNode;
133
+ };
134
+ type DescriptionListProps = {
135
+ readonly items: readonly DescriptionItem[];
136
+ readonly testId: string;
137
+ };
138
+ declare const DescriptionList: ({ items, testId }: DescriptionListProps) => react.JSX.Element;
139
+ type DialogProps = {
140
+ readonly title: string;
141
+ readonly open: boolean;
142
+ readonly onClose: () => void;
143
+ readonly testId: string;
144
+ readonly children: ReactNode;
145
+ };
146
+ declare const Dialog: ({ title, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
147
+ type DisclosureProps = {
148
+ readonly summary: string;
149
+ readonly open: boolean;
150
+ readonly onOpenChange: (open: boolean) => void;
151
+ readonly testId: string;
152
+ readonly children: ReactNode;
153
+ };
154
+ declare const Disclosure: ({ summary, open, onOpenChange, testId, children }: DisclosureProps) => react.JSX.Element;
117
155
  type FieldControl = {
118
156
  readonly id: string;
119
157
  readonly "aria-describedby": string | undefined;
@@ -170,6 +208,50 @@ type RadioGroupProps = {
170
208
  readonly ref?: Ref<HTMLInputElement>;
171
209
  };
172
210
  declare const RadioGroup: ({ legend, description, error, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
211
+ type HeadingType = Extract<TypeToken, "title" | "heading" | "display" | "display-lg">;
212
+ type HeadingProps = {
213
+ readonly level: 1 | 2 | 3;
214
+ readonly type: HeadingType;
215
+ readonly testId: string;
216
+ readonly headingRef?: Ref<HTMLHeadingElement>;
217
+ readonly children: ReactNode;
218
+ };
219
+ declare const Heading: ({ level, type, testId, headingRef, children }: HeadingProps) => react.JSX.Element;
220
+ type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
221
+ type PillProps = {
222
+ readonly tone: PillTone;
223
+ readonly variant: "tint" | "solid";
224
+ readonly testId: string;
225
+ readonly dataAttributes?: DataAttributes;
226
+ readonly children: ReactNode;
227
+ };
228
+ declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
229
+ type ProgressBarProps = {
230
+ readonly label: string;
231
+ readonly valueText: string;
232
+ readonly value: number | null;
233
+ readonly max: number | null;
234
+ readonly testId: string;
235
+ };
236
+ declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
237
+ type JobCancel = {
238
+ readonly label: string;
239
+ readonly busyLabel: string;
240
+ readonly busy: boolean;
241
+ readonly onCancel: () => void;
242
+ };
243
+ type JobCardProps = {
244
+ readonly title: string;
245
+ readonly status: {
246
+ readonly tone: PillTone;
247
+ readonly label: string;
248
+ };
249
+ readonly progress?: Omit<ProgressBarProps, "testId">;
250
+ readonly cancel?: JobCancel;
251
+ readonly testId: string;
252
+ readonly children?: ReactNode;
253
+ };
254
+ declare const JobCard: ({ title, status, progress, cancel, testId, children }: JobCardProps) => react.JSX.Element;
173
255
  type LoadMoreProps = {
174
256
  readonly onLoad: () => void;
175
257
  readonly busy: boolean;
@@ -212,23 +294,6 @@ type AlertMessageProps = {
212
294
  readonly children: ReactNode;
213
295
  };
214
296
  declare const AlertMessage: ({ occurrence, testId, children }: AlertMessageProps) => react.JSX.Element;
215
- type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
216
- type PillProps = {
217
- readonly tone: PillTone;
218
- readonly variant: "tint" | "solid";
219
- readonly testId: string;
220
- readonly dataAttributes?: DataAttributes;
221
- readonly children: ReactNode;
222
- };
223
- declare const Pill: ({ tone, variant, testId, dataAttributes, children }: PillProps) => react.JSX.Element;
224
- type ProgressBarProps = {
225
- readonly label: string;
226
- readonly valueText: string;
227
- readonly value: number | null;
228
- readonly max: number | null;
229
- readonly testId: string;
230
- };
231
- declare const ProgressBar: ({ label, valueText, value, max, testId }: ProgressBarProps) => react.JSX.Element;
232
297
  type ResourceFailedProps = {
233
298
  readonly failure: ResourceFailure;
234
299
  readonly onReload: () => void;
@@ -238,6 +303,18 @@ type ResourceFailedProps = {
238
303
  readonly testId: string;
239
304
  };
240
305
  declare const ResourceFailed: ({ failure, onReload, forbiddenMessage, failureMessage, rescueRef, testId }: ResourceFailedProps) => react.JSX.Element;
306
+ type SegmentedOption = {
307
+ readonly value: string;
308
+ readonly label: string;
309
+ };
310
+ type SegmentedControlProps = {
311
+ readonly label: string;
312
+ readonly options: readonly SegmentedOption[];
313
+ readonly value: string;
314
+ readonly onValueChange: (value: string) => void;
315
+ readonly testId: string;
316
+ };
317
+ declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
241
318
  type RowButtonProps = {
242
319
  readonly selected: boolean;
243
320
  readonly controls: string;
@@ -263,6 +340,17 @@ type SelectableListProps<T> = {
263
340
  readonly ref?: Ref<HTMLDivElement>;
264
341
  };
265
342
  declare const SelectableList: <T>({ label, items, itemKey, selectedKey, onSelect, detailId, renderRow, rowTestId, rowData, empty, testId, ref }: SelectableListProps<T>) => react.JSX.Element;
343
+ type SliderProps = {
344
+ readonly label: string;
345
+ readonly value: number;
346
+ readonly min: number;
347
+ readonly max: number;
348
+ readonly step: number;
349
+ readonly valueText: (value: number) => string;
350
+ readonly onValueChange: (value: number) => void;
351
+ readonly testId: string;
352
+ };
353
+ declare const Slider: ({ label, value, min, max, step, valueText, onValueChange, testId }: SliderProps) => react.JSX.Element;
266
354
  type StackProps = {
267
355
  readonly gap: SpaceToken;
268
356
  readonly testId: string;
@@ -270,6 +358,38 @@ type StackProps = {
270
358
  };
271
359
  declare const Stack: ({ gap, testId, children }: StackProps) => react.JSX.Element;
272
360
  declare const Cluster: ({ gap, testId, children }: StackProps) => react.JSX.Element;
361
+ type StepState = "done" | "current" | "pending";
362
+ type StepperItem = {
363
+ readonly id: string;
364
+ readonly label: string;
365
+ readonly state: StepState;
366
+ };
367
+ type StepperProps = {
368
+ readonly label: string;
369
+ readonly steps: readonly StepperItem[];
370
+ readonly testId: string;
371
+ };
372
+ declare const Stepper: ({ label, steps, testId }: StepperProps) => react.JSX.Element;
373
+ type SwitchProps = {
374
+ readonly label: string;
375
+ readonly checked: boolean;
376
+ readonly onCheckedChange: (checked: boolean) => void;
377
+ readonly testId: string;
378
+ };
379
+ declare const Switch: ({ label, checked, onCheckedChange, testId }: SwitchProps) => react.JSX.Element;
380
+ type TabItem = {
381
+ readonly id: string;
382
+ readonly label: string;
383
+ readonly href: string;
384
+ };
385
+ type TabsProps = {
386
+ readonly label: string;
387
+ readonly items: readonly TabItem[];
388
+ readonly currentId: string;
389
+ readonly onNavigate: (href: string) => void;
390
+ readonly testId: string;
391
+ };
392
+ declare const Tabs: ({ label, items, currentId, onNavigate, testId }: TabsProps) => react.JSX.Element;
273
393
  type TextFace = "sans" | "mono";
274
394
  type TextProps = {
275
395
  readonly fg: FgRole;
@@ -300,6 +420,12 @@ type TileGridProps = {
300
420
  readonly children: ReactNode;
301
421
  };
302
422
  declare const TileGrid: ({ count, minInlinePx, testId, children }: TileGridProps) => react.JSX.Element;
423
+ type ToolbarProps = {
424
+ readonly label: string;
425
+ readonly testId: string;
426
+ readonly children: ReactNode;
427
+ };
428
+ declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
303
429
  declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
304
430
  declare const useFocusRescue: (getTarget: () => HTMLElement | null) => RefCallback<HTMLElement>;
305
431
  type PagedLoaders<T, C, M> = {
@@ -326,4 +452,4 @@ type VisuallyHiddenProps = {
326
452
  readonly children: ReactNode;
327
453
  };
328
454
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
329
- export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, Select, type SelectProps, SelectableList, type SelectableListProps, SpaceToken, Stack, type StackProps, Text, TextArea, type TextAreaProps, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
455
+ export { ANNOUNCE_SETTLE_MS, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, Cluster, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Heading, type HeadingProps, type HeadingType, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, 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, type TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, useResource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as te,B as W,C as Po,a as V,b as io,c as lo,d as co,e as uo,f as po,g as yo,h as ue,i as A,j as mo,k as pe,l as ye,m as fo,n as go,o as Ro,p as me,q as bo,r as To,s as Q,t as j,u as fe,v as ee,w as ge,x as Re,y as be,z as Te}from"./chunk-UKP35ZC3.js";import{a as ho,b as vo,c as Co,d as xo}from"./chunk-MYMCHY7C.js";import{useId as et}from"react";import{createContext as qe,useCallback as _e,useContext as xe,useLayoutEffect as Ge,useMemo as he,useRef as ve}from"react";import{jsx as Ce,jsxs as Qe}from"react/jsx-runtime";var oe=qe(null),Ve=" ",We='[inert], [aria-hidden="true" i]',Pe="dialog:modal",Ze=e=>{if(e.closest(We)!==null)return'an ancestor is inert or aria-hidden="true"';let t=e.ownerDocument,o=[...t.querySelectorAll(Pe)],r=t.activeElement,n=o.filter(l=>l.contains(r)),a=n.length>0?n:o,s=a.filter(l=>l.contains(e)).length;return s===a.length?null:s===0?"the topmost open modal dialog does not contain the console":"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"},ze=e=>{try{e.querySelectorAll(Pe)}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}},re=150,Ye=1e3,Xe=({locale:e,formatLocale:t,timeZone:o,testId:r,children:n})=>{if(xe(oe)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=ue(e),[l]=Intl.getCanonicalLocales(t),d=he(()=>new Intl.DateTimeFormat(l,{timeZone:o}).resolvedOptions().timeZone,[l,o]),u=ve(null),p=ve(null);Ge(()=>{ze(u.current.ownerDocument)},[]);let i=_e(y=>{if(y.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let R=()=>{let{texts:N,settle:g,deadline:b}=p.current;p.current=null,clearTimeout(g),clearTimeout(b);let f=u.current;if(f===null)return;let T=N.join(Ve),h=Ze(f);if(h!==null)throw new Error(`announce: the live region is hidden from assistive technology (${h}), so this announcement would be lost: ${T}`);let L=f.ownerDocument.createElement("span");L.textContent=T,f.replaceChildren(L)},P=p.current;if(P===null){p.current={texts:[y],settle:setTimeout(R,re),deadline:setTimeout(R,Ye)};return}P.texts.push(y),clearTimeout(P.settle),P.settle=setTimeout(R,re)},[]),c=he(()=>({locale:e,formatLocale:l,timeZone:d,labels:s,announce:i}),[e,l,d,s,i]);return Ce(oe.Provider,{value:c,children:Qe("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[n,Ce("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},w=()=>{let e=xe(oe);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},m=()=>{w()},Je=()=>w().announce;var E=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};import{jsx as je}from"react/jsx-runtime";var x=({fg:e,type:t,face:o,as:r="span",testId:n,id:a,tabIndex:s,ref:l,children:d})=>(m(),je(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:a,tabIndex:s,ref:l,children:d}));import{jsx as F,jsxs as rt}from"react/jsx-runtime";var tt={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:"prose"}},Ee=({children:e})=>F("span",{children:e}),O=({variant:e,children:t,testId:o,type:r="button",onClick:n,unavailable:a,expanded:s,controls:l,ref:d,dataAttributes:u,busy:p,busyLabel:i})=>{m();let c=et(),y=p===!0||a!==void 0,R=tt[e],P=N=>{if(y){N.preventDefault();return}n?.(N)};return rt("span",{className:"cui-button-group",children:[F("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":R.fg,"data-cui-surface":R.surface,"data-cui-type":R.type,"data-testid":o,"aria-disabled":y?!0:void 0,"aria-busy":p===!0?!0:void 0,"aria-describedby":a===void 0?void 0:c,"aria-expanded":s,"aria-controls":l,onClick:P,ref:d,...E(u),children:F(Ee,{children:p===!0?i:t})}),a===void 0?null:F(x,{fg:"fg-muted",type:"body",id:c,testId:`${o}-reason`,children:a.reason})]})},ot=({onNavigate:e,children:t,testId:o,ref:r})=>(m(),F("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"prose","data-testid":o,onClick:e,ref:r,children:F(Ee,{children:t})}));import{useId as Ne}from"react";import{Fragment as st,jsx as k,jsxs as $}from"react/jsx-runtime";var at=({id:e,title:t,description:o,actions:r,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=Ne();return $("section",{className:"cui-card",id:e,"aria-labelledby":u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...E(l),children:[$("div",{className:"cui-card-header",children:[$("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:u,"data-cui-type":"title",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),r===void 0?null:k("div",{className:"cui-card-actions",children:r})]}),d]})},nt=({id:e,title:t,subtitle:o,region:r=!1,testId:n,headingRef:a,ref:s,dataAttributes:l,children:d})=>{m();let u=Ne(),p=$(st,{children:[$("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:u,"data-cui-type":"body",ref:a,tabIndex:a===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),d]});return r?k("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":n,ref:s,...E(l),children:p}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...E(l),children:p})};import{useId as lt}from"react";import{jsx as it}from"react/jsx-runtime";var D=({ruleKey:e,css:t})=>it("style",{href:e,precedence:"cui",children:t});import{jsx as C,jsxs as S}from"react/jsx-runtime";var dt=({caption:e,attributes:t,columns:o,attributePx:r,columnMinPx:n,testId:a})=>{m();let s=lt();for(let i of[r,n])if(!(Number.isFinite(i)&&i>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${i}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let i of o)for(let c of t)if(!Object.hasOwn(i.cells,c.key))throw new RangeError(`Column "${i.key}" has no value for attribute "${c.key}"`);let l=r+o.length*n,d=`cui-comparison-a${r}-c${n}-n${o.length}`,u=i=>`[data-cui-comparison="${d}"][data-cui-comparison-layout="${i}"]`,p=`${u("table")}{display:none}@container (min-width:${A(l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return S("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":a,children:[C(D,{ruleKey:d,css:p}),C("div",{className:"cui-comparison-frame","data-cui-comparison":d,"data-cui-comparison-layout":"table",children:S("table",{className:"cui-comparison-table","data-cui-type":"prose",children:[C("caption",{className:"cui-visually-hidden",children:e}),S("colgroup",{children:[C("col",{style:{width:A(r)}}),o.map(i=>C("col",{},i.key))]}),C("thead",{children:S("tr",{children:[C("td",{}),o.map(i=>C("th",{scope:"col",children:i.heading},i.key))]})}),C("tbody",{children:t.map(i=>S("tr",{children:[C("th",{scope:"row",children:i.label}),o.map(c=>C("td",{children:c.cells[i.key]("table")},c.key))]},i.key))})]})}),C("div",{className:"cui-comparison-stack","data-cui-comparison":d,"data-cui-comparison-layout":"stack",children:o.map((i,c)=>{let y=`${s}-column-${c}`;return S("div",{className:"cui-comparison-column",role:"group","aria-labelledby":y,"data-cui-type":"prose",children:[C("p",{className:"cui-comparison-heading",id:y,children:i.heading}),C("dl",{className:"cui-comparison-list",children:t.map(R=>S("div",{children:[C("dt",{children:R.label}),C("dd",{children:i.cells[R.key]("stack")})]},R.key))})]},i.key)})})]})};import{useId as ct}from"react";import{jsx as M,jsxs as pt}from"react/jsx-runtime";var ut=({caption:e,captionHidden:t,columns:o,rows:r,rowKey:n,rowTestId:a,rowData:s,rowSize:l,empty:d,testId:u,ref:p})=>{m();let i=ct(),c=ye(o);return M("div",{className:"cui-container","data-testid":u,ref:p,children:r.length===0?M(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-empty`,children:d}):M("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":i,"data-testid":`${u}-frame`,children:pt("table",{className:"cui-table","data-cui-type":"prose","data-cui-row-size":l,style:{"--cui-table-min":A(c)},children:[M("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:i,children:e}),M("colgroup",{children:o.map(y=>M("col",{style:y.width.fixedPx===void 0?void 0:{width:A(y.width.fixedPx)}},y.key))}),M("thead",{children:M("tr",{children:o.map(y=>M("th",{scope:"col","data-cui-align":y.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:y.header},y.key))})}),M("tbody",{children:r.map(y=>M("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":a,...E(s?.(y)),children:o.map(R=>M("td",{"data-cui-align":R.align,children:R.cell(y)},R.key))},n(y)))})]})})})};import{useId as Z}from"react";import{Fragment as bt,jsx as v,jsxs as I}from"react/jsx-runtime";var B=({description:e,error:t})=>{m();let o=Z(),r=Z(),n=Z(),a=[e===void 0?null:r,t===void 0?null:n].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":a===""?void 0:a,"aria-invalid":t===void 0?void 0:!0},descriptionId:r,errorId:n}},q=({description:e,error:t,descriptionId:o,errorId:r,testId:n})=>I(bt,{children:[e===void 0?null:v(x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:v(x,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${n}-error`,children:t})]}),yt=({label:e,description:t,error:o,testId:r,children:n})=>{let{control:a,descriptionId:s,errorId:l}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":r,children:[v("label",{className:"cui-field-label",htmlFor:a.id,"data-cui-type":"body",children:e}),n(a),v(q,{description:t,error:o,descriptionId:s,errorId:l,testId:r})]})},mt=({label:e,description:t,error:o,value:r,onValueChange:n,type:a,list:s,required:l,testId:d,ref:u})=>{let{control:p,descriptionId:i,errorId:c}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${d}-field`,children:[v("label",{className:"cui-field-label",htmlFor:p.id,"data-cui-type":"body",children:e}),v("input",{className:"cui-input",type:a,value:r,list:s,required:l,onChange:y=>n(y.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":d,ref:u,...p}),v(q,{description:t,error:o,descriptionId:i,errorId:c,testId:d})]})},ft=({label:e,description:t,error:o,value:r,onValueChange:n,required:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),v("textarea",{className:"cui-input cui-textarea",value:r,required:a,onChange:i=>n(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:l,...d}),v(q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},gt=({label:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let{control:d,descriptionId:u,errorId:p}=B({label:e,description:t,error:o});return I("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:d.id,"data-cui-type":"body",children:e}),v("select",{className:"cui-input",value:r,onChange:i=>a(i.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:l,...d,children:n.map(i=>v("option",{value:i.value,children:i.label},i.value))}),v(q,{description:t,error:o,descriptionId:u,errorId:p,testId:s})]})},Rt=({legend:e,description:t,error:o,value:r,options:n,onValueChange:a,testId:s,ref:l})=>{let d=Z(),{control:u,descriptionId:p,errorId:i}=B({label:e,description:t,error:o});return I("fieldset",{className:"cui-radio-group","aria-describedby":u["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((c,y)=>I("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:d,value:c.value,checked:c.value===r,onChange:()=>a(c.value),"aria-invalid":u["aria-invalid"],"data-testid":`${s}-option-${c.value}`,ref:y===0?l:void 0}),v("span",{children:c.label})]},c.value)),v(q,{description:t,error:o,descriptionId:p,errorId:i,testId:s})]})};import{useCallback as ke,useLayoutEffect as xt,useRef as z}from"react";import{jsx as Me}from"react/jsx-runtime";var Tt=({tone:e,testId:t,children:o})=>(m(),Me("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-testid":t,children:o})),_=({occurrence:e,testId:t,children:o})=>(m(),Me("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as ht,useLayoutEffect as we,useReducer as vt,useRef as Le}from"react";var Ct=e=>e+1,ae=e=>{let t=Le(e),o=Le(null),[,r]=vt(Ct,0),n=ht((a=>()=>{a.contains(document.activeElement)&&(o.current=a,r())}),[]);return we(()=>{t.current=e}),we(()=>{let a=o.current;if(a===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);a.isConnected||!s||t.current()?.focus()}),n};import{jsx as Y,jsxs as Mt}from"react/jsx-runtime";var ne="[data-cui-row-focus]",Pt=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 o=[...t.querySelectorAll(ne)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${ne} elements for ${e.count} rows`);return o},Et=(e,t)=>{let o=-1;return e.forEach((r,n)=>{t.has(r)&&(o=n)}),e[o+1]},Nt=({onLoad:e,busy:t,done:o,failure:r,limit:n,rows:a,testId:s})=>{let{formatLocale:l,labels:d}=w(),u=z(null),p=z(null),i=z(null),c=z(!1),y=()=>{let g=a.ref.current;u.current={shown:new Set(g===null?[]:g.querySelectorAll(ne)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};xt(()=>{let g=c.current;c.current=!1;let b=u.current;if(b===null)return;let f=Pt(a);if(t){b.busySeen=!0,b.shown=new Set(f);return}let T=Et(f,b.shown),h=r!==null&&r.occurrence!==b.failureOccurrence;if(!(b.busySeen||T!==void 0||h||o)||(u.current=null,h||T===void 0))return;let L=[null,document.body].includes(document.activeElement);(i.current!==null&&document.activeElement===i.current||g&&L)&&T.focus()});let R=ae(()=>o?p.current:i.current),P=ke((g=>{i.current=g;let b=R(g);return()=>{i.current=null,c.current=g===document.activeElement,b()}}),[R]),N=ke((g=>{p.current=g;let b=R(g);return()=>{p.current=null,b()}}),[R]);return o?Y("div",{className:"cui-load-more","data-testid":s,children:Y(x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:N,testId:`${s}-end`,children:d.endOfRecords})}):Mt("div",{className:"cui-load-more","data-testid":s,children:[Y(O,{variant:"secondary",busy:t,busyLabel:d.loading,onClick:y,ref:P,testId:`${s}-button`,children:d.loadMore(V(n,l))}),r===null?null:Y(_,{occurrence:r.occurrence,testId:`${s}-failure`,children:d.loadFailed(r.reason)})]})};import{jsx as se,jsxs as Se}from"react/jsx-runtime";var wt=({master:e,detail:t,masterMinPx:o,detailMinPx:r,testId:n})=>{m();let a=pe({masterMinPx:o,detailMinPx:r,gapPx:W.space["space-6"]});return Se("div",{className:"cui-container","data-testid":n,children:[se(D,{ruleKey:a.key,css:a.css}),Se("div",{className:"cui-master-detail","data-cui-master-detail":a.key,children:[se("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),se("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as Ie}from"react/jsx-runtime";var ie=({value:e,unit:t,testId:o})=>{let{formatLocale:r,labels:n}=w();if(e===null)return Ie("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let a=V(e,r);return Ie("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?a:`${a} ${t}`})};import{jsx as It}from"react/jsx-runtime";var Lt={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"}},kt={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},St=({tone:e,variant:t,testId:o,dataAttributes:r,children:n})=>{m();let a=t==="tint"?Lt[e]:{fg:"on-solid",surface:kt[e]};return It("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":a.fg,"data-cui-surface":a.surface,"data-cui-type":"caption","data-testid":o,...E(r),children:n})};import{useId as At}from"react";import{jsx as G,jsxs as Dt}from"react/jsx-runtime";var Ft=({label:e,valueText:t,value:o,max:r,testId:n})=>{m();let a=At();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=r===null?null:{max:r,now:Math.min(o,r)};return Dt("div",{className:"cui-progress","data-testid":n,children:[G(x,{as:"p",fg:"fg",type:"body",id:a,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":a,"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":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as Ae,jsxs as Kt}from"react/jsx-runtime";var Ut=403,Ht=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:r,rescueRef:n,testId:a})=>{let{labels:s}=w(),l=e.status===Ut,d=r===void 0?s.loadFailed:r;return Kt("div",{className:"cui-resource-failed","data-testid":a,children:[Ae(_,{occurrence:e.occurrence,testId:`${a}-alert`,children:l?s.forbiddenBecause(o,e.reason):d(e.reason)}),l?null:Ae(O,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${a}-reload`,children:s.reload})]})};import{jsx as U}from"react/jsx-runtime";var Fe=({selected:e,controls:t,onSelect:o,testId:r,dataAttributes:n,ref:a,children:s})=>(m(),U("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":"prose","data-testid":r,onClick:o,ref:a,...E(n),children:s})),Ot=({label:e,items:t,itemKey:o,selectedKey:r,onSelect:n,detailId:a,renderRow:s,rowTestId:l,rowData:d,empty:u,testId:p,ref:i})=>(m(),U("div",{className:"cui-selectable","data-testid":p,ref:i,children:t.length===0?U(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):U("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let y=o(c);return U("li",{children:U(Fe,{selected:y===r,controls:a,onSelect:()=>n(c),testId:l,dataAttributes:d?.(c),children:s(c)})},y)})})}));import{jsx as De}from"react/jsx-runtime";var $t=({gap:e,testId:t,children:o})=>(m(),De("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Bt=({gap:e,testId:t,children:o})=>(m(),De("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{Children as qt,Fragment as _t,isValidElement as Gt}from"react";import{jsx as H,jsxs as He}from"react/jsx-runtime";var Vt={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Wt=({label:e,sublabel:t,value:o,tone:r,testId:n,dataAttributes:a})=>{if(m(),o===null&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);return He("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":n,...E(a),children:[H("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),H("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),H("p",{className:"cui-tile-value","data-cui-fg":Vt[r],"data-cui-type":"heading",children:H(ie,{value:o,testId:`${n}-value`})})]})},Ue=e=>qt.toArray(e).flatMap(t=>{if(!Gt(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_t?Ue(t.props.children):[t]}),Zt=({count:e,minInlinePx:t,testId:o,children:r})=>{m();let n=me(e,t,W.space["space-2"]),a=Ue(r).length;if(a!==e)throw new RangeError(`TileGrid has ${a} tiles but count is ${e}`);return He("div",{className:"cui-container","data-testid":o,children:[H(D,{ruleKey:n.key,css:n.css}),H("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:r})]})};import{useCallback as zt}from"react";var Yt=229,Xt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),Jt=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Xt.has(e.type)&&(e.value!==""||e.validity.badInput),Qt=e=>zt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Yt||Jt(t.target)||(t.stopPropagation(),e())},[e]);import{useCallback as K,useEffect as to,useLayoutEffect as Oe,useRef as ce}from"react";import{useCallback as X,useEffect as jt,useLayoutEffect as eo,useRef as le,useState as de}from"react";var Ke=e=>e===null?Q:j,J=(e,t,o,r,n)=>{let[a,s]=de(()=>({key:e,state:Ke(e)})),[l,d]=de(0),[u,p]=de(0),i=le(t),c=le(null),y=le(l);eo(()=>{i.current=t}),jt(()=>{if(e===null){s({key:null,state:Q});return}let f=new AbortController;c.current=e;let T=l===y.current?"revision":"reload";return y.current=l,s(h=>Object.is(h.key,e)?{key:e,state:r(h.state,T)}:{key:e,state:j}),i.current(f.signal).then(h=>{f.signal.aborted||(c.current=null,s(L=>({key:e,state:n(L.state,h)})))},h=>{f.signal.aborted||s(()=>{throw h})}),()=>{f.abort(),c.current=null}},[e,o,l,u]);let R=X(()=>d(f=>f+1),[]),P=X(()=>p(f=>f+1),[]),N=X((f,T)=>{s(h=>Object.is(h.key,f)?{key:f,state:T(h.state)}:h)},[]),g=X((f,T)=>{N(f,T),Object.is(c.current,f)&&P()},[N,P]);return{state:Object.is(a.key,e)?a.state:Ke(e),reload:R,refresh:P,update:N,write:g}};var oo=(e,t,o)=>{let r=ce(t);Oe(()=>{r.current=t});let n=K(g=>r.current.first(g),[]),{state:a,reload:s,refresh:l,update:d,write:u}=J(e,n,o,ge,Re),p=ce({key:e,state:a});Oe(()=>{p.current={key:e,state:a}});let i=ce(null),c=K(()=>{i.current?.controller.abort(),i.current=null},[]);to(()=>c,[e,o,c]);let y=K(()=>{c(),s()},[c,s]),R=K(()=>{c(),l()},[c,l]),P=K(()=>{let{key:g,state:b}=p.current;if(g===null||b.kind!=="ready"||b.refreshing||b.value.next===null||b.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 f=b.value.next,T={key:g,controller:new AbortController,maps:[]};i.current=T,d(g,be),r.current.next(f,T.controller.signal).then(h=>{i.current===T&&(i.current=null,d(g,L=>T.maps.reduce(($e,Be)=>te($e,Be),Te(L,f,h))))},h=>{i.current===T&&d(g,()=>{throw h})})},[d]),N=K((g,b)=>{let f=i.current;f!==null&&Object.is(f.key,g)&&f.maps.push(b),u(g,T=>te(T,b))},[u]);return{state:a,reload:y,refresh:R,loadMore:P,updateList:N}};import{useCallback as ro}from"react";var ao=(e,t,o)=>{let{state:r,reload:n,refresh:a,write:s}=J(e,t,o,fe,ee),l=ro((d,u)=>s(d,p=>ee(p,{ok:!0,value:u})),[s]);return{state:r,reload:n,refresh:a,put:l}};import{jsx as so}from"react/jsx-runtime";var no=({testId:e,children:t})=>(m(),so("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{re as ANNOUNCE_SETTLE_MS,_ as AlertMessage,O as Button,yo as CONSOLE_UI_LABEL_CATALOGS,Co as CONTRAST_MINIMUM,xo as CONTRAST_PAIRS,at as Card,nt as CardSection,Bt as Cluster,dt as ComparisonGrid,Xe as ConsoleUiRoot,ut as DataTable,yt as Field,ot as Link,Nt as LoadMore,wt as MasterDetail,ie as Measured,Wt as MetricTile,Tt as Notice,St as Pill,Ft as ProgressBar,Rt as RadioGroup,Ht as ResourceFailed,Fe as RowButton,gt as Select,Ot as SelectableList,$t as Stack,W as TOKENS,x as Text,ft as TextArea,mt as TextInput,Zt as TileGrid,no as VisuallyHidden,io as ZonedTimeError,be as beginPage,ge as beginPagedReload,fe as beginReload,Ro as ceil8,vo as contrastRatio,Po as cssVar,To as flatMapOutcome,V as formatCount,uo as formatInstant,ho as hexToSrgb,ee as keepLastGood,bo as mapOutcome,te as mapPagedList,mo as masterDetailPlan,go as monoTextWidthEm,po as reasonAside,ue as resolveConsoleUiLabels,Re as settleFirstPage,Te as settlePage,ye as tableMinInlinePx,fo as textWidthEm,me as tileGridPlan,lo as toOffsetIso,co as toWallTime,Je as useAnnounce,w as useConsoleUi,Qt as useEscapeToClose,ae as useFocusRescue,oo as usePagedResource,ao as useResource};
1
+ import{A as He,B as le,C as Rr,D as Tr,E as hr,F as vr,G as z,H as Cr,a as W,b as or,c as rr,d as ar,e as nr,f as bt,g as sr,h as ir,i as ne,j as se,k as Le,l as ie,m as lr,n as dr,o as Se,p as D,q as cr,r as Me,s as ke,t as ur,u as pr,v as yr,w as Ie,x as Ae,y as De,z as $e}from"./chunk-BUX2DNVR.js";import{a as mr,b as fr,c as gr,d as br}from"./chunk-BMGBEN26.js";import{createContext as Rt,useCallback as Tt,useContext as Be,useLayoutEffect as ht,useMemo as Fe,useRef as Ue}from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var de=Rt(null),vt=" ",Oe='[inert], [aria-hidden="true" i]',qe="dialog:modal",ue="data-cui-dialog-announcer",Ct=`:scope > [${ue}]`,xt=e=>{if(e.closest(Oe)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,o=[...t.querySelectorAll(qe)],a=t.activeElement,n=o.filter(c=>c.contains(a)),r=n.length>0?n:o,s=r.filter(c=>c.contains(e)).length;if(s===r.length)return{region:e};let d=r.find(c=>r.every(u=>u.contains(c))),i=d?.querySelector(Ct)??null;return d!==void 0&&i!==null&&e.parentElement.contains(d)&&i.closest(Oe)===null?{region:i}:s===0?{hidden:"the topmost open modal dialog does not contain the console"}:{hidden:"open modal dialogs both contain and do not contain the console, and focus does not tell which one is topmost"}},Et=e=>{try{e.querySelectorAll(qe)}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}},ce=150,Nt=1e3,Pt=({locale:e,formatLocale:t,timeZone:o,testId:a,children:n})=>{if(Be(de)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let s=Se(e),[d]=Intl.getCanonicalLocales(t),i=Fe(()=>new Intl.DateTimeFormat(d,{timeZone:o}).resolvedOptions().timeZone,[d,o]),c=Ue(null),u=Ue(null);ht(()=>{Et(c.current.ownerDocument)},[]);let l=Tt(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let g=()=>{let{texts:w,settle:b,deadline:R}=u.current;u.current=null,clearTimeout(b),clearTimeout(R);let f=c.current;if(f===null)return;let h=w.join(vt),T=xt(f);if("hidden"in T)throw new Error(`announce: the live region is hidden from assistive technology (${T.hidden}), so this announcement would be lost: ${h}`);let M=f.ownerDocument.createElement("span");M.textContent=h,T.region.replaceChildren(M)},C=u.current;if(C===null){u.current={texts:[m],settle:setTimeout(g,ce),deadline:setTimeout(g,Nt)};return}C.texts.push(m),clearTimeout(C.settle),C.settle=setTimeout(g,ce)},[]),y=Fe(()=>({locale:e,formatLocale:d,timeZone:i,labels:s,announce:l}),[e,d,i,s,l]);return Ke(de.Provider,{value:y,children:Lt("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[n,Ke("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:c})]})})},N=()=>{let e=Be(de);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},p=()=>{N()},wt=()=>N().announce;var J=(e,t,o)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o(t))};import{jsx as K,jsxs as _e}from"react/jsx-runtime";var St=({items:e,current:t,onNavigate:o,testId:a})=>{let{labels:n}=N();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return K("nav",{className:"cui-breadcrumb","aria-label":n.breadcrumb,"data-testid":a,children:_e("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_e("li",{className:"cui-breadcrumb-item",children:[K("a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${a}-${r.id}`,onClick:s=>J(s,r.href,o),children:r.label}),K("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),K("li",{className:"cui-breadcrumb-item",children:K("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${a}-current`,children:t})})]})})};import{useId as kt}from"react";var P=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};import{jsx as Mt}from"react/jsx-runtime";var x=({fg:e,type:t,face:o,as:a="span",testId:n,id:r,tabIndex:s,ref:d,children:i})=>(p(),Mt(a,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":o,"data-testid":n,id:r,tabIndex:s,ref:d,children:i}));import{jsx as $,jsxs as Dt}from"react/jsx-runtime";var It={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"}},Ge=({children:e})=>$("span",{children:e}),S=({variant:e,children:t,testId:o,type:a="button",onClick:n,unavailable:r,expanded:s,controls:d,ref:i,dataAttributes:c,busy:u,busyLabel:l})=>{p();let y=kt(),m=u===!0||r!==void 0,g=It[e],C=w=>{if(m){w.preventDefault();return}n?.(w)};return Dt("span",{className:"cui-button-group",children:[$("button",{className:"cui-button",type:a==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":g.fg,"data-cui-surface":g.surface,"data-cui-type":g.type,"data-testid":o,"aria-disabled":m?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":r===void 0?void 0:y,"aria-expanded":s,"aria-controls":d,onClick:C,ref:i,...P(c),children:$(Ge,{children:u===!0?l:t})}),r===void 0?null:$(x,{fg:"fg-muted",type:"body",id:y,testId:`${o}-reason`,children:r.reason})]})},At=({onNavigate:e,children:t,testId:o,ref:a})=>(p(),$("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":o,onClick:e,ref:a,children:$(Ge,{children:t})}));import{useId as Ve}from"react";import{Fragment as Ht,jsx as k,jsxs as B}from"react/jsx-runtime";var pe=({id:e,title:t,description:o,actions:a,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();let c=Ve();return B("section",{className:"cui-card",id:e,"aria-labelledby":c,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":n,ref:s,...P(d),children:[B("div",{className:"cui-card-header",children:[B("div",{className:"cui-card-heading",children:[k("h2",{className:"cui-card-title",id:c,"data-cui-type":"title",ref:r,tabIndex:r===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),a===void 0?null:k("div",{className:"cui-card-actions",children:a})]}),i]})},$t=({id:e,title:t,subtitle:o,region:a=!1,testId:n,headingRef:r,ref:s,dataAttributes:d,children:i})=>{p();let c=Ve(),u=B(Ht,{children:[B("div",{className:"cui-card-section-heading",children:[k("h3",{className:"cui-card-section-title",id:c,"data-cui-type":"body",ref:r,tabIndex:r===void 0?void 0:-1,children:t}),o===void 0?null:k("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body",children:o})]}),i]});return a?k("section",{className:"cui-card-section",id:e,"aria-labelledby":c,"data-testid":n,ref:s,...P(d),children:u}):k("div",{className:"cui-card-section",id:e,"data-testid":n,ref:s,...P(d),children:u})};import{useId as Ut}from"react";import{jsx as Ft}from"react/jsx-runtime";var H=({ruleKey:e,css:t})=>Ft("style",{href:e,precedence:"cui",children:t});import{jsx as E,jsxs as I}from"react/jsx-runtime";var Ot=({caption:e,attributes:t,columns:o,attributePx:a,columnMinPx:n,testId:r})=>{p();let s=Ut();for(let l of[a,n])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(o.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of o)for(let y of t)if(!Object.hasOwn(l.cells,y.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${y.key}"`);let d=a+o.length*n,i=`cui-comparison-a${a}-c${n}-n${o.length}`,c=l=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${l}"]`,u=`${c("table")}{display:none}@container (min-width:${D(d)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return I("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[E(H,{ruleKey:i,css:u}),E("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:I("table",{className:"cui-comparison-table","data-cui-type":"body",children:[E("caption",{className:"cui-visually-hidden",children:e}),I("colgroup",{children:[E("col",{style:{width:D(a)}}),o.map(l=>E("col",{},l.key))]}),E("thead",{children:I("tr",{children:[E("td",{}),o.map(l=>E("th",{scope:"col",children:l.heading},l.key))]})}),E("tbody",{children:t.map(l=>I("tr",{children:[E("th",{scope:"row",children:l.label}),o.map(y=>E("td",{children:y.cells[l.key]("table")},y.key))]},l.key))})]})}),E("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:o.map((l,y)=>{let m=`${s}-column-${y}`;return I("div",{className:"cui-comparison-column",role:"group","aria-labelledby":m,"data-cui-type":"body",children:[E("p",{className:"cui-comparison-heading",id:m,children:l.heading}),E("dl",{className:"cui-comparison-list",children:t.map(g=>I("div",{children:[E("dt",{children:g.label}),E("dd",{children:l.cells[g.key]("stack")})]},g.key))})]},l.key)})})]})};import{useId as Kt}from"react";import{jsx as L,jsxs as qt}from"react/jsx-runtime";var Bt=({caption:e,captionHidden:t,columns:o,rows:a,rowKey:n,rowTestId:r,rowData:s,rowSize:d,empty:i,testId:c,ref:u})=>{p();let l=Kt(),y=ke(o);return L("div",{className:"cui-container","data-testid":c,ref:u,children:a.length===0?L(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${c}-empty`,children:i}):L("section",{className:"cui-table-frame",tabIndex:0,"aria-labelledby":l,"data-testid":`${c}-frame`,children:qt("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":D(y)},children:[L("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:l,children:e}),L("colgroup",{children:o.map(m=>L("col",{style:m.width.fixedPx===void 0?void 0:{width:D(m.width.fixedPx)}},m.key))}),L("thead",{children:L("tr",{children:o.map(m=>L("th",{scope:"col","data-cui-align":m.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:m.header},m.key))})}),L("tbody",{children:a.map(m=>L("tr",{tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...P(s?.(m)),children:o.map(g=>L("td",{"data-cui-align":g.align,children:g.cell(m)},g.key))},n(m)))})]})})})};import{jsx as ye,jsxs as Gt}from"react/jsx-runtime";var _t=({items:e,testId:t})=>{if(p(),new Set(e.map(o=>o.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(o=>o.key).join(", ")}`);return ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(o=>Gt("div",{className:"cui-description-row","data-testid":`${t}-${o.key}`,children:[ye("dt",{"data-cui-fg":"fg-secondary",children:o.term}),ye("dd",{"data-cui-fg":"fg",children:o.description})]},o.key))})};import{useId as Zt,useLayoutEffect as We,useRef as ze}from"react";import{useCallback as Vt}from"react";var Wt=229,zt=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),me=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&zt.has(e.type)&&(e.value!==""||e.validity.badInput),Jt=e=>Vt(t=>{t.key!=="Escape"||t.nativeEvent.isComposing||t.keyCode===Wt||me(t.target)||(t.stopPropagation(),e())},[e]);import{jsx as Z,jsxs as Ze}from"react/jsx-runtime";var Je=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Yt=({title:e,open:t,onClose:o,testId:a,children:n})=>{let{labels:r}=N(),s=Zt(),d=ze(null),i=ze(null);return We(()=>{let l=d.current;t&&!l.open?(i.current=l.ownerDocument.activeElement,l.showModal()):!t&&l.open&&l.close()},[t]),We(()=>{let l=d.current;return()=>{l.open&&(l.close(),Je(i.current),i.current=null)}},[]),Ze("dialog",{className:"cui-dialog","aria-labelledby":s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":a,ref:d,onClose:()=>{Je(i.current),i.current=null,t&&o()},onCancel:l=>{me(l.currentTarget.ownerDocument.activeElement)&&l.preventDefault()},children:[Ze("div",{className:"cui-dialog-header",children:[Z("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),Z("div",{className:"cui-dialog-actions",children:Z(S,{variant:"secondary",testId:`${a}-close`,onClick:()=>d.current?.close(),children:r.close})})]}),n,Z("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[ue]:"","data-testid":`${a}-announcer`})]})};import{useId as Xt}from"react";import{jsx as fe,jsxs as Ye}from"react/jsx-runtime";var Qt=({summary:e,open:t,onOpenChange:o,testId:a,children:n})=>{p();let r=Xt();return Ye("div",{className:"cui-disclosure","data-testid":a,children:[Ye("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-button`,onClick:()=>o(!t),children:[fe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),fe("span",{children:e})]}),fe("div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${a}-panel`,children:n})]})};import{useId as Y}from"react";import{Fragment as ao,jsx as v,jsxs as A}from"react/jsx-runtime";var q=({description:e,error:t})=>{p();let o=Y(),a=Y(),n=Y(),r=[e===void 0?null:a,t===void 0?null:n].filter(d=>d!==null).join(" ");return{control:{id:o,"aria-describedby":r===""?void 0:r,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:n}},_=({description:e,error:t,descriptionId:o,errorId:a,testId:n})=>A(ao,{children:[e===void 0?null:v(x,{as:"p",fg:"fg-muted",type:"body",id:o,testId:`${n}-description`,children:e}),t===void 0?null:v(x,{as:"p",fg:"danger-fg",type:"body",id:a,testId:`${n}-error`,children:t})]}),jt=({label:e,description:t,error:o,testId:a,children:n})=>{let{control:r,descriptionId:s,errorId:d}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":a,children:[v("label",{className:"cui-field-label",htmlFor:r.id,"data-cui-type":"body",children:e}),n(r),v(_,{description:t,error:o,descriptionId:s,errorId:d,testId:a})]})},eo=({label:e,description:t,error:o,value:a,onValueChange:n,type:r,list:s,required:d,testId:i,ref:c})=>{let{control:u,descriptionId:l,errorId:y}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${i}-field`,children:[v("label",{className:"cui-field-label",htmlFor:u.id,"data-cui-type":"body",children:e}),v("input",{className:"cui-input",type:r,value:a,list:s,required:d,onChange:m=>n(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":i,ref:c,...u}),v(_,{description:t,error:o,descriptionId:l,errorId:y,testId:i})]})},to=({label:e,description:t,error:o,value:a,onValueChange:n,required:r,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:u}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("textarea",{className:"cui-input cui-textarea",value:a,required:r,onChange:l=>n(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":s,ref:d,...i}),v(_,{description:t,error:o,descriptionId:c,errorId:u,testId:s})]})},oo=({label:e,description:t,error:o,value:a,options:n,onValueChange:r,testId:s,ref:d})=>{let{control:i,descriptionId:c,errorId:u}=q({label:e,description:t,error:o});return A("div",{className:"cui-field","data-invalid":o!==void 0,"data-testid":`${s}-field`,children:[v("label",{className:"cui-field-label",htmlFor:i.id,"data-cui-type":"body",children:e}),v("select",{className:"cui-input",value:a,onChange:l=>r(l.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":s,ref:d,...i,children:n.map(l=>v("option",{value:l.value,children:l.label},l.value))}),v(_,{description:t,error:o,descriptionId:c,errorId:u,testId:s})]})},ro=({legend:e,description:t,error:o,value:a,options:n,onValueChange:r,testId:s,ref:d})=>{let i=Y(),{control:c,descriptionId:u,errorId:l}=q({label:e,description:t,error:o});return A("fieldset",{className:"cui-radio-group","aria-describedby":c["aria-describedby"],"data-invalid":o!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),n.map((y,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:i,value:y.value,checked:y.value===a,onChange:()=>r(y.value),"aria-invalid":c["aria-invalid"],"data-testid":`${s}-option-${y.value}`,ref:m===0?d:void 0}),v("span",{children:y.label})]},y.value)),v(_,{description:t,error:o,descriptionId:u,errorId:l,testId:s})]})};import{jsx as io}from"react/jsx-runtime";var no={1:"h1",2:"h2",3:"h3"},so=({level:e,type:t,testId:o,headingRef:a,children:n})=>{p();let r=no[e];return io(r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":o,ref:a,tabIndex:a===void 0?void 0:-1,children:n})};import{jsx as uo}from"react/jsx-runtime";var lo={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"}},co={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},ge=({tone:e,variant:t,testId:o,dataAttributes:a,children:n})=>{p();let r=t==="tint"?lo[e]:{fg:"on-solid",surface:co[e]};return uo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":o,...P(a),children:n})};import{useId as po}from"react";import{jsx as G,jsxs as yo}from"react/jsx-runtime";var be=({label:e,valueText:t,value:o,max:a,testId:n})=>{p();let r=po();if(a!==null){if(!(Number.isFinite(a)&&a>0))throw new RangeError(`Progress maximum must be positive: ${a}`);if(o===null||!(Number.isFinite(o)&&o>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${o}`)}let s=a===null?null:{max:a,now:Math.min(o,a)};return yo("div",{className:"cui-progress","data-testid":n,children:[G(x,{as:"p",fg:"fg",type:"body",id:r,children:e}),G("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"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":`${n}-bar`,children:G("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${n}-fill`})}),G("div",{"aria-hidden":"true",children:G(x,{as:"p",fg:"fg-secondary",type:"body",testId:`${n}-value`,children:t})})]})};import{jsx as X,jsxs as Xe}from"react/jsx-runtime";var mo=({title:e,status:t,progress:o,cancel:a,testId:n,children:r})=>Xe(pe,{title:e,actions:a===void 0?void 0:X(S,{variant:"secondary",busy:a.busy,busyLabel:a.busyLabel,onClick:a.onCancel,testId:`${n}-cancel`,children:a.label}),testId:n,children:[Xe("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-status`,children:[X("span",{className:"cui-visually-hidden",children:`${e} `}),X(ge,{tone:t.tone,variant:"tint",testId:`${n}-status-pill`,children:t.label})]}),o===void 0?null:X(be,{...o,testId:`${n}-progress`}),r]});import{useCallback as tt,useLayoutEffect as To,useRef as Q}from"react";import{jsx as Qe}from"react/jsx-runtime";var fo=({tone:e,testId:t,children:o})=>(p(),Qe("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-testid":t,children:o})),V=({occurrence:e,testId:t,children:o})=>(p(),Qe("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-occurrence":e,"data-testid":t,children:o},e));import{useCallback as go,useLayoutEffect as je,useReducer as bo,useRef as et}from"react";var Ro=e=>e+1,Re=e=>{let t=et(e),o=et(null),[,a]=bo(Ro,0),n=go((r=>()=>{r.contains(document.activeElement)&&(o.current=r,a())}),[]);return je(()=>{t.current=e}),je(()=>{let r=o.current;if(r===null)return;o.current=null;let s=[null,document.body].includes(document.activeElement);r.isConnected||!s||t.current()?.focus()}),n};import{jsx as j,jsxs as xo}from"react/jsx-runtime";var Te="[data-cui-row-focus]",ho=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 o=[...t.querySelectorAll(Te)];if(o.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${o.length} ${Te} elements for ${e.count} rows`);return o},vo=(e,t)=>{let o=-1;return e.forEach((a,n)=>{t.has(a)&&(o=n)}),e[o+1]},Co=({onLoad:e,busy:t,done:o,failure:a,limit:n,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=N(),c=Q(null),u=Q(null),l=Q(null),y=Q(!1),m=()=>{let b=r.ref.current;c.current={shown:new Set(b===null?[]:b.querySelectorAll(Te)),failureOccurrence:a===null?null:a.occurrence,busySeen:!1},e()};To(()=>{let b=y.current;y.current=!1;let R=c.current;if(R===null)return;let f=ho(r);if(t){R.busySeen=!0,R.shown=new Set(f);return}let h=vo(f,R.shown),T=a!==null&&a.occurrence!==R.failureOccurrence;if(!(R.busySeen||h!==void 0||T||o)||(c.current=null,T||h===void 0))return;let M=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||b&&M)&&h.focus()});let g=Re(()=>o?u.current:l.current),C=tt((b=>{l.current=b;let R=g(b);return()=>{l.current=null,y.current=b===document.activeElement,R()}}),[g]),w=tt((b=>{u.current=b;let R=g(b);return()=>{u.current=null,R()}}),[g]);return o?j("div",{className:"cui-load-more","data-testid":s,children:j(x,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:w,testId:`${s}-end`,children:i.endOfRecords})}):xo("div",{className:"cui-load-more","data-testid":s,children:[j(S,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:m,ref:C,testId:`${s}-button`,children:i.loadMore(W(n,d))}),a===null?null:j(V,{occurrence:a.occurrence,testId:`${s}-failure`,children:i.loadFailed(a.reason)})]})};import{jsx as he,jsxs as ot}from"react/jsx-runtime";var Eo=({master:e,detail:t,masterMinPx:o,detailMinPx:a,testId:n})=>{p();let r=Me({masterMinPx:o,detailMinPx:a,gapPx:z.space["space-6"]});return ot("div",{className:"cui-container","data-testid":n,children:[he(H,{ruleKey:r.key,css:r.css}),ot("div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[he("div",{className:"cui-master-detail-pane","data-testid":`${n}-master`,children:e}),he("div",{className:"cui-master-detail-pane","data-testid":`${n}-detail`,children:t})]})]})};import{jsx as rt}from"react/jsx-runtime";var ve=({value:e,unit:t,testId:o})=>{let{formatLocale:a,labels:n}=N();if(e===null)return rt("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let r=W(e,a);return rt("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:t===void 0?r:`${r} ${t}`})};import{jsx as at,jsxs as Po}from"react/jsx-runtime";var No=({failure:e,onReload:t,forbiddenMessage:o,failureMessage:a,rescueRef:n,testId:r})=>{let{labels:s}=N();return Po("div",{className:"cui-resource-failed","data-testid":r,children:[at(V,{occurrence:e.occurrence,testId:`${r}-alert`,children:s.failureSentence(e,o,a===void 0?s.loadFailed:a)}),e.status===403?null:at(S,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:n,testId:`${r}-reload`,children:s.reload})]})};import{jsx as Ce,jsxs as Lo}from"react/jsx-runtime";var wo=({label:e,options:t,value:o,onValueChange:a,testId:n})=>{p();let r=new Set(t.map(s=>s.value));if(t.length<2||r.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(s=>s.value).join(", ")}`);if(!r.has(o))throw new RangeError(`The pressed value "${o}" is not one of the options: ${[...r].join(", ")}`);return Lo("fieldset",{className:"cui-segmented-group","data-testid":n,children:[Ce("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),Ce("div",{className:"cui-segmented",children:t.map(s=>{let d=s.value===o;return Ce("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":`${n}-${s.value}`,onClick:()=>{d||a(s.value)},children:s.label},s.value)})})]})};import{jsx as F}from"react/jsx-runtime";var nt=({selected:e,controls:t,onSelect:o,testId:a,dataAttributes:n,ref:r,children:s})=>(p(),F("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":a,onClick:o,ref:r,...P(n),children:s})),So=({label:e,items:t,itemKey:o,selectedKey:a,onSelect:n,detailId:r,renderRow:s,rowTestId:d,rowData:i,empty:c,testId:u,ref:l})=>(p(),F("div",{className:"cui-selectable","data-testid":u,ref:l,children:t.length===0?F(x,{as:"p",fg:"fg-muted",type:"prose",testId:`${u}-empty`,children:c}):F("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(y=>{let m=o(y);return F("li",{children:F(nt,{selected:m===a,controls:r,onSelect:()=>n(y),testId:d,dataAttributes:i?.(y),children:s(y)})},m)})})}));import{useId as Mo}from"react";import{jsx as ee,jsxs as st}from"react/jsx-runtime";var ko=({label:e,value:t,min:o,max:a,step:n,valueText:r,onValueChange:s,testId:d})=>{p();let i=Mo();if(!([t,o,a,n].every(Number.isFinite)&&o<a&&n>0&&o<=t&&t<=a))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${o}, max ${a}, step ${n}`);let c=r(t);return st("div",{className:"cui-field","data-testid":`${d}-field`,children:[ee("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),st("div",{className:"cui-slider",children:[ee("input",{className:"cui-slider-input",id:i,type:"range",min:o,max:a,step:n,value:t,"aria-valuetext":c,"data-testid":d,onChange:u=>s(u.currentTarget.valueAsNumber)}),ee("span",{className:"cui-slider-value","aria-hidden":"true",children:ee(x,{fg:"fg",type:"body",testId:`${d}-value`,children:c})})]})]})};import{jsx as it}from"react/jsx-runtime";var Io=({gap:e,testId:t,children:o})=>(p(),it("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:o})),Ao=({gap:e,testId:t,children:o})=>(p(),it("div",{className:"cui-cluster","data-cui-gap":e,"data-testid":t,children:o}));import{jsx as xe,jsxs as dt}from"react/jsx-runtime";var lt={done:0,current:1,pending:2},Do={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},$o=({label:e,steps:t,testId:o})=>{let{labels:a}=N();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,s)=>s>0&&lt[r.state]<lt[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let n={done:a.stepDone,current:null,pending:a.stepPending};return xe("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":o,children:t.map((r,s)=>{let d=Do[r.state],i=n[r.state];return dt("li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${o}-${r.id}`,children:[xe("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":s+1}),dt("span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:xe("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};import{jsx as Ee,jsxs as Fo}from"react/jsx-runtime";var Ho=({label:e,checked:t,onCheckedChange:o,testId:a})=>(p(),Fo("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":t,"data-cui-fg":"fg","data-cui-type":"body","data-testid":a,onClick:()=>o(!t),children:[Ee("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":t?"info-solid":"sunken","data-testid":`${a}-track`,children:Ee("span",{className:"cui-switch-thumb","data-cui-surface":t?"surface":"neutral-solid","data-testid":`${a}-thumb`})}),Ee("span",{children:e})]}));import{jsx as te}from"react/jsx-runtime";var Uo=({label:e,items:t,currentId:o,onNavigate:a,testId:n})=>{if(p(),t.length===0)throw new RangeError("Tabs needs at least one tab");let r=new Set(t.map(s=>s.id));if(r.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(s=>s.id).join(", ")}`);if(!r.has(o))throw new RangeError(`The current tab "${o}" is not one of the tabs: ${[...r].join(", ")}`);return te("nav",{className:"cui-tabs","aria-label":e,"data-testid":n,children:te("ul",{className:"cui-tabs-list",role:"list",children:t.map(s=>{let d=s.id===o;return te("li",{className:"cui-tabs-item",children:te("a",{className:"cui-tab",href:s.href,"aria-current":d?"page":void 0,"data-cui-fg":d?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${n}-${s.id}`,onClick:i=>J(i,s.href,a),children:s.label})},s.id)})})})};import{Children as Oo,Fragment as Ko,isValidElement as Bo}from"react";import{jsx as U,jsxs as ut}from"react/jsx-runtime";var qo={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},_o=({label:e,sublabel:t,value:o,tone:a,testId:n,dataAttributes:r})=>{if(p(),o===null&&a!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${a}`);return ut("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":a,"data-testid":n,...P(r),children:[U("p",{className:"cui-tile-label","data-cui-type":"caption",children:e}),U("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption",children:t}),U("p",{className:"cui-tile-value","data-cui-fg":qo[a],"data-cui-type":"heading",children:U(ve,{value:o,testId:`${n}-value`})})]})},ct=e=>Oo.toArray(e).flatMap(t=>{if(!Bo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Ko?ct(t.props.children):[t]}),Go=({count:e,minInlinePx:t,testId:o,children:a})=>{p();let n=Ie(e,t,z.space["space-2"]),r=ct(a).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return ut("div",{className:"cui-container","data-testid":o,children:[U(H,{ruleKey:n.key,css:n.css}),U("div",{className:"cui-tile-grid","data-cui-tile-grid":n.key,"data-cui-gap":"space-2",children:a})]})};import{useLayoutEffect as Vo,useRef as pt}from"react";import{jsx as zo}from"react/jsx-runtime";var oe=e=>[...e.querySelectorAll("button")],Wo=({label:e,testId:t,children:o})=>{p();let a=pt(null),n=pt(null);Vo(()=>{let i=oe(a.current),c=n.current!==null&&i.includes(n.current)?n.current:i[0]??null;n.current=c;for(let u of i)u.tabIndex=u===c?0:-1});let r=i=>{for(let c of oe(a.current))c.tabIndex=c===i?0:-1;n.current=i};return zo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:a,onFocus:i=>{let c=oe(i.currentTarget).find(u=>u.contains(i.target));c!==void 0&&r(c)},onKeyDown:i=>{let c=oe(i.currentTarget),u=c.indexOf(i.target);if(u===-1)return;let l=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",y=l==="ArrowRight"?"ArrowLeft":"ArrowRight",g={[l]:(u+1)%c.length,[y]:(u-1+c.length)%c.length,Home:0,End:c.length-1}[i.key];if(g===void 0)return;i.preventDefault();let C=c[g];r(C),C.focus()},children:o})};import{useCallback as O,useEffect as Yo,useLayoutEffect as mt,useRef as we}from"react";import{useCallback as re,useEffect as Jo,useLayoutEffect as Zo,useRef as Ne,useState as Pe}from"react";var yt=e=>e===null?ne:se,ae=(e,t,o,a,n)=>{let[r,s]=Pe(()=>({key:e,state:yt(e)})),[d,i]=Pe(0),[c,u]=Pe(0),l=Ne(t),y=Ne(null),m=Ne(d);Zo(()=>{l.current=t}),Jo(()=>{if(e===null){s({key:null,state:ne});return}let f=new AbortController;y.current=e;let h=d===m.current?"revision":"reload";return m.current=d,s(T=>Object.is(T.key,e)?{key:e,state:a(T.state,h)}:{key:e,state:se}),l.current(f.signal).then(T=>{f.signal.aborted||(y.current=null,s(M=>({key:e,state:n(M.state,T)})))},T=>{f.signal.aborted||s(()=>{throw T})}),()=>{f.abort(),y.current=null}},[e,o,d,c]);let g=re(()=>i(f=>f+1),[]),C=re(()=>u(f=>f+1),[]),w=re((f,h)=>{s(T=>Object.is(T.key,f)?{key:f,state:h(T.state)}:T)},[]),b=re((f,h)=>{w(f,h),Object.is(y.current,f)&&C()},[w,C]);return{state:Object.is(r.key,e)?r.state:yt(e),reload:g,refresh:C,update:w,write:b}};var Xo=(e,t,o)=>{let a=we(t);mt(()=>{a.current=t});let n=O(b=>a.current.first(b),[]),{state:r,reload:s,refresh:d,update:i,write:c}=ae(e,n,o,Ae,De),u=we({key:e,state:r});mt(()=>{u.current={key:e,state:r}});let l=we(null),y=O(()=>{l.current?.controller.abort(),l.current=null},[]);Yo(()=>y,[e,o,y]);let m=O(()=>{y(),s()},[y,s]),g=O(()=>{y(),d()},[y,d]),C=O(()=>{let{key:b,state:R}=u.current;if(b===null||R.kind!=="ready"||R.refreshing||R.value.next===null||R.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 f=R.value.next,h={key:b,controller:new AbortController,maps:[]};l.current=h,i(b,$e),a.current.next(f,h.controller.signal).then(T=>{l.current===h&&(l.current=null,i(b,M=>h.maps.reduce((ft,gt)=>le(ft,gt),He(M,f,T))))},T=>{l.current===h&&i(b,()=>{throw T})})},[i]),w=O((b,R)=>{let f=l.current;f!==null&&Object.is(f.key,b)&&f.maps.push(R),c(b,h=>le(h,R))},[c]);return{state:r,reload:m,refresh:g,loadMore:C,updateList:w}};import{useCallback as Qo}from"react";var jo=(e,t,o)=>{let{state:a,reload:n,refresh:r,write:s}=ae(e,t,o,Le,ie),d=Qo((i,c)=>s(i,u=>ie(u,{ok:!0,value:c})),[s]);return{state:a,reload:n,refresh:r,put:d}};import{jsx as tr}from"react/jsx-runtime";var er=({testId:e,children:t})=>(p(),tr("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,V as AlertMessage,St as Breadcrumb,S as Button,dr as CONSOLE_UI_LABEL_CATALOGS,gr as CONTRAST_MINIMUM,br as CONTRAST_PAIRS,pe as Card,$t as CardSection,Ao as Cluster,Ot as ComparisonGrid,Pt as ConsoleUiRoot,Bt as DataTable,_t as DescriptionList,Yt as Dialog,Qt as Disclosure,jt as Field,bt as HTTP_FORBIDDEN,so as Heading,mo as JobCard,Rr as LATTICE_PX,At as Link,Co as LoadMore,Eo as MasterDetail,ve as Measured,_o as MetricTile,fo as Notice,ge as Pill,be as ProgressBar,vr as ROW_WITH_CONTROL_PX,ro as RadioGroup,No as ResourceFailed,nt as RowButton,wo as SegmentedControl,oo as Select,So as SelectableList,ko as Slider,Io as Stack,$o as Stepper,Ho as Switch,hr as TARGET_PX,z as TOKENS,Uo as Tabs,x as Text,to as TextArea,eo as TextInput,Go as TileGrid,Wo as Toolbar,er as VisuallyHidden,or as ZonedTimeError,$e as beginPage,Ae as beginPagedReload,Le as beginReload,yr as ceil8,Tr as ceilToLattice,fr as contrastRatio,Cr as cssVar,ir as flatMapOutcome,W as formatCount,nr as formatInstant,mr as hexToSrgb,ie as keepLastGood,sr as mapOutcome,le as mapPagedList,cr as masterDetailPlan,pr as monoTextWidthEm,lr as reasonAside,Se as resolveConsoleUiLabels,De as settleFirstPage,He as settlePage,ke as tableMinInlinePx,ur as textWidthEm,Ie as tileGridPlan,rr as toOffsetIso,ar as toWallTime,wt as useAnnounce,N as useConsoleUi,Jt as useEscapeToClose,Re as useFocusRescue,Xo as usePagedResource,jo as useResource};