@aiquants/console-ui 0.9.0 → 0.10.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/README.md CHANGED
@@ -4,9 +4,10 @@ Host-agnostic UI foundation for React admin consoles: design tokens computed fro
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - Node.js >= 18.0.0
7
+ - Node.js >= 18.17.0 (the floor of the `@aiquants/input-method` dependency)
8
8
  - React >= 19.0.0 and React DOM >= 19.0.0 (peer dependencies; the layout components emit hoisted `<style href precedence>` elements)
9
- - `@aiquants/auth-core` >= 0.8.0 (peer dependency): the root's presenter of access failures is its `AccessFailurePresenter`, `AccessFailureNotice` draws its `AccessFailureView`, and `accessFailureKindOfStatus` decides which failures are access failures, so the host and the package share one copy of the module
9
+ - `@aiquants/auth-core` 0.9.x (peer dependency `^0.9.0`): the root's presenter of access failures is its `AccessFailurePresenter`, `AccessFailureNotice` draws its `AccessFailureView`, and `accessFailureKindOfStatus` decides which failures are access failures, so the host and the package share one copy of the module
10
+ - `@aiquants/input-method` (a dependency, installed with the package): `isInputMethodKey`, the one rule of whether a keydown belongs to an input method composition, which the Escape of a region (`useEscapeToClose`) and of a `Dialog` reads
10
11
 
11
12
  ## Installation
12
13
 
@@ -59,7 +60,8 @@ Load the stylesheet once, bind the package's neutral font variables to the host'
59
60
 
60
61
  ### Loading the stylesheet
61
62
 
62
- Every rule of the stylesheet sits in the cascade layer `cui`. Cascade layers rank in the order they are first declared, and the `cui` layer must rank above any layer that holds a reset: the paddings and borders the layout arithmetic counts (the card's 1 px rule and the 23 px padding inside it, the 44 px controls and rows, the 52 px rows that hold a control) are otherwise overridden by the reset (Tailwind's preflight sets `padding: 0; border: 0 solid` on every element in its `base` layer).
63
+ Every rule of the stylesheet sits in the cascade layer `cui`. Cascade layers rank in the order they are first declared, and the `cui` layer must rank above any layer that holds a reset: the paddings and borders the layout arithmetic counts (the card's 1 px rule and the 23 px padding inside it, the 44 px controls and rows, the 52 px rows that hold a control)
64
+ and the margin that centres a `Dialog` (the browser's own `margin: auto`, which the stylesheet restates) are otherwise overridden by the reset (Tailwind's preflight sets `margin: 0; padding: 0; border: 0 solid` on every element in its `base` layer).
63
65
  Unlayered host rules beat every layer whatever their order or specificity, so the host's reset must itself sit in a layer ranked below `cui`: an unlayered reset (normalize.css, modern-normalize, Tailwind v3's `@tailwind base`) overrides the package.
64
66
 
65
67
  - **Tailwind v4 host**: `@import` the stylesheet in the CSS entry after the Tailwind layer statement, so `cui` is declared after `base` (it then ranks last), or name the order explicitly:
@@ -252,8 +254,8 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
252
254
 
253
255
  ### Focus and announcements
254
256
 
255
- - `Button` in `busy` or `unavailable` state, and `Switch` and `Select` in `unavailable` state, are `aria-disabled="true"` with a press or a choice that does nothing (never `disabled`, which drops focus to `<body>`).
256
- The reason is the control's accessible description: drawn beside it (`unavailable: { reason }`; a `Select` draws it under the control), or drawn elsewhere (`unavailable: { reasonId }`, the id of that visible reason): a note the caller draws once for several controls, or the error of a field the control acts on (the field's `errorId`). A blank reason throws, and so does a reason id that is blank or holds whitespace (`aria-describedby` splits ids at whitespace).
257
+ - `Button` in `busy` or `unavailable` state, and `Switch`, `Select`, `RadioGroup`, `CheckboxGroup` and `SegmentedControl` in `unavailable` state (every option of a group), are `aria-disabled="true"` with a press or a choice that does nothing (never `disabled`, which drops focus to `<body>`); no option of a group is `disabled`, so the group keeps its place in the Tab order, and an arrow key that moves focus among a group's radio buttons changes no value.
258
+ The reason is the control's accessible description: drawn beside it (`unavailable: { reason }`; a `Select` draws it under the control, and a group (`RadioGroup`, `CheckboxGroup`, `SegmentedControl`) after its options, where it describes the group), or drawn elsewhere (`unavailable: { reasonId }`, the id of that visible reason): a note the caller draws once for several controls, or the error of a field the control acts on (the field's `errorId`). A blank reason throws, and so does a reason id that is blank or holds whitespace (`aria-describedby` splits ids at whitespace).
257
259
  `Button` also takes the id of a caller element that describes it (`describedBy`, listed before the reason), and its `busyLabel` may hold elements (a visually hidden subject keeps a row's name while busy).
258
260
  - Only the control whose own request is in flight is `busy`. `usePendingPress()` tracks it: `press(key, action)` runs the action and, when the action returns a promise, keeps `key` as `pendingKey` until that promise settles either way; an action that returns no promise starts no wait, and a later press replaces the pending one.
259
261
  While the host reports a request in flight on a channel several controls share, the controls that are not pending are `unavailable` with one reason, so no control reads as busy for a request it did not send. The promise's outcome stays the action's: the hook reports no refusal.
@@ -308,7 +310,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
308
310
  - `Dialog` opens with `showModal()`, so the browser traps focus in it, makes the rest of the document inert and closes it on Escape; focus starts on its close button, or on the element the caller names in `initialFocus` (a ref, such as to the first field of a form), and returns, when it closes or unmounts open, to the element that had it when it opened.
309
311
  An `initialFocus` that holds no element or one outside the dialog throws `RangeError` before the dialog opens; one that does not take focus (a `disabled` field, a `div` without `tabindex`) closes the dialog again and throws `RangeError`. `onClose` is called when the operator closes it (the close button or Escape), not when the caller sets `open` to `false`.
310
312
  A `close` event that arrives while it is open again (it closed and reopened in one task, as `StrictMode` does to a dialog mounted open) is not the operator's, so it moves no focus and calls no `onClose`.
311
- Escape does not close it while an IME composes (a keydown with `isComposing` or the keyCode 229, read in the capture phase so a control inside that stops the keydown cannot hide it; the Escape cancels the composition), nor while focus is in a text field holding a value, as `useEscapeToClose`.
313
+ Escape does not close it while an IME composes (a keydown with `isComposing` or the keyCode 229, the rule of `isInputMethodKey` from `@aiquants/input-method`, read in the capture phase so a control inside that stops the keydown cannot hide it; the Escape cancels the composition), nor while focus is in a text field holding a value, as `useEscapeToClose`.
312
314
  In a field holding a value the dialog cancels the Escape's keydown in the capture phase (without stopping it, so a control inside, such as a list that closes on Escape, still gets it), so the browser makes no close request and the dialog stays open however often Escape is pressed.
313
315
  A `search` field holding a value is left to the browser: Chromium and Firefox clear the value as the keydown's default action and make no close request, so the next Escape closes the dialog.
314
316
  A composing Escape, a close request that comes from no key (a phone's back gesture) and the close request of a browser that keeps a `search` field's value on Escape are refused at `cancel`: once a page has refused a close request, a browser that follows the HTML rule lets it refuse the next one only after the operator has interacted with the page (an Escape does not count), so there a second such request in a row closes the dialog.
@@ -331,8 +333,9 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
331
333
  The check needs the `:modal` selector (Chrome 105, Firefox 103, Safari 15.6): `ConsoleUiRoot` probes it once when it mounts and throws there, naming the requirement, in a document without it.
332
334
  A console that is not rendered is not checked: an ancestor with `hidden` or `display: none`, `visibility: hidden` or `content-visibility: hidden`, a closed `<details>` or `<dialog>`, or `<Activity mode="hidden">` (which detaches the announcer while keeping the root) hides the console from the operator as well, so its announcements are dropped without an error, as after unmount. A host that must not lose an outcome keeps the console rendered until the outcome is read.
333
335
  - A `Card`, or a `CardSection` with `region`, that the operator closes with Escape takes `onEscape` (`useEscapeToClose` on the element: the press inside calls it and does not reach an enclosing region); without `onEscape` the element has no key handler, so the press reaches the region around it. Returning focus to the control that opened it is the caller's. A non-modal region such as an inspector is drawn this way rather than as a `role="dialog"`.
334
- - `useEscapeToClose(onClose)` ignores Escape during IME composition and in a text field that holds a value, including a partly typed date, time or number field (its `value` is `""` while `validity.badInput` is true): closing the region would discard what the operator typed.
336
+ - `useEscapeToClose(onClose)` ignores Escape during IME composition (`isInputMethodKey` of `@aiquants/input-method`) and in a text field that holds a value, including a partly typed date, time or number field (its `value` is `""` while `validity.badInput` is true): closing the region would discard what the operator typed.
335
337
  Escape changes nothing in most of these fields (a `text`, `number` or `textarea` value stays; only a `search` field clears its value), so the operator leaves the field (Tab) or empties it before Escape closes the region.
338
+ It also ignores an Escape that a handler heard before the region has already cancelled (`preventDefault()`, on the React event or on the native one), and lets it go on: that handler used the press, such as a control inside that closes its list on Escape, or a page-level listener in the capture phase that closes a menu, so the same press does not close the region too, and the next Escape does. `onEscape` of `Card`, `CardSection` and a group `Figure`, and the open popup of a collapsible `Tabs`, follow the same rule.
336
339
 
337
340
  ### Reads
338
341
 
@@ -424,7 +427,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
424
427
  | `CodeBlock` | Preformatted text (a JSON document, an excerpt of a log) drawn exactly as given in the mono face and the `body` type, without wrapping, in a scroll frame on `sunken` with 8 px padding: a region named by `label` that takes keyboard focus, so a long line can be scrolled into view from the keyboard. As a focusable frame it is never lower than the 44 px target (one line draws 44 px; k lines draw 2 × 8 + 20k px from two lines on). |
425
428
  | `SelectableList`, `RowButton`, `RowLink` | Master list of selectable rows (`data-selected`, `aria-expanded`, `aria-controls`); the list carries an explicit `role="list"`, which WebKit needs to expose an unstyled list as a list. A pressed row takes focus before `onSelect` runs, as a pressed `Button` does (see Focus and announcements). `RowLink` is the row as a real link (`href`), for a list whose rows open places with addresses of their own: a plain primary click takes focus and hands `href` to the host's router (`onNavigate`), while a click with a modifier key or another button keeps the browser's own behaviour on the real `href` (a new tab, a new window); `current` marks the row of the current page with `aria-current="page"` and draws it like a selected `RowButton`. It has `RowButton`'s shape, text, focus ring and `LoadMore` mark and holds the same phrasing content; list such rows in a `List` without markers and with the `space-1` gap (`marker="none"`, `gap="space-1"`), as `SelectableList` lists its own. Both rows take `keyShortcuts` as `Button` does. |
426
429
  | `ComparisonGrid` | Side-by-side comparison: a table named by its (visually hidden) `caption`, or one group per column named by its heading. Both layouts are in the DOM; each cell is a function called once per layout with `"table"` or `"stack"`, so every cell is rendered and mounted twice (the hidden copy included) and the caller gives each copy its own ids, test ids and refs. Cells must be presentational: no data read (`useResource`), announcement (`useAnnounce`) or focus management (`useFocusRescue`); keep state and effects above the grid and pass values into the cells. |
427
- | `Field`, `TextInput`, `PasswordInput`, `TextArea`, `Select`, `RadioGroup`, `CheckboxGroup` | Fields tied to their label, description and error with `useId`. `PasswordInput` masks what is typed, tells the browser's password manager what the password is (`autoComplete`: `new-password` for one the operator sets, `current-password` for a sign-in) and turns spell checking and capitalization off. `TextInput` takes the keyboard a touch device shows (`inputMode`: `numeric` or `decimal`; its value stays the typed text, which the caller parses) and fixed text drawn in front of the input in the same frame (`prefix`, such as a URI scheme; not part of the value, and the first text describing the input; a blank prefix throws). `TextInput`, `PasswordInput` and `Select` in a table cell or a repeated row whose headers show the name may hide their label (`labelHidden`; it stays tied by `for`). `TextInput` is `text`, `search`, `email` (the touch keyboard for an address, and the browser checks the address before a native form submits) or `datetime-local`. `TextInput`, `TextArea` and `Select` take `name`, under which a native form submits the value (one token without whitespace; an empty name, one holding whitespace or one that is not a string throws `RangeError`); a field without `name` renders none and submits nothing. `TextInput` of the `text`, `search` and `email` types and `TextArea` take `maxLength`, the most characters the field takes, counted in UTF-16 code units as the browser counts them (a positive integer: `0`, a negative number, a fraction, `NaN` or an infinity throws `RangeError`, and so does a `maxLength` on a `datetime-local` input, which the browser would ignore). `PasswordInput` takes neither. On a coarse pointer (a touch screen) the text of every field and of an input's prefix is the larger of the `body` step and 16 px, so iOS does not zoom the page each time a field takes focus; the line stays the step's, so a one-line field stays 44 px high. `CheckboxGroup` is a `fieldset` of native check boxes, each inside its 44 px label; it returns the chosen values in the options' order and refuses no option, repeated values and chosen values that are not options. Every field takes `errorId`, the id its error line takes (one token; generated when omitted), so another control can name the error as the reason it cannot act, such as the save button of a table row whose typed value cannot be read (`unavailable={{ reasonId: errorId }}`). Read a number field's text with `readDecimalText` or `readIntegerText`. |
430
+ | `Field`, `TextInput`, `PasswordInput`, `TextArea`, `Select`, `RadioGroup`, `CheckboxGroup` | Fields tied to their label, description and error with `useId`. `PasswordInput` masks what is typed, tells the browser's password manager what the password is (`autoComplete`: `new-password` for one the operator sets, `current-password` for a sign-in) and turns spell checking and capitalization off. `TextInput` takes the keyboard a touch device shows (`inputMode`: `numeric` or `decimal`; its value stays the typed text, which the caller parses) and fixed text drawn in front of the input in the same frame (`prefix`, such as a URI scheme; not part of the value, and the first text describing the input; a blank prefix throws). `TextInput`, `PasswordInput` and `Select` in a table cell or a repeated row whose headers show the name may hide their label (`labelHidden`; it stays tied by `for`). `TextInput` is `text`, `search`, `email` (the touch keyboard for an address, and the browser checks the address before a native form submits) or `datetime-local`. `TextInput`, `TextArea` and `Select` take `name`, under which a native form submits the value (one token without whitespace; an empty name, one holding whitespace or one that is not a string throws `RangeError`); a field without `name` renders none and submits nothing. `TextInput` of the `text`, `search` and `email` types and `TextArea` take `maxLength`, the most characters the field takes, counted in UTF-16 code units as the browser counts them (a positive integer: `0`, a negative number, a fraction, `NaN` or an infinity throws `RangeError`, and so does a `maxLength` on a `datetime-local` input, which the browser would ignore). `PasswordInput` takes neither. On a coarse pointer (a touch screen) the text of every field and of an input's prefix is the larger of the `body` step and 16 px, so iOS does not zoom the page each time a field takes focus; the line stays the step's, so a one-line field stays 44 px high. `CheckboxGroup` is a `fieldset` of native check boxes, each inside its 44 px label; it returns the chosen values in the options' order and refuses no option, repeated values and chosen values that are not options. Every field takes `errorId`, the id its error line takes (one token; generated when omitted), so another control can name the error as the reason it cannot act, such as the save button of a table row whose typed value cannot be read (`unavailable={{ reasonId: errorId }}`). Read a number field's text with `readDecimalText` or `readIntegerText`. `Select`, `RadioGroup` and `CheckboxGroup` take `unavailable`: they keep their focus and their value and are described by the reason (see Focus and announcements). |
428
431
  | `ProgressBar` | Determinate with a maximum (clamped at 100 %); indeterminate without, drawn as a quarter-length segment that sweeps the track when motion is allowed and rests in its middle otherwise. The visible label names the bar; the visible value text is hidden from assistive technology, which reads it once as the bar's `aria-valuetext`. |
429
432
  | `Meter` | A value at its place in a fixed range (a score in [0, 1], a share of a quota), not progress: `role="meter"` named by `label` (no visible label; the row or field around it says what it measures), its fill in `info-accent` on a `sunken` track as long as the value's place in the range, beside the value text in `fg` (hidden from assistive technology, which reads it once as the meter's `aria-valuetext`). It is phrasing content that fits one `body` line, so it can be a line of a `RowButton`: it takes its parent's whole width even where the parent aligns its lines to the start (a `RowButton`), and the 8 px track is centred on the value text's 20 px line and takes the width left after the text, never less than 48 px. Refuses a range that is not finite or whose `min` is not below `max`, and a value outside the range. |
430
433
  | `MasterDetail` | Master–detail layout by container width; side by side, neither pane goes below its minimum. |
@@ -432,12 +435,12 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
432
435
  | `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. With `collapsible`, a container narrower than 48rem (an inline-size container query on the tab row's own width) folds the links into a full-width 44 px button naming the current tab and a popup of every tab below it (opened on press, closed on choosing a tab, Escape, a press outside or focus moving to an element outside the row, which keeps that focus where it went so the popup never covers it; focus lost to nothing, such as another window, leaves it open); a wider container is the ordinary wrapping row, so a caller that does not set it is unchanged. |
433
436
  | `Breadcrumb` | The trail to the current page: a `nav` named by the UI language's `breadcrumb` label around an ordered list of the ancestors' links (drawn like `Link`) and the current page's name as `aria-current="page"` text; separators are hidden from assistive technology. Clicks as `Tabs`. |
434
437
  | `Toolbar` | `role="toolbar"` with a roving tabindex over its buttons (see Focus and announcements), laid out like a `Cluster` with an 8 px gap. |
435
- | `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
438
+ | `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side; centred in the viewport and never taller than the viewport (less any scrollbar) less 24 px above and below, cut down to the 4 px lattice. It declares both itself: a host's reset ranked below `cui` would otherwise remove the browser's centring margin and draw it at the top left, and the browser's own height limit falls off the lattice. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
436
439
  | `Figure`, `FigureNode`, `FigureEdge` | A drawing of nodes and edges (see Figures): `kind="group"` (a named `role="group"` at its natural size in a scroll frame, every node a 44 px toggle button with the foundation's focus ring, `onEscape`) or `kind="decorative"` (`aria-hidden`, cut down to the lattice as its container shrinks; `viewBox`, `pointer` and `svgRef` for a pannable one). `FigureNode` draws a box (`x`, `y` its top-left corner; a name, caption `notes` and a height from `figureBoxPlan`) or a disc (`x`, `y` its centre; its name under it, or none for `name: null`) in a `tone`, `selected` or not, with a `solid` or `dashed` outline, an optional tooltip (`title`) and, in a group figure, `press` (`label`, `description`, `expanded`, `controls`, `onPress`). `FigureEdge` draws a path (`d`) in an `emphasis` (`normal` or `high`) and a `weight` (1 to 4), with an optional arrowhead and tooltip. The parts paint only through role attributes and take no paint, class or style; `FigureNode` and `FigureEdge` throw outside a `Figure`, and every refusal (`RangeError`) names the part's `testId`: a size off the lattice, a blank name (or a box's `null` one), a box narrower than its plan, a note role not in the table on a face the node takes, a group node without `press` or a decorative one with it, a pressable node below 44 px or closer than 4 px to the edge, and a weight outside 1–4. |
437
440
  | `Switch` | An on/off setting that takes effect at once: `role="switch"` with `aria-checked`, named by its label; the thumb sits at the track's start when off and at its end when on, moving over `motion-1`. In a table cell whose headers show the name it may hide its label (`labelHidden`; the target is the 44 px box across the 52 px track). A cell holding more than one switch shows which is which instead: each label is a short visible name after a `VisuallyHidden` subject (the row and the column), so the name stays whole and contains the visible name. Takes `unavailable`, a `ref` and caller `dataAttributes`. |
438
441
  | `PanelTabs` | Tabs that switch one panel within the page: a `tablist` of `tab` buttons (the selected one `aria-selected`, drawn like a `Tabs` tab) and the `tabpanel` they control, named by the selected tab; a press on the selected tab asks for nothing. The panel may be described by visible text inside it (`panelDescribedBy`, such as a hint on scrolling a wide figure). A list of one tab is allowed. Refuses no tab, repeated keys and a selected key that is not a tab. |
439
442
  | `Slider` | A labelled native `input type="range"` whose value text is its `aria-valuetext`, drawn beside it and hidden from assistive technology; changes arrive as numbers. Refuses a range that is not finite, `min` not below `max`, a step that is not positive and a value outside the range. |
440
- | `SegmentedControl` | One choice among a few options: a named group of toggle buttons (`aria-pressed`) with exactly one pressed (`info-solid` with `on-solid` text); a press on the pressed option asks for nothing. Needs two or more options with unique values. `density="regular"` (the default) is a `fieldset` named by its legend above the options; `density="compact"` draws one 44 px line for a band of supplementary controls: a `fieldset` without a legend, named by its `caption` label at the line start (`aria-labelledby`), and options as 28 px faces (a `Pill`'s formula) inside bare 44 × 44 targets, the face carrying the colour roles, the border and the focus ring. Any other `density` throws `RangeError`. |
443
+ | `SegmentedControl` | One choice among a few options: a named group of toggle buttons (`aria-pressed`) with exactly one pressed (`info-solid` with `on-solid` text); a press on the pressed option asks for nothing. Needs two or more options with unique values. `density="regular"` (the default) is a `fieldset` named by its legend above the options; `density="compact"` draws one 44 px line for a band of supplementary controls: a `fieldset` without a legend, named by its `caption` label at the line start (`aria-labelledby`), and options as 28 px faces (a `Pill`'s formula) inside bare 44 × 44 targets, the face carrying the colour roles, the border and the focus ring. Any other `density` throws `RangeError`. `unavailable` keeps its focus and its value and is described by the reason, which it draws after the options (under them in `regular`; on the band's line in `compact`, below the options when it does not fit beside them) or names (`reasonId`, for a band that cannot hold it; see Focus and announcements). |
441
444
  | `Disclosure` | A button with `aria-expanded` and `aria-controls` over the panel it shows and hides (`hidden` while closed), with a ▸ / ▾ marker; the open state is the caller's. The `summary` is the button's content and name: text and non-interactive phrasing elements (a `Text` span, a `Pill`, a `Measured`), whose words join the name; a `Pill` keeps the button 44 px. A summary holding anything else (a paragraph, a `div`, a link, a button, an element with `tabindex` or `contenteditable`) throws `RangeError` after it renders; a group of labels is a `Cluster as="span"`. |
442
445
  | `DescriptionList` | A `dl` of name–value rows (`dt` and `dd` grouped in a `div`), the term a third of the row in `fg-secondary`. |
443
446
  | `Stepper` | A job's steps as a named ordered list: the current step `aria-current="step"`, the others followed by the hidden `stepDone` or `stepPending` word; a finished step's marker is a check mark on `success-solid`, the current one its number on `info-solid`. The states must run done, at most one current, then pending. |
@@ -460,7 +463,7 @@ The test ids a component derives from its `testId` are public test hooks:
460
463
  | `Switch` | `<testId>-track`, `<testId>-thumb`, `<testId>-reason` (the `unavailable` reason it draws) |
461
464
  | `PanelTabs` | `<testId>-<id>` (each tab's button), `<testId>-panel` (the `tabpanel`) |
462
465
  | `Slider` | `<testId>-field` (the field root; `testId` itself is on the input), `<testId>-value` (the drawn value text) |
463
- | `SegmentedControl` | `<testId>-<value>` (each option's button), `<testId>-<value>-face` (its face, `density="compact"` only) |
466
+ | `SegmentedControl` | `<testId>-<value>` (each option's button), `<testId>-<value>-face` (its face, `density="compact"` only), `<testId>-reason` (the `unavailable` reason it draws) |
464
467
  | `Disclosure` | `<testId>-button`, `<testId>-panel` |
465
468
  | `DescriptionList` | `<testId>-<key>` (each row) |
466
469
  | `Stepper` | `<testId>-<id>` (each step) |
@@ -472,7 +475,7 @@ The test ids a component derives from its `testId` are public test hooks:
472
475
  | `AccessFailureNotice` | `<testId>-message` (the tint), `<testId>-title`, `<testId>-actions` (the row of buttons), `<testId>-<action>` (each action's button, such as `<testId>-retry`) |
473
476
  | `ResourceFailed` | `<testId>-alert` (the `AlertMessage` of a failure that is not an access failure; an access failure carries the test ids its presenter gives), `<testId>-reload` |
474
477
  | `TextInput`, `PasswordInput`, `TextArea`, `Select` | `<testId>-field` (the field root; `testId` itself is on the control), `<testId>-description`, `<testId>-error`; `TextInput` also `<testId>-prefix` (the `prefix` text); `Select` also `<testId>-reason` (the `unavailable` reason it draws) |
475
- | `Field`, `RadioGroup`, `CheckboxGroup` | `<testId>-description`, `<testId>-error`; `RadioGroup` and `CheckboxGroup` also `<testId>-option-<value>` (each option's input) |
478
+ | `Field`, `RadioGroup`, `CheckboxGroup` | `<testId>-description`, `<testId>-error`; `RadioGroup` and `CheckboxGroup` also `<testId>-option-<value>` (each option's input) and `<testId>-reason` (the `unavailable` reason they draw) |
476
479
  | `ProgressBar` | `<testId>-bar` (the `progressbar`), `<testId>-fill`, `<testId>-value` (the visible value text) |
477
480
  | `Meter` | `<testId>-bar` (the `meter`), `<testId>-fill`, `<testId>-value` (the visible value text) |
478
481
  | `CodeBlock` | `<testId>-code` (the `pre`; `testId` itself is on the frame) |
@@ -489,6 +492,7 @@ pnpm --filter @aiquants/console-ui run test:coverage # exits non-zero below 100
489
492
  ```
490
493
 
491
494
  The stylesheet tests read `src/styles/components.css` with `node:fs` and parse it with postcss.
495
+ `tests/dialogBox.spec.tsx` measures a `Dialog`'s box in real Chromium, Firefox and WebKit through Playwright, so the test run needs the browsers of the installed `playwright` (`pnpm --filter @aiquants/console-ui exec playwright install chromium firefox webkit`).
492
496
 
493
497
  ### Testing in jsdom
494
498
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkRYHSVWM2cjs = require('./chunk-RYHSVWM2.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ke=_react.createContext.call(void 0, 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=_chunkRYHSVWM2cjs.b.call(void 0, 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(_chunkRYHSVWM2cjs.a)}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= exports.ANNOUNCE_SETTLE_MS =150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=_nullishCoalesce($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= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(_react.useContext.call(void 0, 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(!_chunkXLOWKWIIcjs.h.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${_chunkXLOWKWIIcjs.h.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=_chunkRYHSVWM2cjs.p.call(void 0, e),[y]=Intl.getCanonicalLocales(t),u=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Fn(c.current.ownerDocument)},[]);let f=_react.useCallback.call(void 0, R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:x}=b.current;b.current=null,clearTimeout(T),clearTimeout(x);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=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return _jsxruntime.jsx.call(void 0, Ke.Provider,{value:m,children:_jsxruntime.jsxs.call(void 0, "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,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be= exports.useAnnounce =()=>C().announce,On= exports.useAccessFailure =()=>C().accessFailure;var v=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};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})=>{_react.useLayoutEffect.call(void 0, ()=>{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}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),_jsxruntime.jsx.call(void 0, 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(" ")};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=_react.useRef.call(void 0, null);return D(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},I= exports.Button =({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=_react.useId.call(void 0, ),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(h)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "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,...v(y),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn= exports.FragmentLink =({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 _jsxruntime.jsx.call(void 0, "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,...v(a),children:_jsxruntime.jsx.call(void 0, qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Zn=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr= exports.AccessFailureNotice =({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=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>_jsxruntime.jsx.call(void 0, 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))};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 _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "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}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};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"||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>q(t,e),[e]);var Bt=e=>e===void 0?void 0:t=>q(t,e),We= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=_react.useId.call(void 0, ),u=Bt(a);return _jsxruntime.jsxs.call(void 0, "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,...v(i),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur= exports.CardSection =({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=_react.useId.call(void 0, ),c=Bt(o),b=lr[r],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...v(d),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...v(d),children:f})};var pr=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var Q=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=_react.useId.call(void 0, );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:${_chunkRYHSVWM2cjs.O.call(void 0, l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:i,css:y}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkRYHSVWM2cjs.O.call(void 0, r)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};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)]};var Rr=e=>e+1,le= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, Rr,0),o=_react.useCallback.call(void 0, (s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var wr=new Map,vr='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)=>{_react.useLayoutEffect.call(void 0, ()=>{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 ${_chunkRYHSVWM2cjs.s} px target does not fit its ${_chunkRYHSVWM2cjs.u} 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:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr= exports.DataTable =({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=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Pr(b,l,y);let f=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, wr),R=le(h=>Gt(h,b.current,f.current,m.current));_react.useLayoutEffect.call(void 0, ()=>{m.current=qt(b.current,f.current)});let p=_react.useCallback.call(void 0, h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=_chunkRYHSVWM2cjs.R.call(void 0, n);return Nr(n,y),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkRYHSVWM2cjs.O.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(h=>_jsxruntime.jsx.call(void 0, "col",{style:h.width.fixedPx===void 0?void 0:{width:_chunkRYHSVWM2cjs.O.call(void 0, h.width.fixedPx)}},h.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(h=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:r.map(h=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...v(_optionalChain([s, 'optionalCall', _8 => _8(h)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):_jsxruntime.jsx.call(void 0, "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)))})]})})})};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 _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};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= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=_react.useId.call(void 0, ),d=_react.useId.call(void 0, ),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{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]),_react.useLayoutEffect.call(void 0, ()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([y, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return D(s,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:s,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Kr=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "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= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "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));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:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return i===null?_jsxruntime.jsx.call(void 0, ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};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=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),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})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr= exports.Field =({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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),_jsxruntime.jsx.call(void 0, 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=_react.useId.call(void 0, );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 x=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:x?!1:void 0,autoCapitalize:x?"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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "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]}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, en,{...e}),Vr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, en,{...e,type:"password"}),Wr= exports.TextArea =({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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "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}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr= exports.Select =({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=_react.useId.call(void 0, ),R=Y(d,m);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "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=>_jsxruntime.jsx.call(void 0, "option",{value:p.value,children:p.label},p.value))}),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),_optionalChain([d, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=_react.useId.call(void 0, ),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "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}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr= exports.CheckboxGroup =({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 _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "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}),_jsxruntime.jsx.call(void 0, "span",{children:m.label})]},m.value)),_jsxruntime.jsx.call(void 0, ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};var sn=_react.createContext.call(void 0, 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=_chunkRYHSVWM2cjs.v.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=_react.useContext.call(void 0, 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= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:eo.map(b=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!_chunkRYHSVWM2cjs.h.call(void 0, b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "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":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-block":_chunkRYHSVWM2cjs.O.call(void 0, a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...v(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "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":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...v(s),..._optionalChain([u, 'optionalAccess', _14 => _14.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=_chunkXLOWKWIIcjs.i.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= exports.FigureNode =e=>{g();let t=ln("FigureNode"),n=_react.useId.call(void 0, ),{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&&!_chunkRYHSVWM2cjs.h.call(void 0, 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,()=>_chunkRYHSVWM2cjs.I.call(void 0, {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 x=_chunkRYHSVWM2cjs.J.call(void 0, f.length);p=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":m.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:_chunkRYHSVWM2cjs.v.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>_jsxruntime.jsx.call(void 0, "text",{x:x.insetPx,y:x.notesPx[$],fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkRYHSVWM2cjs.M,y:-_chunkRYHSVWM2cjs.M,width:o.widthPx+2*_chunkRYHSVWM2cjs.M,height:T.heightPx+2*_chunkRYHSVWM2cjs.M,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"]+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>_chunkRYHSVWM2cjs.K.call(void 0, d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":m.face,children:_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkRYHSVWM2cjs.v.type.caption.lineHeight/2,fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<_chunkRYHSVWM2cjs.s||R.height<_chunkRYHSVWM2cjs.s)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkRYHSVWM2cjs.s} px target: ${R.width} \xD7 ${R.height}`);if(R.left<_chunkRYHSVWM2cjs.L||R.top<_chunkRYHSVWM2cjs.L||R.left+R.width+_chunkRYHSVWM2cjs.L>t.widthPx||R.top+R.height+_chunkRYHSVWM2cjs.L>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkRYHSVWM2cjs.L} 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 _jsxruntime.jsxs.call(void 0, "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,...v(b),children:[y===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:y}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so= exports.FigureEdge =({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 _jsxruntime.jsx.call(void 0, "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,...v(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var lo={1:"h1",2:"h2",3:"h3"},uo= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return _jsxruntime.jsx.call(void 0, 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})};var po={removed:"danger-tint",added:"success-tint"},yo= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, 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})};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= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return _jsxruntime.jsx.call(void 0, "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,...v(r),children:a})};var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=_react.useId.call(void 0, );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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "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`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, We,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, ot,{...n,testId:`${a}-progress`}),o]});var at=_react.createContext.call(void 0, null),wo="space-2",vo= exports.List =e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, 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 _jsxruntime.jsx.call(void 0, at.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, 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?wo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let r=_react.useContext.call(void 0, at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...v(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, at.Provider,{value:null,children:n})})})};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= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !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()};_react.useLayoutEffect.call(void 0, ()=>{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),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(d.current=null,x||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=_react.useCallback.call(void 0, (p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=_react.useCallback.call(void 0, (p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(_chunkRYHSVWM2cjs.c.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=_chunkRYHSVWM2cjs.Q.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkRYHSVWM2cjs.v.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};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&&!_chunkRYHSVWM2cjs.h.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=_chunkRYHSVWM2cjs.c.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkRYHSVWM2cjs.e.call(void 0, i,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkRYHSVWM2cjs.h.call(void 0, 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 _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};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 _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var Do={ArrowLeft:-1,ArrowRight:1},Ho= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, 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),_optionalChain([i, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(R.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "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 _jsxruntime.jsx.call(void 0, "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)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=_jsxruntime.jsx.call(void 0, et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[l,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_react.useId.call(void 0, ),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"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:_jsxruntime.jsx.call(void 0, "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)})})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "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)})})]})};var gn=e=>{let t=_react.useRef.call(void 0, null),n=_react.useCallback.call(void 0, r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn= exports.RowButton =({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 _jsxruntime.jsx.call(void 0, "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,...v(a),children:l})},Wo= exports.RowLink =({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 _jsxruntime.jsx.call(void 0, "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,...v(a),children:l})},zo= exports.SelectableList =({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(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=_react.useId.call(void 0, );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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "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)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};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= exports.Stepper =({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 _jsxruntime.jsx.call(void 0, "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 _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "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}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "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)},...v(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};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]=_react.useState.call(void 0, !1),y=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, f=>{d(!1),f&&_optionalChain([y, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{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]),_jsxruntime.jsxs.call(void 0, "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?_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "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 _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "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)})})]})};var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua= exports.MetricTile =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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...v(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Ne,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, Ne,{text:e.text,keep:"wrap",testId:l})})]})},vn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?vn(t.props.children):[t]}),ca= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=_chunkRYHSVWM2cjs.T.call(void 0, e,t,_chunkRYHSVWM2cjs.v.space["space-2"]),o=vn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, Q,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var Se=e=>[...e.querySelectorAll("button")],ya= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(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 _jsxruntime.jsx.call(void 0, "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})};var ga=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var Cn=e=>e===null?_chunkRYHSVWM2cjs.X:_chunkRYHSVWM2cjs.Y,Ie=(e,t,n,r,a)=>{let[o,s]=_react.useState.call(void 0, ()=>({key:e,state:Cn(e)})),[l,i]=_react.useState.call(void 0, 0),[d,y]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkRYHSVWM2cjs.X});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(x=>Object.is(x.key,e)?{key:e,state:r(x.state,T)}:{key:e,state:_chunkRYHSVWM2cjs.Y}),u.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,x)})))},x=>{h.signal.aborted||s(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=_react.useCallback.call(void 0, ()=>i(h=>h+1),[]),m=_react.useCallback.call(void 0, ()=>y(h=>h+1),[]),R=_react.useCallback.call(void 0, (h,T)=>{s(x=>Object.is(x.key,h)?{key:h,state:T(x.state)}:x)},[]),p=_react.useCallback.call(void 0, (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=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,_chunkRYHSVWM2cjs.$,_chunkRYHSVWM2cjs.aa),y=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{y.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),f=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),m=_react.useCallback.call(void 0, ()=>{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,_chunkRYHSVWM2cjs.ba),r.current.next(h,T.controller.signal).then(x=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>_chunkRYHSVWM2cjs.da.call(void 0, $,oe),_chunkRYHSVWM2cjs.ca.call(void 0, k,h,x))))},x=>{u.current===T&&i(p,()=>{throw x})})},[i]),R=_react.useCallback.call(void 0, (p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>_chunkRYHSVWM2cjs.da.call(void 0, T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};var va=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let s=o();if(!va(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}};var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,_chunkRYHSVWM2cjs.Z,_chunkRYHSVWM2cjs._),l=_react.useCallback.call(void 0, (i,d)=>s(i,y=>_chunkRYHSVWM2cjs._.call(void 0, y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};var ka=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ge; exports.AccessFailureNotice = rr; exports.AlertMessage = ce; exports.Breadcrumb = or; exports.Button = I; exports.COMPACT_ROW_PX = _chunkRYHSVWM2cjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkRYHSVWM2cjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.Card = We; exports.CardSection = ur; exports.CheckboxGroup = jr; exports.Cluster = Ge; exports.CodeBlock = pr; exports.ComparisonGrid = mr; exports.ConsoleUiRoot = Hn; exports.DataTable = Lr; exports.DescriptionList = Sr; exports.Dialog = Ar; exports.Disclosure = Or; exports.FIGURE_RING_REACH_PX = _chunkRYHSVWM2cjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkRYHSVWM2cjs.C; exports.FailureMessage = et; exports.Field = qr; exports.Figure = oo; exports.FigureEdge = so; exports.FigureNode = io; exports.FragmentLink = Xn; exports.HTTP_FORBIDDEN = _chunkRYHSVWM2cjs.U; exports.Heading = uo; exports.InlineChange = yo; exports.JobCard = To; exports.LATTICE_PX = _chunkRYHSVWM2cjs.q; exports.Link = Jn; exports.List = vo; exports.ListItem = Po; exports.LoadMore = Lo; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.MasterDetail = Mo; exports.Measured = Ne; exports.Meter = Io; exports.MetricTile = ua; exports.Notice = Kr; exports.PanelTabs = Ho; exports.PasswordInput = Vr; exports.Pill = rt; exports.ProgressBar = ot; exports.ROW_WITH_CONTROL_PX = _chunkRYHSVWM2cjs.t; exports.RadioGroup = Jr; exports.ResourceFailed = Uo; exports.RowButton = bn; exports.RowLink = Wo; exports.SegmentedControl = qo; exports.Select = zr; exports.SelectableList = zo; exports.Slider = jo; exports.Stack = Zn; exports.Stepper = Yo; exports.Switch = ea; exports.TARGET_PX = _chunkRYHSVWM2cjs.s; exports.TOKENS = _chunkRYHSVWM2cjs.v; exports.TONES = _chunkRYHSVWM2cjs.ia; exports.TONE_HUES = _chunkRYHSVWM2cjs.ga; exports.TONE_ROLES = _chunkRYHSVWM2cjs.ha; exports.Tabs = aa; exports.Text = P; exports.TextArea = Wr; exports.TextInput = Gr; exports.TileGrid = ca; exports.Toolbar = ya; exports.VisuallyHidden = ka; exports.ZonedTimeError = _chunkRYHSVWM2cjs.i; exports.beginPage = _chunkRYHSVWM2cjs.ba; exports.beginPagedReload = _chunkRYHSVWM2cjs.$; exports.beginReload = _chunkRYHSVWM2cjs.Z; exports.ceil8 = _chunkRYHSVWM2cjs.z; exports.ceilToLattice = _chunkRYHSVWM2cjs.r; exports.cellContentInlinePx = _chunkRYHSVWM2cjs.A; exports.comparisonAttributePx = _chunkRYHSVWM2cjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkRYHSVWM2cjs.F; exports.cssVar = _chunkRYHSVWM2cjs.w; exports.figureBoxPlan = _chunkRYHSVWM2cjs.I; exports.figureDiscLabelPlan = _chunkRYHSVWM2cjs.K; exports.fillLabel = _chunkRYHSVWM2cjs.m; exports.fixedColumnPx = _chunkRYHSVWM2cjs.B; exports.flatMapOutcome = _chunkRYHSVWM2cjs.W; exports.formatByteSize = _chunkRYHSVWM2cjs.d; exports.formatCount = _chunkRYHSVWM2cjs.c; exports.formatInstant = _chunkRYHSVWM2cjs.l; exports.goldenSectionPx = _chunkRYHSVWM2cjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkRYHSVWM2cjs.E; exports.isReadableText = _chunkRYHSVWM2cjs.h; exports.keepLastGood = _chunkRYHSVWM2cjs._; exports.lightDark = _chunkRYHSVWM2cjs.ea; exports.mapOutcome = _chunkRYHSVWM2cjs.V; exports.mapPagedList = _chunkRYHSVWM2cjs.da; exports.masterDetailPlan = _chunkRYHSVWM2cjs.P; exports.monoTextWidthEm = _chunkRYHSVWM2cjs.y; exports.placeholderRule = _chunkRYHSVWM2cjs.fa; exports.pxToRem = _chunkRYHSVWM2cjs.O; exports.readDecimalText = _chunkRYHSVWM2cjs.f; exports.readIntegerText = _chunkRYHSVWM2cjs.g; exports.reasonAside = _chunkRYHSVWM2cjs.n; exports.resolveConsoleUiLabels = _chunkRYHSVWM2cjs.p; exports.settleFirstPage = _chunkRYHSVWM2cjs.aa; exports.settlePage = _chunkRYHSVWM2cjs.ca; exports.spacedTextWidthEm = _chunkRYHSVWM2cjs.H; exports.tableFrameMinInlinePx = _chunkRYHSVWM2cjs.S; exports.tableMinInlinePx = _chunkRYHSVWM2cjs.R; exports.textWidthEm = _chunkRYHSVWM2cjs.x; exports.tileGridPlan = _chunkRYHSVWM2cjs.T; exports.tileMinInlinePx = _chunkRYHSVWM2cjs.G; exports.toOffsetIso = _chunkRYHSVWM2cjs.j; exports.toWallTime = _chunkRYHSVWM2cjs.k; exports.topmostModalOf = _chunkRYHSVWM2cjs.b; exports.useAccessFailure = On; exports.useAnnounce = Be; exports.useConsoleUi = C; exports.useEscapeToClose = dr; exports.useFailureOccurrence = ga; exports.useFocusRescue = le; exports.usePagedResource = Ta; exports.usePendingPress = Pa; exports.useResource = Ca;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkRYHSVWM2cjs = require('./chunk-RYHSVWM2.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ke=_react.createContext.call(void 0, null),Ht=" ",$t='[inert], [aria-hidden="true" i]',Be="data-cui-dialog-announcer",Fn=`:scope > [${Be}]`,An=e=>{if(e.closest($t)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=_chunkRYHSVWM2cjs.b.call(void 0, 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(Fn);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest($t)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Dn=e=>{try{e.querySelectorAll(_chunkRYHSVWM2cjs.a)}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}},be= exports.ANNOUNCE_SETTLE_MS =150,Hn=1e3,Ft=new WeakMap,On=(e,t)=>{let n=_nullishCoalesce(Ft.get(e), () => (new Set)),r={text:t};Ft.set(e,n.add(r)),setTimeout(()=>n.delete(r),be);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ht),e.replaceChildren(a)},Un= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:i,children:l})=>{if(_react.useContext.call(void 0, 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(!_chunkXLOWKWIIcjs.h.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${_chunkXLOWKWIIcjs.h.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let c=_chunkRYHSVWM2cjs.p.call(void 0, e),[p]=Intl.getCanonicalLocales(t),u=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(p,{timeZone:n}).resolvedOptions().timeZone,[p,n]),d=_react.useRef.call(void 0, null),g=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Dn(d.current.ownerDocument)},[]);let f=_react.useCallback.call(void 0, h=>{if(h.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let y=()=>{let{texts:R,settle:E,deadline:w}=g.current;g.current=null,clearTimeout(E),clearTimeout(w);let k=d.current;if(k===null)return;let $=R.join(Ht),ae=An(k);if("hidden"in ae)throw new Error(`announce: the live region is hidden from assistive technology (${ae.hidden}), so this announcement would be lost: ${$}`);On(ae.region,$)},T=g.current;if(T===null){g.current={texts:[h],settle:setTimeout(y,be),deadline:setTimeout(y,Hn)};return}T.texts.push(h),clearTimeout(T.settle),T.settle=setTimeout(y,be)},[]),m=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:p,timeZone:u,labels:c,announce:f,accessFailure:r}),[e,p,u,c,f,r]);return _jsxruntime.jsx.call(void 0, Ke.Provider,{value:m,children:_jsxruntime.jsxs.call(void 0, "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":i,children:[l,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${i}-announcer`,ref:d})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},b=()=>{C()},_e= exports.useAnnounce =()=>C().announce,Kn= exports.useAccessFailure =()=>C().accessFailure;var x=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 ie=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var V=(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};var qn=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"]),Gn=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!qn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:r})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=Gn(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}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:i,tabIndex:l,ref:s,children:c})=>(b(),_jsxruntime.jsx.call(void 0, 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:i,tabIndex:l,ref:s,children:c}));var Wn=/\s/,qe=(e,t)=>{if(e===""||Wn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},A=(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 qe(e.reasonId,"an unavailable control's reason")}},O=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var Xn={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=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return H(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},I= exports.Button =({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:i,expanded:l,controls:s,ref:c,dataAttributes:p,keyShortcuts:u,busy:d,busyLabel:g})=>{b();let f=_react.useId.call(void 0, ),m=A(o,f),h=d===!0||o!==void 0,y=Xn[e],T=R=>{if(ie(R),h){R.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(R)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":y.fg,"data-cui-surface":y.surface,"data-cui-type":y.type,"data-testid":n,"aria-disabled":h?!0:void 0,"aria-busy":d===!0?!0:void 0,"aria-describedby":O(i,m),"aria-expanded":l,"aria-controls":s,"aria-keyshortcuts":V(u,n),onClick:T,ref:c,...x(p),children:_jsxruntime.jsx.call(void 0, Ge,{subject:{testId:n,part:"label",host:"button"},children:d===!0?g:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},jn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(b(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":V(a,n),onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Ge,{subject:{testId:n,part:"label",host:"button"},children:t})})),Yn=/^[^\s#]+$/,Zn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(b(),!Yn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":V(o,n),onClick:r,...x(a),children:_jsxruntime.jsx.call(void 0, Ge,{subject:{testId:n,part:"label",host:"link"},children:t})})};var er=({gap:e,testId:t,children:n})=>(b(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ve= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(b(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var rr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),or=" ",ar= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let r=_e(),a=e.actions.map(({action:l,label:s})=>{let c=t[l];if(c===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:s,handler:c}}),o=e.politeness==="status"?[e.title,...e.sentences].join(or):null,i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{o===null||i.current===o||(i.current=o,r(o))},[r,o]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Ve,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:s,handler:c})=>_jsxruntime.jsx.call(void 0, I,{variant:rr.has(l)?"primary":"secondary",onClick:c,testId:`${n}-${l}`,children:s},l))})]})};var ee=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var ir=({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 _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:i=>ee(i,o.href,n),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var _inputmethod = require('@aiquants/input-method');var lr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),Re=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&lr.has(e.type)&&(e.value!==""||e.validity.badInput),We=e=>e.nativeEvent instanceof globalThis.KeyboardEvent&&_inputmethod.isInputMethodKey.call(void 0, e.nativeEvent),W=(e,t)=>{e.key!=="Escape"||e.nativeEvent.defaultPrevented||We(e)||Re(e.target)||(e.stopPropagation(),t())},ur= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>W(t,e),[e]);var _t=e=>e===void 0?void 0:t=>W(t,e),ze= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:i,ref:l,dataAttributes:s,children:c})=>{b();let p=_react.useId.call(void 0, ),u=_t(a);return _jsxruntime.jsxs.call(void 0, "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,...x(s),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),c]})},cr={3:"h3",4:"h4"},pr= exports.CardSection =({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:i,headingRef:l,ref:s,dataAttributes:c,children:p})=>{b();let u=_react.useId.call(void 0, ),d=_t(o),g=cr[r],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, g,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${i}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":i,ref:s,onKeyDown:d,...x(c),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...x(c),children:f})};var fr=({label:e,code:t,testId:n})=>(b(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var te=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var br=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{b();let i=_react.useId.call(void 0, );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 d of t)if(!Object.hasOwn(u.cells,d.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${d.key}"`);let l=r+n.length*a,s=`cui-comparison-a${r}-c${a}-n${n.length}`,c=u=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${u}"]`,p=`${c("table")}{display:none}@container (min-width:${_chunkRYHSVWM2cjs.O.call(void 0, l)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, te,{ruleKey:s,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkRYHSVWM2cjs.O.call(void 0, r)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(d=>_jsxruntime.jsx.call(void 0, "td",{children:d.cells[u.key]("table")},d.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((u,d)=>{let g=`${i}-column-${d}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":g,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:g,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};var le="[data-cui-row-focus]",Je="[data-cui-row-detail]",hr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${le}`)],Gt=(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(le)?(r+=1,n.set(a,r)):r>=0&&a.matches(Je)&&n.set(a,r);return n},Vt=(e,t,n,r)=>{let a=hr(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)]};var Er=e=>e+1,ue= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, Er,0),o=_react.useCallback.call(void 0, (i=>()=>{r.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let i=n.current;if(i===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);i.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(i), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var Pr=new Map,Nr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Cr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(Nr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkRYHSVWM2cjs.s} px target does not fit its ${_chunkRYHSVWM2cjs.u} px; use row-control), not <${a.localName}>`)})},kr=(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}`)},Lr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),Sr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Mr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:i,rowSize:l,rowDetail:s,empty:c,testId:p,ref:u})=>{b();let d=_react.useId.call(void 0, ),g=_react.useRef.call(void 0, null);Cr(g,l,p);let f=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, Pr),h=ue(R=>Vt(R,g.current,f.current,m.current));_react.useLayoutEffect.call(void 0, ()=>{m.current=Gt(g.current,f.current)});let y=_react.useCallback.call(void 0, R=>{f.current=R;let E=h(R);return()=>{f.current=null,E()}},[h]),T=_chunkRYHSVWM2cjs.R.call(void 0, n);return kr(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:u,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":d,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkRYHSVWM2cjs.O.call(void 0, T)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:d,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(R=>_jsxruntime.jsx.call(void 0, "col",{style:R.width.fixedPx===void 0?void 0:{width:_chunkRYHSVWM2cjs.O.call(void 0, R.width.fixedPx)}},R.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(R=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:g,children:r.map(R=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...x(_optionalChain([i, 'optionalCall', _8 => _8(R)])),children:n.map(E=>E.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":E.align,children:[E.cell(R),E.rowHeaderNote===void 0?null:Lr(E.rowHeaderNote(R))]},E.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":E.align,children:E.cell(R)},E.key))}),s===void 0?null:Sr(s,R,n.length,o,h)]},a(R)))})]})})})};var Ir=({items:e,testId:t})=>{if(b(),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 _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Xt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Fr=(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},Ar=(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")},Dr=e=>e instanceof HTMLInputElement&&e.type==="search",Hr= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:i})=>{let{labels:l}=C(),s=_react.useId.call(void 0, ),c=_react.useId.call(void 0, ),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let y=p.current;if(n&&!y.open){let T=a===void 0?null:Fr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),T!==null&&Ar(y,T)}else!n&&y.open&&y.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let y=p.current;return()=>{y.open&&(y.close(),Xt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:c,"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||(Xt(u.current),u.current=null,n&&r())},onCancel:y=>{let T=d.current;d.current=!1,(T||Re(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let T=We(y);d.current=T,y.key==="Escape"&&!T&&Re(y.target)&&!Dr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{d.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:c,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),i,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Be]:"","data-testid":`${o}-announcer`})]})};var Kr=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{b();let o=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, null);return H(i,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:i,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Br=({tone:e,testId:t,children:n})=>(b(),_jsxruntime.jsx.call(void 0, "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})),pe= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(b(),_jsxruntime.jsx.call(void 0, "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));var tt=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:i,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let s=e.status===null?null:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return s===null?_jsxruntime.jsx.call(void 0, pe,{occurrence:e.occurrence,testId:o,children:i.failureSentence(e,r)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:l({kind:s,place:t,deniedSentence:s==="forbidden"?i.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var X=({unavailable:e,id:t,testId:n})=>_optionalChain([e, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:t,testId:`${n}-reason`,children:e.reason});var Vr=/\s/,nt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Vr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},en=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},ne=({description:e,error:t,errorId:n})=>{b();let r=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),i=n===void 0?o:qe(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:i].filter(c=>c!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},re=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Ee=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Wr= exports.Field =({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:i,descriptionId:l,errorId:s}=ne({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, Ee,{htmlFor:i.id,hidden:void 0,children:e}),o(i),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:l,errorId:s,testId:a})]})},tn=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:i,name:l,maxLength:s,list:c,autoComplete:p,inputMode:u,prefix:d,labelHidden:g,required:f,testId:m,ref:h})=>{let{control:y,descriptionId:T,errorId:R}=ne({label:e,description:t,error:n,errorId:r}),E=_react.useId.call(void 0, );if(d!==void 0&&d.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let w=i==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:i,name:nt(l),maxLength:en(s),value:a,list:c,autoComplete:p,inputMode:u,spellCheck:w?!1:void 0,autoCapitalize:w?"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:h,...y,"aria-describedby":O(d===void 0?void 0:E,y["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[_jsxruntime.jsx.call(void 0, Ee,{htmlFor:y.id,hidden:g,children:e}),d===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:E,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:d}),k]}),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:T,errorId:R,testId:m})]})},zr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, tn,{...e}),Jr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, tn,{...e,type:"password"}),Xr= exports.TextArea =({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:i,maxLength:l,required:s,testId:c,ref:p})=>{let{control:u,descriptionId:d,errorId:g}=ne({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${c}-field`,children:[_jsxruntime.jsx.call(void 0, Ee,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:nt(i),maxLength:en(l),value:a,required:s,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":c,ref:p,...u}),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:d,errorId:g,testId:c})]})},jr= exports.Select =({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,name:l,labelHidden:s,unavailable:c,testId:p,ref:u})=>{let{control:d,descriptionId:g,errorId:f}=ne({label:e,description:t,error:n,errorId:r}),m=_react.useId.call(void 0, ),h=A(c,m);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[_jsxruntime.jsx.call(void 0, Ee,{htmlFor:d.id,hidden:s,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:nt(l),value:a,onChange:y=>{c===void 0&&i(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...d,"aria-disabled":c===void 0?void 0:!0,"aria-describedby":O(d["aria-describedby"],h),children:o.map(y=>_jsxruntime.jsx.call(void 0, "option",{value:y.value,children:y.label},y.value))}),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:g,errorId:f,testId:p}),_jsxruntime.jsx.call(void 0, X,{unavailable:c,id:m,testId:p})]})},Yr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,unavailable:l,testId:s,ref:c})=>{let p=_react.useId.call(void 0, ),{control:u,descriptionId:d,errorId:g}=ne({label:e,description:t,error:n,errorId:r}),f=_react.useId.call(void 0, ),m=A(l,f);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":O(u["aria-describedby"],m),"data-invalid":n!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((h,y)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:p,value:h.value,checked:h.value===a,onChange:()=>{l===void 0&&i(h.value)},"aria-invalid":u["aria-invalid"],"aria-disabled":l===void 0?void 0:!0,"data-testid":`${s}-option-${h.value}`,ref:y===0?c:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:h.label})]},h.value)),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:d,errorId:g,testId:s}),_jsxruntime.jsx.call(void 0, X,{unavailable:l,id:f,testId:s})]})},Zr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:i,unavailable:l,testId:s,ref:c})=>{let{control:p,descriptionId:u,errorId:d}=ne({label:e,description:t,error:n,errorId:r}),g=_react.useId.call(void 0, ),f=A(l,g),m=o.map(T=>T.value);if(m.length===0||new Set(m).size!==m.length)throw new RangeError(`A check box group needs at least one option with unique values: ${m.join(", ")}`);let h=a.filter(T=>!m.includes(T));if(h.length>0)throw new RangeError(`The chosen values are not options: ${h.join(", ")}`);let y=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":O(p["aria-describedby"],f),"data-invalid":n!==void 0,"data-testid":s,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((T,R)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:T.value,checked:y.has(T.value),onChange:()=>{l===void 0&&i(m.filter(E=>E===T.value?!y.has(E):y.has(E)))},"aria-invalid":p["aria-invalid"],"aria-disabled":l===void 0?void 0:!0,"data-testid":`${s}-option-${T.value}`,ref:R===0?c:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:T.label})]},T.value)),_jsxruntime.jsx.call(void 0, re,{description:t,error:n,descriptionId:u,errorId:d,testId:s}),_jsxruntime.jsx.call(void 0, X,{unavailable:l,id:g,testId:s})]})};var dn=_react.createContext.call(void 0, null),nn="surface",rn={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"}},on={face:"info-tint",line:"info-accent"},ln={normal:"border-control",high:"info-accent"},ro=["normal","high"],oo=[1,2,3,4],U=_chunkRYHSVWM2cjs.v.space["space-2"],ao="fg",io="fg-secondary",un=e=>{let t=_react.useContext.call(void 0, dn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},rt=(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}`)},so= exports.Figure =e=>{b();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:i,children:l}=e;rt(o,"widthPx",r),rt(o,"heightPx",a);let s=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),c=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:ro.map(g=>_jsxruntime.jsx.call(void 0, "marker",{id:s.arrowIds[g],viewBox:`0 0 ${U} ${U}`,refX:U,refY:U/2,markerWidth:U,markerHeight:U,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":g,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${U} ${U/2} L 0 ${U} z`,"data-cui-stroke":ln[g],"data-testid":`${o}-arrow-${g}`})},g))}),_jsxruntime.jsx.call(void 0, dn.Provider,{value:s,children:l})]});if(e.kind==="group"){let{label:g,onEscape:f}=e;if(!_chunkRYHSVWM2cjs.h.call(void 0, g))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(g)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":g,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":nn,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-block":_chunkRYHSVWM2cjs.O.call(void 0, a)},onKeyDown:f===void 0?void 0:m=>W(m,f),"data-testid":o,...x(i),children:c})})}let{viewBox:p,pointer:u,svgRef:d}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:d,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":nn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkRYHSVWM2cjs.O.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...x(i),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:c})})},an=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},lo=(e,t,n)=>{for(let r of t){let a=_chunkXLOWKWIIcjs.i.light[r.fg],o=n.find(i=>a[i]===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`)}},uo= exports.FigureNode =e=>{b();let t=un("FigureNode"),n=_react.useId.call(void 0, ),{x:r,y:a,shape:o,tone:i,outline:l,selected:s,name:c,title:p,press:u,testId:d,dataAttributes:g}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${d}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${d}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${d}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, u.label))throw new RangeError(`${d}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=s?on:rn[i];lo(d,f,[rn[i].face,on.face]);let h,y,T;if(o.kind==="box"){if(c===null)throw new RangeError(`${d}: 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 E=an(d,()=>_chunkRYHSVWM2cjs.I.call(void 0, {name:c,notes:f.map(k=>k.text)}));if(rt(d,"a box's widthPx",o.widthPx),o.widthPx<E.minWidthPx)throw new RangeError(`${d}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${E.minWidthPx} px)`);h={width:o.widthPx,height:E.heightPx,left:r,top:a};let w=_chunkRYHSVWM2cjs.J.call(void 0, f.length);y=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":m.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:E.heightPx,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${d}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:w.insetPx,y:w.namePx,fontSize:_chunkRYHSVWM2cjs.v.type.body.size,"data-cui-fg":ao,"data-cui-figure-type":"body","data-testid":`${d}-name`,children:c}),f.map((k,$)=>_jsxruntime.jsx.call(void 0, "text",{x:w.insetPx,y:w.notesPx[$],fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${d}-note-${$}`,children:k.text},$))]}),T=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkRYHSVWM2cjs.M,y:-_chunkRYHSVWM2cjs.M,width:o.widthPx+2*_chunkRYHSVWM2cjs.M,height:E.heightPx+2*_chunkRYHSVWM2cjs.M,rx:_chunkRYHSVWM2cjs.v.radius["radius-item"]+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${d}-ring`})}else{let E=an(d,()=>_chunkRYHSVWM2cjs.K.call(void 0, c,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},y=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":m.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${d}-plate`})}),c===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:E.extentBelowPx-_chunkRYHSVWM2cjs.v.type.caption.lineHeight/2,fontSize:_chunkRYHSVWM2cjs.v.type.caption.size,"data-cui-fg":io,"data-cui-figure-type":"caption","data-testid":`${d}-name`,children:c})]}),T=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkRYHSVWM2cjs.M,"data-cui-stroke":"focus","data-testid":`${d}-ring`})}if(u!==void 0){if(h.width<_chunkRYHSVWM2cjs.s||h.height<_chunkRYHSVWM2cjs.s)throw new RangeError(`${d}: a pressable node must be at least the ${_chunkRYHSVWM2cjs.s} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkRYHSVWM2cjs.L||h.top<_chunkRYHSVWM2cjs.L||h.left+h.width+_chunkRYHSVWM2cjs.L>t.widthPx||h.top+h.height+_chunkRYHSVWM2cjs.L>t.heightPx)throw new RangeError(`${d}: a pressable node must keep ${_chunkRYHSVWM2cjs.L} 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:E=>{E.currentTarget.focus(),u.onPress()},onKeyDown:E=>{E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),E.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":i,"data-cui-outline":l,"data-selected":String(s),...R,"data-testid":d,...x(g),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${d}-description`,children:u.description}),u===void 0?null:T,y]})},co= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:i})=>{b();let l=un("FigureEdge");if(!oo.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":ln[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...x(i),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var po={1:"h1",2:"h2",3:"h3"},yo= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{b();let o=po[e];return _jsxruntime.jsx.call(void 0, 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})};var mo={removed:"danger-tint",added:"success-tint"},go= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(b(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":mo[e],"data-cui-fg":"fg","data-testid":t,children:n})};var ho={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"}},Ro={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},ot= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{b();let o=t==="tint"?ho[e]:{fg:"on-solid",surface:Ro[e]};return _jsxruntime.jsx.call(void 0, "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,...x(r),children:a})};var at=({label:e,valueText:t,value:n,max:r,testId:a})=>{b();let o=_react.useId.call(void 0, );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 i=r===null?null:{max:r,now:Math.min(n,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":_optionalChain([i, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([i, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var wo=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, ze,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, ot,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, at,{...n,testId:`${a}-progress`}),o]});var it=_react.createContext.call(void 0, null),No="space-2",Co= exports.List =e=>{b();let{gap:t,label:n,id:r,hidden:a,testId:o,children:i}=e;if(n!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, 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,s=l!==void 0,c=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, it.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, c,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?No:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:i})})},ko= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{b();let r=_react.useContext.call(void 0, it);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...x(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, it.Provider,{value:null,children:n})})})};var fn=e=>[...e.querySelectorAll(le)].filter(t=>{let n=t.closest(Je);return n===null||!e.contains(n)}),So=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=fn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${le} elements for ${e.count} rows`);return n},Mo=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Io= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:i})=>{let{formatLocale:l,labels:s}=C(),c=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, !1),g=()=>{let y=o.ref.current;c.current={shown:new Set(y===null?[]:fn(y)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let y=d.current;d.current=!1;let T=c.current;if(T===null)return;let R=So(o);if(t){T.busySeen=!0,T.shown=new Set(R);return}let E=Mo(R,T.shown),w=r!==null&&r.occurrence!==T.failureOccurrence;if(!(T.busySeen||E!==void 0||w||n)||(c.current=null,w||E===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&E.focus()});let f=ue(()=>n?p.current:u.current),m=_react.useCallback.call(void 0, (y=>{u.current=y;let T=f(y);return()=>{u.current=null,d.current=y===document.activeElement,T()}}),[f]),h=_react.useCallback.call(void 0, (y=>{p.current=y;let T=f(y);return()=>{p.current=null,T()}}),[f]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:[_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:g,ref:m,testId:`${i}-button`,children:s.loadMore(_chunkRYHSVWM2cjs.c.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, pe,{occurrence:r.occurrence,testId:`${i}-failure`,children:s.loadFailed(r.reason)})]})};var Fo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{b();let o=_chunkRYHSVWM2cjs.Q.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkRYHSVWM2cjs.v.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, te,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var Ce=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:i,unit:l}=e;if(l!==void 0&&!_chunkRYHSVWM2cjs.h.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(i===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let s=_chunkRYHSVWM2cjs.c.call(void 0, i,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkRYHSVWM2cjs.e.call(void 0, s,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkRYHSVWM2cjs.h.call(void 0, 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 _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};var Ao=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(b(),!(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 _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var Uo={ArrowLeft:-1,ArrowRight:1},Ko= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:i})=>{b();let l=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let c=t.map(m=>m.id);if(new Set(c).size!==c.length)throw new RangeError(`Tab keys must be unique: ${c.join(", ")}`);let p=c.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${c.join(", ")}`);let u=m=>`${l}-tab-${m}`,d=`${l}-panel`,g=m=>{let h=t[m];h.id!==n&&r(h.id),_optionalChain([s, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(h.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let h=t.findIndex(E=>s.current.get(E.id)===m.target),y=h<0?p:h,T=Uo[m.key],R;if(T!==void 0){let E=getComputedStyle(m.currentTarget).direction==="rtl"?-T:T;R=(y+E+t.length)%t.length}else if(m.key==="Home")R=0;else if(m.key==="End")R=t.length-1;else return;m.preventDefault(),g(R)},children:t.map((m,h)=>{let y=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":d,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:T=>{T===null?s.current.delete(m.id):s.current.set(m.id,T)},onClick:()=>g(h),children:m.label},m.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:d,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};var qo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:i}=C(),l=_jsxruntime.jsx.call(void 0, tt,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?i.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[l,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};var Vo=({label:e,options:t,value:n,onValueChange:r,unavailable:a,testId:o,density:i="regular"})=>{b();let l=_react.useId.call(void 0, ),s=_react.useId.call(void 0, ),c=A(a,s),p=d=>{a===void 0&&d!==n&&r(d)},u=new Set(t.map(d=>d.value));if(t.length<2||u.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(d=>d.value).join(", ")}`);if(!u.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...u].join(", ")}`);if(i!=="regular"&&i!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(i)}`);return i==="compact"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":l,"aria-describedby":c,"data-cui-density":"compact","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:l,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(d=>{let g=d.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":g,"aria-disabled":a===void 0?void 0:!0,"data-testid":`${o}-${d.value}`,onClick:()=>p(d.value),children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":g?"on-solid":"fg","data-cui-surface":g?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${o}-${d.value}-face`,children:d.label})},d.value)})}),_jsxruntime.jsx.call(void 0, X,{unavailable:a,id:s,testId:o})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-describedby":c,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(d=>{let g=d.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":g,"aria-disabled":a===void 0?void 0:!0,"data-cui-fg":g?"on-solid":"fg","data-cui-surface":g?"info-solid":void 0,"data-cui-type":"body","data-testid":`${o}-${d.value}`,onClick:()=>p(d.value),children:d.label},d.value)})}),_jsxruntime.jsx.call(void 0, X,{unavailable:a,id:s,testId:o})]})};var hn=e=>{let t=_react.useRef.call(void 0, null),n=_react.useCallback.call(void 0, r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},Rn= exports.RowButton =({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:i,children:l})=>{b();let{row:s,bindRow:c}=hn(o);H(s,{testId:r,part:"row",host:"button"});let p=u=>{ie(u),n()};return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":V(i,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p,ref:c,...x(a),children:l})},Jo= exports.RowLink =({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:i,children:l})=>{b();let{row:s,bindRow:c}=hn(o);H(s,{testId:r,part:"row",host:"link"});let p=u=>{ie(u),ee(u,e,n)};return _jsxruntime.jsx.call(void 0, "a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":V(i,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p,ref:c,...x(a),children:l})},Xo= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:i,rowTestId:l,rowData:s,empty:c,testId:p,ref:u})=>(b(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(d=>{let g=n(d);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, Rn,{selected:g===r,controls:o,onSelect:()=>a(d),testId:l,dataAttributes:_optionalChain([s, 'optionalCall', _23 => _23(d)]),children:i(d)})},g)})})}));var Yo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:i,testId:l})=>{b();let s=_react.useId.call(void 0, );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 c=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:s,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":c,"data-testid":l,onChange:p=>i(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:c})})]})]})};var En={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}},Qo= exports.Stepper =({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,i)=>i>0&&En[o.state]<En[t[i-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 _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,i)=>{let l=Zo[o.state],s=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "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":i+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};var na=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:i,dataAttributes:l})=>{b();let s=_react.useId.call(void 0, ),c=_react.useRef.call(void 0, null);H(c,{testId:o,part:"label",host:"button"});let p=A(a,s),u=a!==void 0,d=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":O(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{u||r(!n)},...x(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:c,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?d:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[d,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};var sa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(b(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.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: ${[...i].join(", ")}`);let[s,c]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),d=_react.useId.call(void 0, ),g=_react.useCallback.call(void 0, f=>{c(!1),f&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&s))return;let f=y=>p.current!==null&&!p.current.contains(y),m=y=>{f(y.target)&&g(!0)},h=y=>{f(y.target)&&g(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",h,!0)}},[o,s,g]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>W(f,()=>g(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":d,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>c(f=>!f),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:d,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "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:h=>{ee(h,f.href,r),h.defaultPrevented&&g(!1)},children:f.label})},f.id)})})]})};var ca={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},pa= exports.MetricTile =e=>{b();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 _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...x(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":ca[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Ce,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, Ce,{text:e.text,keep:"wrap",testId:l})})]})},Nn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?Nn(t.props.children):[t]}),ya= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{b();let a=_chunkRYHSVWM2cjs.T.call(void 0, e,t,_chunkRYHSVWM2cjs.v.space["space-2"]),o=Nn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, te,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var Me=e=>[...e.querySelectorAll("button")],ma= exports.Toolbar =({label:e,testId:t,children:n})=>{b();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let s=Me(r.current),c=a.current!==null&&s.includes(a.current)?a.current:_nullishCoalesce(s[0], () => (null));a.current=c;for(let p of s)p.tabIndex=p===c?0:-1});let o=s=>{for(let c of Me(r.current))c.tabIndex=c===s?0:-1;a.current=s};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:s=>{let c=Me(s.currentTarget).find(p=>p.contains(s.target));c!==void 0&&o(c)},onKeyDown:s=>{let c=Me(s.currentTarget),p=c.indexOf(s.target);if(p===-1)return;let u=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",d=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(p+1)%c.length,[d]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[s.key];if(f===void 0)return;s.preventDefault();let m=c[f];o(m),m.focus()},children:n})};var ha=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var Ln=e=>e===null?_chunkRYHSVWM2cjs.X:_chunkRYHSVWM2cjs.Y,$e=(e,t,n,r,a)=>{let[o,i]=_react.useState.call(void 0, ()=>({key:e,state:Ln(e)})),[l,s]=_react.useState.call(void 0, 0),[c,p]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),d=_react.useRef.call(void 0, null),g=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){i({key:null,state:_chunkRYHSVWM2cjs.X});return}let R=new AbortController;d.current=e;let E=l===g.current?"revision":"reload";return g.current=l,i(w=>Object.is(w.key,e)?{key:e,state:r(w.state,E)}:{key:e,state:_chunkRYHSVWM2cjs.Y}),u.current(R.signal).then(w=>{R.signal.aborted||(d.current=null,i(k=>({key:e,state:a(k.state,w)})))},w=>{R.signal.aborted||i(()=>{throw w})}),()=>{R.abort(),d.current=null}},[e,n,l,c]);let f=_react.useCallback.call(void 0, ()=>s(R=>R+1),[]),m=_react.useCallback.call(void 0, ()=>p(R=>R+1),[]),h=_react.useCallback.call(void 0, (R,E)=>{i(w=>Object.is(w.key,R)?{key:R,state:E(w.state)}:w)},[]),y=_react.useCallback.call(void 0, (R,E)=>{h(R,E),Object.is(d.current,R)&&m()},[h,m]);return{state:Object.is(o.key,e)?o.state:Ln(e),reload:f,refresh:m,update:h,write:y}};var va=(e,t,n)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, y=>r.current.first(y),[]),{state:o,reload:i,refresh:l,update:s,write:c}=$e(e,a,n,_chunkRYHSVWM2cjs.$,_chunkRYHSVWM2cjs.aa),p=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),d=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>d,[e,n,d]);let g=_react.useCallback.call(void 0, ()=>{d(),i()},[d,i]),f=_react.useCallback.call(void 0, ()=>{d(),l()},[d,l]),m=_react.useCallback.call(void 0, ()=>{let{key:y,state:T}=p.current;if(y===null||T.kind!=="ready"||T.refreshing||T.value.next===null||T.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=T.value.next,E={key:y,controller:new AbortController,maps:[]};u.current=E,s(y,_chunkRYHSVWM2cjs.ba),r.current.next(R,E.controller.signal).then(w=>{u.current===E&&(u.current=null,s(y,k=>E.maps.reduce(($,ae)=>_chunkRYHSVWM2cjs.da.call(void 0, $,ae),_chunkRYHSVWM2cjs.ca.call(void 0, k,R,w))))},w=>{u.current===E&&s(y,()=>{throw w})})},[s]),h=_react.useCallback.call(void 0, (y,T)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(T),c(y,E=>_chunkRYHSVWM2cjs.da.call(void 0, E,T))},[c]);return{state:o,reload:g,refresh:f,loadMore:m,updateList:h}};var Na=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ca= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let i=o();if(!Na(i))return;let l=Symbol(a);n.current=l,t(a);let s=()=>{n.current===l&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:r}};var La=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:i}=$e(e,t,n,_chunkRYHSVWM2cjs.Z,_chunkRYHSVWM2cjs._),l=_react.useCallback.call(void 0, (s,c)=>i(s,p=>_chunkRYHSVWM2cjs._.call(void 0, p,{ok:!0,value:c})),[i]);return{state:r,reload:a,refresh:o,put:l}};var Sa=({testId:e,children:t})=>(b(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = be; exports.AccessFailureNotice = ar; exports.AlertMessage = pe; exports.Breadcrumb = ir; exports.Button = I; exports.COMPACT_ROW_PX = _chunkRYHSVWM2cjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkRYHSVWM2cjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.Card = ze; exports.CardSection = pr; exports.CheckboxGroup = Zr; exports.Cluster = Ve; exports.CodeBlock = fr; exports.ComparisonGrid = br; exports.ConsoleUiRoot = Un; exports.DataTable = Mr; exports.DescriptionList = Ir; exports.Dialog = Hr; exports.Disclosure = Kr; exports.FIGURE_RING_REACH_PX = _chunkRYHSVWM2cjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkRYHSVWM2cjs.C; exports.FailureMessage = tt; exports.Field = Wr; exports.Figure = so; exports.FigureEdge = co; exports.FigureNode = uo; exports.FragmentLink = Zn; exports.HTTP_FORBIDDEN = _chunkRYHSVWM2cjs.U; exports.Heading = yo; exports.InlineChange = go; exports.JobCard = wo; exports.LATTICE_PX = _chunkRYHSVWM2cjs.q; exports.Link = jn; exports.List = Co; exports.ListItem = ko; exports.LoadMore = Io; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.MasterDetail = Fo; exports.Measured = Ce; exports.Meter = Ao; exports.MetricTile = pa; exports.Notice = Br; exports.PanelTabs = Ko; exports.PasswordInput = Jr; exports.Pill = ot; exports.ProgressBar = at; exports.ROW_WITH_CONTROL_PX = _chunkRYHSVWM2cjs.t; exports.RadioGroup = Yr; exports.ResourceFailed = qo; exports.RowButton = Rn; exports.RowLink = Jo; exports.SegmentedControl = Vo; exports.Select = jr; exports.SelectableList = Xo; exports.Slider = Yo; exports.Stack = er; exports.Stepper = Qo; exports.Switch = na; exports.TARGET_PX = _chunkRYHSVWM2cjs.s; exports.TOKENS = _chunkRYHSVWM2cjs.v; exports.TONES = _chunkRYHSVWM2cjs.ia; exports.TONE_HUES = _chunkRYHSVWM2cjs.ga; exports.TONE_ROLES = _chunkRYHSVWM2cjs.ha; exports.Tabs = sa; exports.Text = P; exports.TextArea = Xr; exports.TextInput = zr; exports.TileGrid = ya; exports.Toolbar = ma; exports.VisuallyHidden = Sa; exports.ZonedTimeError = _chunkRYHSVWM2cjs.i; exports.beginPage = _chunkRYHSVWM2cjs.ba; exports.beginPagedReload = _chunkRYHSVWM2cjs.$; exports.beginReload = _chunkRYHSVWM2cjs.Z; exports.ceil8 = _chunkRYHSVWM2cjs.z; exports.ceilToLattice = _chunkRYHSVWM2cjs.r; exports.cellContentInlinePx = _chunkRYHSVWM2cjs.A; exports.comparisonAttributePx = _chunkRYHSVWM2cjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkRYHSVWM2cjs.F; exports.cssVar = _chunkRYHSVWM2cjs.w; exports.figureBoxPlan = _chunkRYHSVWM2cjs.I; exports.figureDiscLabelPlan = _chunkRYHSVWM2cjs.K; exports.fillLabel = _chunkRYHSVWM2cjs.m; exports.fixedColumnPx = _chunkRYHSVWM2cjs.B; exports.flatMapOutcome = _chunkRYHSVWM2cjs.W; exports.formatByteSize = _chunkRYHSVWM2cjs.d; exports.formatCount = _chunkRYHSVWM2cjs.c; exports.formatInstant = _chunkRYHSVWM2cjs.l; exports.goldenSectionPx = _chunkRYHSVWM2cjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkRYHSVWM2cjs.E; exports.isReadableText = _chunkRYHSVWM2cjs.h; exports.keepLastGood = _chunkRYHSVWM2cjs._; exports.lightDark = _chunkRYHSVWM2cjs.ea; exports.mapOutcome = _chunkRYHSVWM2cjs.V; exports.mapPagedList = _chunkRYHSVWM2cjs.da; exports.masterDetailPlan = _chunkRYHSVWM2cjs.P; exports.monoTextWidthEm = _chunkRYHSVWM2cjs.y; exports.placeholderRule = _chunkRYHSVWM2cjs.fa; exports.pxToRem = _chunkRYHSVWM2cjs.O; exports.readDecimalText = _chunkRYHSVWM2cjs.f; exports.readIntegerText = _chunkRYHSVWM2cjs.g; exports.reasonAside = _chunkRYHSVWM2cjs.n; exports.resolveConsoleUiLabels = _chunkRYHSVWM2cjs.p; exports.settleFirstPage = _chunkRYHSVWM2cjs.aa; exports.settlePage = _chunkRYHSVWM2cjs.ca; exports.spacedTextWidthEm = _chunkRYHSVWM2cjs.H; exports.tableFrameMinInlinePx = _chunkRYHSVWM2cjs.S; exports.tableMinInlinePx = _chunkRYHSVWM2cjs.R; exports.textWidthEm = _chunkRYHSVWM2cjs.x; exports.tileGridPlan = _chunkRYHSVWM2cjs.T; exports.tileMinInlinePx = _chunkRYHSVWM2cjs.G; exports.toOffsetIso = _chunkRYHSVWM2cjs.j; exports.toWallTime = _chunkRYHSVWM2cjs.k; exports.topmostModalOf = _chunkRYHSVWM2cjs.b; exports.useAccessFailure = Kn; exports.useAnnounce = _e; exports.useConsoleUi = C; exports.useEscapeToClose = ur; exports.useFailureOccurrence = ha; exports.useFocusRescue = ue; exports.usePagedResource = va; exports.usePendingPress = Ca; exports.useResource = La;
package/dist/index.d.cts CHANGED
@@ -302,10 +302,11 @@ type RadioGroupProps = FieldErrorId & {
302
302
  readonly value: string | null;
303
303
  readonly options: readonly FieldOption[];
304
304
  readonly onValueChange: (value: string) => void;
305
+ readonly unavailable?: Unavailable;
305
306
  readonly testId: string;
306
307
  readonly ref?: Ref<HTMLInputElement>;
307
308
  };
308
- declare const RadioGroup: ({ legend, description, error, errorId: namedErrorId, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
309
+ declare const RadioGroup: ({ legend, description, error, errorId: namedErrorId, value, options, onValueChange, unavailable, testId, ref }: RadioGroupProps) => react.JSX.Element;
309
310
  type CheckboxGroupProps = FieldErrorId & {
310
311
  readonly legend: string;
311
312
  readonly description?: string;
@@ -313,10 +314,11 @@ type CheckboxGroupProps = FieldErrorId & {
313
314
  readonly values: readonly string[];
314
315
  readonly options: readonly FieldOption[];
315
316
  readonly onValuesChange: (values: readonly string[]) => void;
317
+ readonly unavailable?: Unavailable;
316
318
  readonly testId: string;
317
319
  readonly ref?: Ref<HTMLInputElement>;
318
320
  };
319
- declare const CheckboxGroup: ({ legend, description, error, errorId: namedErrorId, values, options, onValuesChange, testId, ref }: CheckboxGroupProps) => react.JSX.Element;
321
+ declare const CheckboxGroup: ({ legend, description, error, errorId: namedErrorId, values, options, onValuesChange, unavailable, testId, ref }: CheckboxGroupProps) => react.JSX.Element;
320
322
  type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
321
323
  type PillProps = {
322
324
  readonly tone: PillTone;
@@ -563,10 +565,11 @@ type SegmentedControlProps = {
563
565
  readonly options: readonly SegmentedOption[];
564
566
  readonly value: string;
565
567
  readonly onValueChange: (value: string) => void;
568
+ readonly unavailable?: Unavailable;
566
569
  readonly testId: string;
567
570
  readonly density?: "regular" | "compact";
568
571
  };
569
- declare const SegmentedControl: ({ label, options, value, onValueChange, testId, density }: SegmentedControlProps) => react.JSX.Element;
572
+ declare const SegmentedControl: ({ label, options, value, onValueChange, unavailable, testId, density }: SegmentedControlProps) => react.JSX.Element;
570
573
  type RowButtonProps = {
571
574
  readonly selected: boolean;
572
575
  readonly controls: string;
package/dist/index.d.ts CHANGED
@@ -302,10 +302,11 @@ type RadioGroupProps = FieldErrorId & {
302
302
  readonly value: string | null;
303
303
  readonly options: readonly FieldOption[];
304
304
  readonly onValueChange: (value: string) => void;
305
+ readonly unavailable?: Unavailable;
305
306
  readonly testId: string;
306
307
  readonly ref?: Ref<HTMLInputElement>;
307
308
  };
308
- declare const RadioGroup: ({ legend, description, error, errorId: namedErrorId, value, options, onValueChange, testId, ref }: RadioGroupProps) => react.JSX.Element;
309
+ declare const RadioGroup: ({ legend, description, error, errorId: namedErrorId, value, options, onValueChange, unavailable, testId, ref }: RadioGroupProps) => react.JSX.Element;
309
310
  type CheckboxGroupProps = FieldErrorId & {
310
311
  readonly legend: string;
311
312
  readonly description?: string;
@@ -313,10 +314,11 @@ type CheckboxGroupProps = FieldErrorId & {
313
314
  readonly values: readonly string[];
314
315
  readonly options: readonly FieldOption[];
315
316
  readonly onValuesChange: (values: readonly string[]) => void;
317
+ readonly unavailable?: Unavailable;
316
318
  readonly testId: string;
317
319
  readonly ref?: Ref<HTMLInputElement>;
318
320
  };
319
- declare const CheckboxGroup: ({ legend, description, error, errorId: namedErrorId, values, options, onValuesChange, testId, ref }: CheckboxGroupProps) => react.JSX.Element;
321
+ declare const CheckboxGroup: ({ legend, description, error, errorId: namedErrorId, values, options, onValuesChange, unavailable, testId, ref }: CheckboxGroupProps) => react.JSX.Element;
320
322
  type PillTone = "neutral" | "info" | "success" | "warning" | "danger";
321
323
  type PillProps = {
322
324
  readonly tone: PillTone;
@@ -563,10 +565,11 @@ type SegmentedControlProps = {
563
565
  readonly options: readonly SegmentedOption[];
564
566
  readonly value: string;
565
567
  readonly onValueChange: (value: string) => void;
568
+ readonly unavailable?: Unavailable;
566
569
  readonly testId: string;
567
570
  readonly density?: "regular" | "compact";
568
571
  };
569
- declare const SegmentedControl: ({ label, options, value, onValueChange, testId, density }: SegmentedControlProps) => react.JSX.Element;
572
+ declare const SegmentedControl: ({ label, options, value, onValueChange, unavailable, testId, density }: SegmentedControlProps) => react.JSX.Element;
570
573
  type RowButtonProps = {
571
574
  readonly selected: boolean;
572
575
  readonly controls: string;
package/dist/index.js CHANGED
@@ -1 +1 @@
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 xt,R as wt,S as ii,T as vt,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:x}=b.current;b.current=null,clearTimeout(T),clearTimeout(x);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 v=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,...v(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,...v(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"||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,...v(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,...v(d),children:f}):G("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...v(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 xr,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 wr=new Map,vr='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(vr)].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=xr(),b=Xe(null);Pr(b,l,y);let f=Xe(null),m=Xe(wr),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=wt(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,...v(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 w,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:w(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:w(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>w("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:[w(Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),w(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 x=s==="password",k=w("input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:x?!1:void 0,autoCapitalize:x?"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:[w(Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[w("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]}),w(ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr=e=>w(en,{...e}),Vr=e=>w(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:[w(Te,{htmlFor:u.id,hidden:void 0,children:e}),w("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}),w(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:[w(Te,{htmlFor:c.id,hidden:i,children:e}),w("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=>w("option",{value:p.value,children:p.label},p.value))}),w(ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),d?.reason===void 0?null:w(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:[w("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:[w("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}),w("span",{children:b.label})]},b.value)),w(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:[w("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:[w("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}),w("span",{children:m.label})]},m.value)),w(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,...v(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,...v(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 x=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:x.insetPx,y:x.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:x.insetPx,y:x.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,...v(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,...v(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,...v(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 xe,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:xe(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:[xe("span",{className:"cui-visually-hidden",children:`${e} `}),xe(rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:xe(ot,{...n,testId:`${a}-progress`}),o]});import{createContext as Eo,useContext as xo}from"react";import{jsx as ye}from"react/jsx-runtime";var at=Eo(null),wo="space-2",vo=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?wo: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=xo(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,...v(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 we}from"react";import{jsx as ve,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=we(null),y=we(null),u=we(null),c=we(!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),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(d.current=null,x||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?ve("div",{className:"cui-load-more","data-testid":s,children:ve(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:[ve(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(me(a,l))}),r===null?null:ve(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=xt({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,...v(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,...v(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)},...v(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 xn,useState as oa}from"react";import{jsx as fe,jsxs as wn}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=xn(null),u=xn(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]),wn("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?wn("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,...v(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})})]})},vn=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?vn(t.props.children):[t]}),ca=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=vt(e,t,M.space["space-2"]),o=vn(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(x=>Object.is(x.key,e)?{key:e,state:r(x.state,T)}:{key:e,state:De}),u.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,x)})))},x=>{h.signal.aborted||s(()=>{throw x})}),()=>{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(x=>Object.is(x.key,h)?{key:h,state:T(x.state)}:x)},[]),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(x=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>Oe($,oe),Lt(k,h,x))))},x=>{u.current===T&&i(p,()=>{throw x})})},[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 xa,useState as wa}from"react";var va=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa=()=>{let[e,t]=wa(null),n=xa(null),r=Ea((a,o)=>{let s=o();if(!va(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,vo 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,wt as tableMinInlinePx,za as textWidthEm,vt 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};
1
+ import{$ as Ct,A as Za,B as Qa,C as ei,D as ti,E as ni,F as ri,G as oi,H as ai,I as Tt,J as Et,K as vt,L as Q,M as G,N as ii,O as F,P as si,Q as wt,R as xt,S as di,T as Pt,U as li,V as ui,W as ci,X as De,Y as He,Z as Nt,_ as Oe,a as ft,aa as kt,b as mt,ba as Lt,c as ge,ca as St,d as Ia,da as Ue,e as gt,ea as pi,f as $a,fa as yi,g as Fa,ga as fi,h as B,ha as mi,i as Aa,ia as gi,j as Da,k as Ha,l as Oa,m as Ua,n as Ka,o as Ba,p as bt,q as Ae,r as Wa,s as Z,t as za,u as Rt,v as M,w as Ja,x as Xa,y as ja,z as Ya}from"./chunk-HROMRBBM.js";import{a as _a,e as qa,f as Ga,g as Va,h as Fe,i as ht}from"./chunk-RA33TN5N.js";import{useEffect as tr,useRef as nr}from"react";import{useId as zn,useRef as Jn}from"react";import{createContext as Mn,useCallback as In,useContext as Dt,useLayoutEffect as $n,useMemo as Mt,useRef as It}from"react";import{jsx as At,jsxs as Bn}from"react/jsx-runtime";var Ke=Mn(null),Ht=" ",$t='[inert], [aria-hidden="true" i]',Be="data-cui-dialog-announcer",Fn=`:scope > [${Be}]`,An=e=>{if(e.closest($t)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=mt(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(Fn);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest($t)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Dn=e=>{try{e.querySelectorAll(ft)}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}},be=150,Hn=1e3,Ft=new WeakMap,On=(e,t)=>{let n=Ft.get(e)??new Set,r={text:t};Ft.set(e,n.add(r)),setTimeout(()=>n.delete(r),be);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ht),e.replaceChildren(a)},Un=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:i,children:l})=>{if(Dt(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(!Fe.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${Fe.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let c=bt(e),[p]=Intl.getCanonicalLocales(t),u=Mt(()=>new Intl.DateTimeFormat(p,{timeZone:n}).resolvedOptions().timeZone,[p,n]),d=It(null),g=It(null);$n(()=>{Dn(d.current.ownerDocument)},[]);let f=In(h=>{if(h.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let y=()=>{let{texts:R,settle:E,deadline:w}=g.current;g.current=null,clearTimeout(E),clearTimeout(w);let k=d.current;if(k===null)return;let $=R.join(Ht),ae=An(k);if("hidden"in ae)throw new Error(`announce: the live region is hidden from assistive technology (${ae.hidden}), so this announcement would be lost: ${$}`);On(ae.region,$)},T=g.current;if(T===null){g.current={texts:[h],settle:setTimeout(y,be),deadline:setTimeout(y,Hn)};return}T.texts.push(h),clearTimeout(T.settle),T.settle=setTimeout(y,be)},[]),m=Mt(()=>({locale:e,formatLocale:p,timeZone:u,labels:c,announce:f,accessFailure:r}),[e,p,u,c,f,r]);return At(Ke.Provider,{value:m,children:Bn("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":i,children:[l,At("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${i}-announcer`,ref:d})]})})},C=()=>{let e=Dt(Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},b=()=>{C()},_e=()=>C().announce,Kn=()=>C().accessFailure;var x=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 ie=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var V=(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 _n}from"react";var qn=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"]),Gn=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!qn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:r})=>{_n(()=>{let a=Gn(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 Vn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:i,tabIndex:l,ref:s,children:c})=>(b(),Vn(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:i,tabIndex:l,ref:s,children:c}));var Wn=/\s/,qe=(e,t)=>{if(e===""||Wn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},A=(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 qe(e.reasonId,"an unavailable control's reason")}},O=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as _,jsxs as Qn}from"react/jsx-runtime";var Xn={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=({subject:e,children:t})=>{let n=Jn(null);return H(n,e),_("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:i,expanded:l,controls:s,ref:c,dataAttributes:p,keyShortcuts:u,busy:d,busyLabel:g})=>{b();let f=zn(),m=A(o,f),h=d===!0||o!==void 0,y=Xn[e],T=R=>{if(ie(R),h){R.preventDefault();return}a?.(R)};return Qn("span",{className:"cui-button-group",children:[_("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":y.fg,"data-cui-surface":y.surface,"data-cui-type":y.type,"data-testid":n,"aria-disabled":h?!0:void 0,"aria-busy":d===!0?!0:void 0,"aria-describedby":O(i,m),"aria-expanded":l,"aria-controls":s,"aria-keyshortcuts":V(u,n),onClick:T,ref:c,...x(p),children:_(Ge,{subject:{testId:n,part:"label",host:"button"},children:d===!0?g:t})}),o?.reason===void 0?null:_(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})=>(b(),_("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":V(a,n),onClick:e,ref:r,children:_(Ge,{subject:{testId:n,part:"label",host:"button"},children:t})})),Yn=/^[^\s#]+$/,Zn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(b(),!Yn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":V(o,n),onClick:r,...x(a),children:_(Ge,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ot}from"react/jsx-runtime";var er=({gap:e,testId:t,children:n})=>(b(),Ot("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ve=({gap:e,as:t="div",testId:n,children:r})=>(b(),Ot(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as he,jsxs as Ut}from"react/jsx-runtime";var rr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),or=" ",ar=({view:e,handlers:t,testId:n})=>{let r=_e(),a=e.actions.map(({action:l,label:s})=>{let c=t[l];if(c===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:s,handler:c}}),o=e.politeness==="status"?[e.title,...e.sentences].join(or):null,i=nr(null);return tr(()=>{o===null||i.current===o||(i.current=o,r(o))},[r,o]),Ut("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ut("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:[he("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>he("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:he(Ve,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:s,handler:c})=>he(I,{variant:rr.has(l)?"primary":"secondary",onClick:c,testId:`${n}-${l}`,children:s},l))})]})};var ee=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as se,jsxs as Kt}from"react/jsx-runtime";var ir=({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 se("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:[se("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:i=>ee(i,o.href,n),children:o.label}),se("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),se("li",{className:"cui-breadcrumb-item",children:se("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Bt}from"react";import{isInputMethodKey as sr}from"@aiquants/input-method";import{useCallback as dr}from"react";var lr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),Re=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&lr.has(e.type)&&(e.value!==""||e.validity.badInput),We=e=>e.nativeEvent instanceof globalThis.KeyboardEvent&&sr(e.nativeEvent),W=(e,t)=>{e.key!=="Escape"||e.nativeEvent.defaultPrevented||We(e)||Re(e.target)||(e.stopPropagation(),t())},ur=e=>dr(t=>W(t,e),[e]);import{Fragment as yr,jsx as z,jsxs as de}from"react/jsx-runtime";var _t=e=>e===void 0?void 0:t=>W(t,e),ze=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:i,ref:l,dataAttributes:s,children:c})=>{b();let p=Bt(),u=_t(a);return de("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,...x(s),children:[de("div",{className:"cui-card-header",children:[de("div",{className:"cui-card-heading",children:[z("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:z("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:z("div",{className:"cui-card-actions",children:r})]}),c]})},cr={3:"h3",4:"h4"},pr=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:i,headingRef:l,ref:s,dataAttributes:c,children:p})=>{b();let u=Bt(),d=_t(o),g=cr[r],f=de(yr,{children:[de("div",{className:"cui-card-section-heading",children:[z(g,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${i}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:z("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?z("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":i,ref:s,onKeyDown:d,...x(c),children:f}):z("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...x(c),children:f})};import{jsx as qt}from"react/jsx-runtime";var fr=({label:e,code:t,testId:n})=>(b(),qt("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:qt("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 gr}from"react";import{jsx as mr}from"react/jsx-runtime";var te=({ruleKey:e,css:t})=>mr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as J}from"react/jsx-runtime";var br=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{b();let i=gr();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 d of t)if(!Object.hasOwn(u.cells,d.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${d.key}"`);let l=r+n.length*a,s=`cui-comparison-a${r}-c${a}-n${n.length}`,c=u=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${u}"]`,p=`${c("table")}{display:none}@container (min-width:${F(l)}){${c("table")}{display:block}${c("stack")}{display:none}}`;return J("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(te,{ruleKey:s,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:J("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),J("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:J("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>J("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(d=>L("td",{children:d.cells[u.key]("table")},d.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((u,d)=>{let g=`${i}-column-${d}`;return J("div",{className:"cui-comparison-column",role:"group","aria-labelledby":g,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:g,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(f=>J("div",{children:[L("dt",{children:f.label}),L("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as vr,useCallback as wr,useId as xr,useLayoutEffect as Wt,useRef as Ye}from"react";var le="[data-cui-row-focus]",Je="[data-cui-row-detail]",hr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${le}`)],Gt=(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(le)?(r+=1,n.set(a,r)):r>=0&&a.matches(Je)&&n.set(a,r);return n},Vt=(e,t,n,r)=>{let a=hr(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 Rr,useLayoutEffect as Xe,useReducer as Tr,useRef as je}from"react";var Er=e=>e+1,ue=e=>{let t=je(e),n=je(null),r=je(!1),[,a]=Tr(Er,0),o=Rr((i=>()=>{r.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return Xe(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Xe(()=>{t.current=e}),Xe(()=>{let i=n.current;if(i===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);i.isConnected||!l||t.current(i)?.focus()}),o};import{jsx as S,jsxs as Te}from"react/jsx-runtime";var Pr=new Map,Nr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Cr=(e,t,n)=>{Wt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(Nr)].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 ${Rt} px; use row-control), not <${a.localName}>`)})},kr=(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}`)},Lr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),Sr=(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})})},Mr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:i,rowSize:l,rowDetail:s,empty:c,testId:p,ref:u})=>{b();let d=xr(),g=Ye(null);Cr(g,l,p);let f=Ye(null),m=Ye(Pr),h=ue(R=>Vt(R,g.current,f.current,m.current));Wt(()=>{m.current=Gt(g.current,f.current)});let y=wr(R=>{f.current=R;let E=h(R);return()=>{f.current=null,E()}},[h]),T=xt(n);return kr(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:c}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":d,"data-testid":`${p}-frame`,children:Te("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(T)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:d,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=>Te("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:g,children:r.map(R=>Te(vr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...x(i?.(R)),children:n.map(E=>E.rowHeader===!0?Te("th",{scope:"row","data-cui-align":E.align,children:[E.cell(R),E.rowHeaderNote===void 0?null:Lr(E.rowHeaderNote(R))]},E.key):S("td",{"data-cui-align":E.align,children:E.cell(R)},E.key))}),s===void 0?null:Sr(s,R,n.length,o,h)]},a(R)))})]})})})};import{jsx as Ze,jsxs as $r}from"react/jsx-runtime";var Ir=({items:e,testId:t})=>{if(b(),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 Ze("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>$r("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ze("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ze("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as zt,useLayoutEffect as Jt,useRef as Qe}from"react";import{jsx as ce,jsxs as jt}from"react/jsx-runtime";var Xt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Fr=(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},Ar=(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")},Dr=e=>e instanceof HTMLInputElement&&e.type==="search",Hr=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:i})=>{let{labels:l}=C(),s=zt(),c=zt(),p=Qe(null),u=Qe(null),d=Qe(!1);return Jt(()=>{let y=p.current;if(n&&!y.open){let T=a===void 0?null:Fr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),T!==null&&Ar(y,T)}else!n&&y.open&&y.close()},[n,a]),Jt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Xt(u.current),u.current=null)}},[]),jt("dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:c,"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||(Xt(u.current),u.current=null,n&&r())},onCancel:y=>{let T=d.current;d.current=!1,(T||Re(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let T=We(y);d.current=T,y.key==="Escape"&&!T&&Re(y.target)&&!Dr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{d.current=!1},children:[jt("div",{className:"cui-dialog-header",children:[ce("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),ce("div",{className:"cui-dialog-actions",children:ce(I,{variant:"secondary",testId:`${o}-close`,onClick:()=>p.current?.close(),children:l.close})})]}),t===void 0?null:ce("div",{id:c,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),i,ce("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Be]:"","data-testid":`${o}-announcer`})]})};import{useId as Or,useRef as Ur}from"react";import{jsx as et,jsxs as Yt}from"react/jsx-runtime";var Kr=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{b();let o=Or(),i=Ur(null);return H(i,{testId:r,part:"summary",host:"button"}),Yt("div",{className:"cui-disclosure","data-testid":r,children:[Yt("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:[et("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),et("span",{ref:i,children:e})]}),et("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as _r}from"@aiquants/auth-core";import{Fragment as qr}from"react";import{jsx as Zt}from"react/jsx-runtime";var Br=({tone:e,testId:t,children:n})=>(b(),Zt("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})),pe=({occurrence:e,testId:t,children:n})=>(b(),Zt("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 Qt}from"react/jsx-runtime";var tt=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:i,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let s=e.status===null?null:_r(e.status);return s===null?Qt(pe,{occurrence:e.occurrence,testId:o,children:i.failureSentence(e,r)}):Qt(qr,{children:l({kind:s,place:t,deniedSentence:s==="forbidden"?i.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as q}from"react";import{jsx as Gr}from"react/jsx-runtime";var X=({unavailable:e,id:t,testId:n})=>e?.reason===void 0?null:Gr(P,{as:"p",fg:"fg-muted",type:"body",id:t,testId:`${n}-reason`,children:e.reason});import{Fragment as Qr,jsx as v,jsxs as D}from"react/jsx-runtime";var Vr=/\s/,nt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Vr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},en=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},ne=({description:e,error:t,errorId:n})=>{b();let r=q(),a=q(),o=q(),i=n===void 0?o:qe(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:i].filter(c=>c!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},re=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>D(Qr,{children:[e===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:v(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Ee=({htmlFor:e,hidden:t,children:n})=>v("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Wr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:i,descriptionId:l,errorId:s}=ne({label:e,description:t,error:n,errorId:r});return D("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[v(Ee,{htmlFor:i.id,hidden:void 0,children:e}),o(i),v(re,{description:t,error:n,descriptionId:l,errorId:s,testId:a})]})},tn=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:i,name:l,maxLength:s,list:c,autoComplete:p,inputMode:u,prefix:d,labelHidden:g,required:f,testId:m,ref:h})=>{let{control:y,descriptionId:T,errorId:R}=ne({label:e,description:t,error:n,errorId:r}),E=q();if(d!==void 0&&d.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let w=i==="password",k=v("input",{className:"cui-input",type:i,name:nt(l),maxLength:en(s),value:a,list:c,autoComplete:p,inputMode:u,spellCheck:w?!1:void 0,autoCapitalize:w?"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:h,...y,"aria-describedby":O(d===void 0?void 0:E,y["aria-describedby"])});return D("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[v(Ee,{htmlFor:y.id,hidden:g,children:e}),d===void 0?k:D("div",{className:"cui-input-group",children:[v("span",{className:"cui-input-prefix",id:E,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:d}),k]}),v(re,{description:t,error:n,descriptionId:T,errorId:R,testId:m})]})},zr=e=>v(tn,{...e}),Jr=e=>v(tn,{...e,type:"password"}),Xr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:i,maxLength:l,required:s,testId:c,ref:p})=>{let{control:u,descriptionId:d,errorId:g}=ne({label:e,description:t,error:n,errorId:r});return D("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${c}-field`,children:[v(Ee,{htmlFor:u.id,hidden:void 0,children:e}),v("textarea",{className:"cui-input cui-textarea",name:nt(i),maxLength:en(l),value:a,required:s,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":c,ref:p,...u}),v(re,{description:t,error:n,descriptionId:d,errorId:g,testId:c})]})},jr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,name:l,labelHidden:s,unavailable:c,testId:p,ref:u})=>{let{control:d,descriptionId:g,errorId:f}=ne({label:e,description:t,error:n,errorId:r}),m=q(),h=A(c,m);return D("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[v(Ee,{htmlFor:d.id,hidden:s,children:e}),v("select",{className:"cui-input",name:nt(l),value:a,onChange:y=>{c===void 0&&i(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...d,"aria-disabled":c===void 0?void 0:!0,"aria-describedby":O(d["aria-describedby"],h),children:o.map(y=>v("option",{value:y.value,children:y.label},y.value))}),v(re,{description:t,error:n,descriptionId:g,errorId:f,testId:p}),v(X,{unavailable:c,id:m,testId:p})]})},Yr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,unavailable:l,testId:s,ref:c})=>{let p=q(),{control:u,descriptionId:d,errorId:g}=ne({label:e,description:t,error:n,errorId:r}),f=q(),m=A(l,f);return D("fieldset",{className:"cui-radio-group","aria-describedby":O(u["aria-describedby"],m),"data-invalid":n!==void 0,"data-testid":s,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((h,y)=>D("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:p,value:h.value,checked:h.value===a,onChange:()=>{l===void 0&&i(h.value)},"aria-invalid":u["aria-invalid"],"aria-disabled":l===void 0?void 0:!0,"data-testid":`${s}-option-${h.value}`,ref:y===0?c:void 0}),v("span",{children:h.label})]},h.value)),v(re,{description:t,error:n,descriptionId:d,errorId:g,testId:s}),v(X,{unavailable:l,id:f,testId:s})]})},Zr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:i,unavailable:l,testId:s,ref:c})=>{let{control:p,descriptionId:u,errorId:d}=ne({label:e,description:t,error:n,errorId:r}),g=q(),f=A(l,g),m=o.map(T=>T.value);if(m.length===0||new Set(m).size!==m.length)throw new RangeError(`A check box group needs at least one option with unique values: ${m.join(", ")}`);let h=a.filter(T=>!m.includes(T));if(h.length>0)throw new RangeError(`The chosen values are not options: ${h.join(", ")}`);let y=new Set(a);return D("fieldset",{className:"cui-checkbox-group","aria-describedby":O(p["aria-describedby"],f),"data-invalid":n!==void 0,"data-testid":s,children:[v("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((T,R)=>D("label",{className:"cui-checkbox","data-cui-type":"body",children:[v("input",{type:"checkbox",value:T.value,checked:y.has(T.value),onChange:()=>{l===void 0&&i(m.filter(E=>E===T.value?!y.has(E):y.has(E)))},"aria-invalid":p["aria-invalid"],"aria-disabled":l===void 0?void 0:!0,"data-testid":`${s}-option-${T.value}`,ref:R===0?c:void 0}),v("span",{children:T.label})]},T.value)),v(re,{description:t,error:n,descriptionId:u,errorId:d,testId:s}),v(X,{unavailable:l,id:g,testId:s})]})};import{createContext as eo,useContext as to,useId as sn,useMemo as no}from"react";import{Fragment as cn,jsx as N,jsxs as ve}from"react/jsx-runtime";var dn=eo(null),nn="surface",rn={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"}},on={face:"info-tint",line:"info-accent"},ln={normal:"border-control",high:"info-accent"},ro=["normal","high"],oo=[1,2,3,4],U=M.space["space-2"],ao="fg",io="fg-secondary",un=e=>{let t=to(dn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},rt=(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}`)},so=e=>{b();let t=sn(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:i,children:l}=e;rt(o,"widthPx",r),rt(o,"heightPx",a);let s=no(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),c=ve(cn,{children:[N("defs",{children:ro.map(g=>N("marker",{id:s.arrowIds[g],viewBox:`0 0 ${U} ${U}`,refX:U,refY:U/2,markerWidth:U,markerHeight:U,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":g,children:N("path",{d:`M 0 0 L ${U} ${U/2} L 0 ${U} z`,"data-cui-stroke":ln[g],"data-testid":`${o}-arrow-${g}`})},g))}),N(dn.Provider,{value:s,children:l})]});if(e.kind==="group"){let{label:g,onEscape:f}=e;if(!B(g))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(g)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":g,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":nn,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:f===void 0?void 0:m=>W(m,f),"data-testid":o,...x(i),children:c})})}let{viewBox:p,pointer:u,svgRef:d}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:d,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":nn,"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,...x(i),...u?.handlers,children:c})})},an=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},lo=(e,t,n)=>{for(let r of t){let a=ht.light[r.fg],o=n.find(i=>a[i]===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`)}},uo=e=>{b();let t=un("FigureNode"),n=sn(),{x:r,y:a,shape:o,tone:i,outline:l,selected:s,name:c,title:p,press:u,testId:d,dataAttributes:g}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${d}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${d}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${d}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!B(u.label))throw new RangeError(`${d}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=s?on:rn[i];lo(d,f,[rn[i].face,on.face]);let h,y,T;if(o.kind==="box"){if(c===null)throw new RangeError(`${d}: 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 E=an(d,()=>Tt({name:c,notes:f.map(k=>k.text)}));if(rt(d,"a box's widthPx",o.widthPx),o.widthPx<E.minWidthPx)throw new RangeError(`${d}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${E.minWidthPx} px)`);h={width:o.widthPx,height:E.heightPx,left:r,top:a};let w=Et(f.length);y=ve("g",{"data-cui-surface":m.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:E.heightPx,rx:M.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${d}-plate`}),N("text",{className:"cui-figure-name",x:w.insetPx,y:w.namePx,fontSize:M.type.body.size,"data-cui-fg":ao,"data-cui-figure-type":"body","data-testid":`${d}-name`,children:c}),f.map((k,$)=>N("text",{x:w.insetPx,y:w.notesPx[$],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${d}-note-${$}`,children:k.text},$))]}),T=N("rect",{className:"cui-figure-ring",x:-G,y:-G,width:o.widthPx+2*G,height:E.heightPx+2*G,rx:M.radius["radius-item"]+G,"data-cui-stroke":"focus","data-testid":`${d}-ring`})}else{let E=an(d,()=>vt(c,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},y=ve(cn,{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":`${d}-plate`})}),c===null?null:N("text",{className:"cui-figure-label",x:0,y:E.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":io,"data-cui-figure-type":"caption","data-testid":`${d}-name`,children:c})]}),T=N("circle",{className:"cui-figure-ring",r:o.radiusPx+G,"data-cui-stroke":"focus","data-testid":`${d}-ring`})}if(u!==void 0){if(h.width<Z||h.height<Z)throw new RangeError(`${d}: a pressable node must be at least the ${Z} px target: ${h.width} \xD7 ${h.height}`);if(h.left<Q||h.top<Q||h.left+h.width+Q>t.widthPx||h.top+h.height+Q>t.heightPx)throw new RangeError(`${d}: a pressable node must keep ${Q} 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:E=>{E.currentTarget.focus(),u.onPress()},onKeyDown:E=>{E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),E.repeat||u.onPress())}};return ve("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":i,"data-cui-outline":l,"data-selected":String(s),...R,"data-testid":d,...x(g),children:[p===void 0?null:N("title",{children:p}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${d}-description`,children:u.description}),u===void 0?null:T,y]})},co=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:i})=>{b();let l=un("FigureEdge");if(!oo.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":ln[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...x(i),children:a===void 0?null:N("title",{children:a})})};import{jsx as fo}from"react/jsx-runtime";var po={1:"h1",2:"h2",3:"h3"},yo=({level:e,type:t,testId:n,headingRef:r,children:a})=>{b();let o=po[e];return fo(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 bo}from"react/jsx-runtime";var mo={removed:"danger-tint",added:"success-tint"},go=({kind:e,testId:t,children:n})=>{if(b(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return bo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":mo[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as To}from"react/jsx-runtime";var ho={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"}},Ro={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},ot=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{b();let o=t==="tint"?ho[e]:{fg:"on-solid",surface:Ro[e]};return To("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,...x(r),children:a})};import{useId as Eo}from"react";import{jsx as ye,jsxs as vo}from"react/jsx-runtime";var at=({label:e,valueText:t,value:n,max:r,testId:a})=>{b();let o=Eo();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 i=r===null?null:{max:r,now:Math.min(n,r)};return vo("div",{className:"cui-progress","data-testid":a,children:[ye(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),ye("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":i?.max,"aria-valuenow":i?.now,"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:ye("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),ye("div",{"aria-hidden":"true",children:ye(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as we,jsxs as pn}from"react/jsx-runtime";var wo=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>pn(ze,{title:e,actions:r===void 0?void 0:we(I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[pn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[we("span",{className:"cui-visually-hidden",children:`${e} `}),we(ot,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:we(at,{...n,testId:`${a}-progress`}),o]});import{createContext as xo,useContext as Po}from"react";import{jsx as fe}from"react/jsx-runtime";var it=xo(null),No="space-2",Co=e=>{b();let{gap:t,label:n,id:r,hidden:a,testId:o,children:i}=e;if(n!==void 0&&!B(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,s=l!==void 0,c=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return fe(it.Provider,{value:e.marker,children:fe(c,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?No:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:i})})},ko=({testId:e,dataAttributes:t,children:n})=>{b();let r=Po(it);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return fe("li",{className:"cui-list-item","data-testid":e,...x(t),children:fe("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:fe(it.Provider,{value:null,children:n})})})};import{useCallback as yn,useLayoutEffect as Lo,useRef as xe}from"react";import{jsx as Pe,jsxs as $o}from"react/jsx-runtime";var fn=e=>[...e.querySelectorAll(le)].filter(t=>{let n=t.closest(Je);return n===null||!e.contains(n)}),So=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=fn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${le} elements for ${e.count} rows`);return n},Mo=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Io=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:i})=>{let{formatLocale:l,labels:s}=C(),c=xe(null),p=xe(null),u=xe(null),d=xe(!1),g=()=>{let y=o.ref.current;c.current={shown:new Set(y===null?[]:fn(y)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};Lo(()=>{let y=d.current;d.current=!1;let T=c.current;if(T===null)return;let R=So(o);if(t){T.busySeen=!0,T.shown=new Set(R);return}let E=Mo(R,T.shown),w=r!==null&&r.occurrence!==T.failureOccurrence;if(!(T.busySeen||E!==void 0||w||n)||(c.current=null,w||E===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&E.focus()});let f=ue(()=>n?p.current:u.current),m=yn((y=>{u.current=y;let T=f(y);return()=>{u.current=null,d.current=y===document.activeElement,T()}}),[f]),h=yn((y=>{p.current=y;let T=f(y);return()=>{p.current=null,T()}}),[f]);return n?Pe("div",{className:"cui-load-more","data-testid":i,children:Pe(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):$o("div",{className:"cui-load-more","data-testid":i,children:[Pe(I,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:g,ref:m,testId:`${i}-button`,children:s.loadMore(ge(a,l))}),r===null?null:Pe(pe,{occurrence:r.occurrence,testId:`${i}-failure`,children:s.loadFailed(r.reason)})]})};import{jsx as st,jsxs as mn}from"react/jsx-runtime";var Fo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{b();let o=wt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return mn("div",{className:"cui-container","data-testid":a,children:[st(te,{ruleKey:o.key,css:o.css}),mn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[st("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),st("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Ne}from"react/jsx-runtime";var Ce=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:i,unit:l}=e;if(l!==void 0&&!B(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(i===null)return Ne("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let s=ge(i,t);return Ne("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:gt(s,l)})}let{text:a,keep:o}=e;if(a===null)return Ne("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!B(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 Ne("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as ke,jsxs as Do}from"react/jsx-runtime";var Ao=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(b(),!(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 Do("span",{className:"cui-meter","data-testid":o,children:[ke("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:ke("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),ke("span",{"aria-hidden":"true",children:ke(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Ho,useRef as Oo}from"react";import{jsx as dt,jsxs as Bo}from"react/jsx-runtime";var Uo={ArrowLeft:-1,ArrowRight:1},Ko=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:i})=>{b();let l=Ho(),s=Oo(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let c=t.map(m=>m.id);if(new Set(c).size!==c.length)throw new RangeError(`Tab keys must be unique: ${c.join(", ")}`);let p=c.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${c.join(", ")}`);let u=m=>`${l}-tab-${m}`,d=`${l}-panel`,g=m=>{let h=t[m];h.id!==n&&r(h.id),s.current.get(h.id)?.focus()};return Bo("div",{className:"cui-panel-tabs","data-testid":a,children:[dt("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let h=t.findIndex(E=>s.current.get(E.id)===m.target),y=h<0?p:h,T=Uo[m.key],R;if(T!==void 0){let E=getComputedStyle(m.currentTarget).direction==="rtl"?-T:T;R=(y+E+t.length)%t.length}else if(m.key==="Home")R=0;else if(m.key==="End")R=t.length-1;else return;m.preventDefault(),g(R)},children:t.map((m,h)=>{let y=h===p;return dt("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":d,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:T=>{T===null?s.current.delete(m.id):s.current.set(m.id,T)},onClick:()=>g(h),children:m.label},m.id)})}),dt("div",{role:"tabpanel",id:d,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};import{accessFailureKindOfStatus as _o}from"@aiquants/auth-core";import{jsx as lt,jsxs as Go}from"react/jsx-runtime";var qo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:i}=C(),l=lt(tt,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?i.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_o(e.status)!==null?lt("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Go("div",{className:"cui-resource-failed","data-testid":o,children:[l,lt(I,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};import{useId as gn}from"react";import{jsx as K,jsxs as bn}from"react/jsx-runtime";var Vo=({label:e,options:t,value:n,onValueChange:r,unavailable:a,testId:o,density:i="regular"})=>{b();let l=gn(),s=gn(),c=A(a,s),p=d=>{a===void 0&&d!==n&&r(d)},u=new Set(t.map(d=>d.value));if(t.length<2||u.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(d=>d.value).join(", ")}`);if(!u.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...u].join(", ")}`);if(i!=="regular"&&i!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(i)}`);return i==="compact"?bn("fieldset",{className:"cui-segmented-group","aria-labelledby":l,"aria-describedby":c,"data-cui-density":"compact","data-testid":o,children:[K("span",{className:"cui-segmented-label",id:l,"data-cui-type":"caption",children:e}),K("div",{className:"cui-segmented",children:t.map(d=>{let g=d.value===n;return K("button",{className:"cui-segment",type:"button","aria-pressed":g,"aria-disabled":a===void 0?void 0:!0,"data-testid":`${o}-${d.value}`,onClick:()=>p(d.value),children:K("span",{className:"cui-segment-face","data-cui-fg":g?"on-solid":"fg","data-cui-surface":g?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${o}-${d.value}-face`,children:d.label})},d.value)})}),K(X,{unavailable:a,id:s,testId:o})]}):bn("fieldset",{className:"cui-segmented-group","aria-describedby":c,"data-testid":o,children:[K("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),K("div",{className:"cui-segmented",children:t.map(d=>{let g=d.value===n;return K("button",{className:"cui-segment",type:"button","aria-pressed":g,"aria-disabled":a===void 0?void 0:!0,"data-cui-fg":g?"on-solid":"fg","data-cui-surface":g?"info-solid":void 0,"data-cui-type":"body","data-testid":`${o}-${d.value}`,onClick:()=>p(d.value),children:d.label},d.value)})}),K(X,{unavailable:a,id:s,testId:o})]})};import{useCallback as Wo,useRef as zo}from"react";import{jsx as j}from"react/jsx-runtime";var hn=e=>{let t=zo(null),n=Wo(r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},Rn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:i,children:l})=>{b();let{row:s,bindRow:c}=hn(o);H(s,{testId:r,part:"row",host:"button"});let p=u=>{ie(u),n()};return j("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":V(i,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p,ref:c,...x(a),children:l})},Jo=({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:i,children:l})=>{b();let{row:s,bindRow:c}=hn(o);H(s,{testId:r,part:"row",host:"link"});let p=u=>{ie(u),ee(u,e,n)};return j("a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":V(i,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p,ref:c,...x(a),children:l})},Xo=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:i,rowTestId:l,rowData:s,empty:c,testId:p,ref:u})=>(b(),j("div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?j(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:c}):j("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(d=>{let g=n(d);return j("li",{children:j(Rn,{selected:g===r,controls:o,onSelect:()=>a(d),testId:l,dataAttributes:s?.(d),children:i(d)})},g)})})}));import{useId as jo}from"react";import{jsx as Le,jsxs as Tn}from"react/jsx-runtime";var Yo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:i,testId:l})=>{b();let s=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 c=o(t);return Tn("div",{className:"cui-field","data-testid":`${l}-field`,children:[Le("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),Tn("div",{className:"cui-slider",children:[Le("input",{className:"cui-slider-input",id:s,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":c,"data-testid":l,onChange:p=>i(p.currentTarget.valueAsNumber)}),Le("span",{className:"cui-slider-value","aria-hidden":"true",children:Le(P,{fg:"fg",type:"body",testId:`${l}-value`,children:c})})]})]})};import{jsx as ut,jsxs as vn}from"react/jsx-runtime";var En={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}},Qo=({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,i)=>i>0&&En[o.state]<En[t[i-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 ut("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,i)=>{let l=Zo[o.state],s=a[o.state];return vn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[ut("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":i+1}),vn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:ut("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};import{useId as ea,useRef as ta}from"react";import{jsx as Se,jsxs as wn}from"react/jsx-runtime";var na=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:i,dataAttributes:l})=>{b();let s=ea(),c=ta(null);H(c,{testId:o,part:"label",host:"button"});let p=A(a,s),u=a!==void 0,d=wn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":O(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{u||r(!n)},...x(l),children:[Se("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Se("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Se("span",{className:t===!0?"cui-visually-hidden":void 0,ref:c,children:e})]});return a?.reason===void 0?d:wn("span",{className:"cui-button-group",children:[d,Se(P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as ra,useEffect as oa,useId as aa,useRef as xn,useState as ia}from"react";import{jsx as me,jsxs as Pn}from"react/jsx-runtime";var sa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(b(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.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: ${[...i].join(", ")}`);let[s,c]=ia(!1),p=xn(null),u=xn(null),d=aa(),g=ra(f=>{c(!1),f&&p.current?.contains(document.activeElement)&&u.current?.focus()},[]);return oa(()=>{if(!(o&&s))return;let f=y=>p.current!==null&&!p.current.contains(y),m=y=>{f(y.target)&&g(!0)},h=y=>{f(y.target)&&g(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",h,!0)}},[o,s,g]),Pn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>W(f,()=>g(!0)):void 0,children:[o?Pn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":d,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>c(f=>!f),children:[me("span",{className:"cui-tabs-summary-label",children:l.label}),me("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,me("ul",{className:"cui-tabs-list",id:d,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return me("li",{className:"cui-tabs-item",children:me("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:h=>{ee(h,f.href,r),h.defaultPrevented&&g(!1)},children:f.label})},f.id)})})]})};import{Children as da,Fragment as la,isValidElement as ua}from"react";import{jsx as Y,jsxs as Cn}from"react/jsx-runtime";var ca={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},pa=e=>{b();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 Cn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...x(o),children:[Y("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),Y("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),Y("p",{className:"cui-tile-value","data-cui-fg":ca[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?Y(Ce,{value:e.value,unit:e.unit,testId:l}):Y(Ce,{text:e.text,keep:"wrap",testId:l})})]})},Nn=e=>da.toArray(e).flatMap(t=>{if(!ua(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===la?Nn(t.props.children):[t]}),ya=({count:e,minInlinePx:t,testId:n,children:r})=>{b();let a=Pt(e,t,M.space["space-2"]),o=Nn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return Cn("div",{className:"cui-container","data-testid":n,children:[Y(te,{ruleKey:a.key,css:a.css}),Y("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as fa,useRef as kn}from"react";import{jsx as ga}from"react/jsx-runtime";var Me=e=>[...e.querySelectorAll("button")],ma=({label:e,testId:t,children:n})=>{b();let r=kn(null),a=kn(null);fa(()=>{let s=Me(r.current),c=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=c;for(let p of s)p.tabIndex=p===c?0:-1});let o=s=>{for(let c of Me(r.current))c.tabIndex=c===s?0:-1;a.current=s};return ga("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:s=>{let c=Me(s.currentTarget).find(p=>p.contains(s.target));c!==void 0&&o(c)},onKeyDown:s=>{let c=Me(s.currentTarget),p=c.indexOf(s.target);if(p===-1)return;let u=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",d=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(p+1)%c.length,[d]:(p-1+c.length)%c.length,Home:0,End:c.length-1}[s.key];if(f===void 0)return;s.preventDefault();let m=c[f];o(m),m.focus()},children:n})};import{useState as ba}from"react";var ha=e=>{let[t,n]=ba({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 oe,useEffect as Ea,useLayoutEffect as Sn,useRef as yt}from"react";import{useCallback as Ie,useEffect as Ra,useLayoutEffect as Ta,useRef as ct,useState as pt}from"react";var Ln=e=>e===null?De:He,$e=(e,t,n,r,a)=>{let[o,i]=pt(()=>({key:e,state:Ln(e)})),[l,s]=pt(0),[c,p]=pt(0),u=ct(t),d=ct(null),g=ct(l);Ta(()=>{u.current=t}),Ra(()=>{if(e===null){i({key:null,state:De});return}let R=new AbortController;d.current=e;let E=l===g.current?"revision":"reload";return g.current=l,i(w=>Object.is(w.key,e)?{key:e,state:r(w.state,E)}:{key:e,state:He}),u.current(R.signal).then(w=>{R.signal.aborted||(d.current=null,i(k=>({key:e,state:a(k.state,w)})))},w=>{R.signal.aborted||i(()=>{throw w})}),()=>{R.abort(),d.current=null}},[e,n,l,c]);let f=Ie(()=>s(R=>R+1),[]),m=Ie(()=>p(R=>R+1),[]),h=Ie((R,E)=>{i(w=>Object.is(w.key,R)?{key:R,state:E(w.state)}:w)},[]),y=Ie((R,E)=>{h(R,E),Object.is(d.current,R)&&m()},[h,m]);return{state:Object.is(o.key,e)?o.state:Ln(e),reload:f,refresh:m,update:h,write:y}};var va=(e,t,n)=>{let r=yt(t);Sn(()=>{r.current=t});let a=oe(y=>r.current.first(y),[]),{state:o,reload:i,refresh:l,update:s,write:c}=$e(e,a,n,Ct,kt),p=yt({key:e,state:o});Sn(()=>{p.current={key:e,state:o}});let u=yt(null),d=oe(()=>{u.current?.controller.abort(),u.current=null},[]);Ea(()=>d,[e,n,d]);let g=oe(()=>{d(),i()},[d,i]),f=oe(()=>{d(),l()},[d,l]),m=oe(()=>{let{key:y,state:T}=p.current;if(y===null||T.kind!=="ready"||T.refreshing||T.value.next===null||T.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=T.value.next,E={key:y,controller:new AbortController,maps:[]};u.current=E,s(y,Lt),r.current.next(R,E.controller.signal).then(w=>{u.current===E&&(u.current=null,s(y,k=>E.maps.reduce(($,ae)=>Ue($,ae),St(k,R,w))))},w=>{u.current===E&&s(y,()=>{throw w})})},[s]),h=oe((y,T)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(T),c(y,E=>Ue(E,T))},[c]);return{state:o,reload:g,refresh:f,loadMore:m,updateList:h}};import{useCallback as wa,useRef as xa,useState as Pa}from"react";var Na=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ca=()=>{let[e,t]=Pa(null),n=xa(null),r=wa((a,o)=>{let i=o();if(!Na(i))return;let l=Symbol(a);n.current=l,t(a);let s=()=>{n.current===l&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:r}};import{useCallback as ka}from"react";var La=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:i}=$e(e,t,n,Nt,Oe),l=ka((s,c)=>i(s,p=>Oe(p,{ok:!0,value:c})),[i]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as Ma}from"react/jsx-runtime";var Sa=({testId:e,children:t})=>(b(),Ma("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{be as ANNOUNCE_SETTLE_MS,ar as AccessFailureNotice,pe as AlertMessage,ir as Breadcrumb,I as Button,Rt as COMPACT_ROW_PX,Ba as CONSOLE_UI_LABEL_CATALOGS,Ga as CONTRAST_MINIMUM,ht as CONTRAST_PAIRS,ze as Card,pr as CardSection,Zr as CheckboxGroup,Ve as Cluster,fr as CodeBlock,br as ComparisonGrid,Un as ConsoleUiRoot,Mr as DataTable,Ir as DescriptionList,Hr as Dialog,Kr as Disclosure,Q as FIGURE_RING_REACH_PX,ei as FLEXIBLE_COLUMN_MIN_PX,tt as FailureMessage,Wr as Field,so as Figure,co as FigureEdge,uo as FigureNode,Zn as FragmentLink,li as HTTP_FORBIDDEN,yo as Heading,go as InlineChange,wo as JobCard,Ae as LATTICE_PX,jn as Link,Co as List,ko as ListItem,Io as LoadMore,Va as MORE_CONTRAST_MINIMUM,Fo as MasterDetail,Ce as Measured,Ao as Meter,pa as MetricTile,Br as Notice,Ko as PanelTabs,Jr as PasswordInput,ot as Pill,at as ProgressBar,za as ROW_WITH_CONTROL_PX,Yr as RadioGroup,qo as ResourceFailed,Rn as RowButton,Jo as RowLink,Vo as SegmentedControl,jr as Select,Xo as SelectableList,Yo as Slider,er as Stack,Qo as Stepper,na as Switch,Z as TARGET_PX,M as TOKENS,gi as TONES,fi as TONE_HUES,mi as TONE_ROLES,sa as Tabs,P as Text,Xr as TextArea,zr as TextInput,ya as TileGrid,ma as Toolbar,Sa as VisuallyHidden,Aa as ZonedTimeError,Lt as beginPage,Ct as beginPagedReload,Nt as beginReload,Ya as ceil8,Wa as ceilToLattice,Za as cellContentInlinePx,ti as comparisonAttributePx,qa as contrastRatio,ri as countSampleText,Ja as cssVar,Tt as figureBoxPlan,vt as figureDiscLabelPlan,Ua as fillLabel,Qa as fixedColumnPx,ci as flatMapOutcome,Ia as formatByteSize,ge as formatCount,Oa as formatInstant,ii as goldenSectionPx,_a as hexToSrgb,ni as instantSampleText,B as isReadableText,Oe as keepLastGood,pi as lightDark,ui as mapOutcome,Ue as mapPagedList,si as masterDetailPlan,ja as monoTextWidthEm,yi as placeholderRule,F as pxToRem,$a as readDecimalText,Fa as readIntegerText,Ka as reasonAside,bt as resolveConsoleUiLabels,kt as settleFirstPage,St as settlePage,ai as spacedTextWidthEm,di as tableFrameMinInlinePx,xt as tableMinInlinePx,Xa as textWidthEm,Pt as tileGridPlan,oi as tileMinInlinePx,Da as toOffsetIso,Ha as toWallTime,mt as topmostModalOf,Kn as useAccessFailure,_e as useAnnounce,C as useConsoleUi,ur as useEscapeToClose,ha as useFailureOccurrence,ue as useFocusRescue,va as usePagedResource,Ca as usePendingPress,La as useResource};
@@ -710,9 +710,19 @@
710
710
  text-align: end;
711
711
  }
712
712
 
713
+ /* 働けない操作は焦点を保つので、押しても何も起きないことを指し示しの形で先に知らせる。丸の印と選択の箱の選択肢は名札が的なので、
714
+ 名札の全体と印に当てる */
713
715
  .cui-button[aria-disabled="true"],
714
716
  .cui-switch[aria-disabled="true"],
715
- .cui-input[aria-disabled="true"] {
717
+ .cui-input[aria-disabled="true"],
718
+ .cui-segment[aria-disabled="true"],
719
+ :is(.cui-radio, .cui-checkbox) > input[aria-disabled="true"] {
720
+ cursor: not-allowed;
721
+ }
722
+
723
+ /* :has() を解さないエンジン (Firefox 121 より前) は選択子の並びごと規則を捨てるので、名札の選択子は 1 つだけの規則に分け、
724
+ 上の規則を巻き込まない */
725
+ :is(.cui-radio, .cui-checkbox):has(> input[aria-disabled="true"]) {
716
726
  cursor: not-allowed;
717
727
  }
718
728
 
@@ -1724,11 +1734,18 @@
1724
1734
 
1725
1735
  /* 対話: 枠 1 と、枠の幅を引いた余白 23 (枠と余白の和 24 が格子に乗る) の容器。幅は 40 字の段落 (WCAG 1.4.8) と両側の 24 の和
1726
1736
  (--cui-measure-dialog。ホストが同じ外の幅の箱を作る時も同じ変数を使う) 以下で、表示域から左右 24 ずつを除いた幅を超えない。見出しは
1727
- カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる) */
1737
+ カードの見出しの規則を共にする (題の行 28 に閉じるボタン 44 を中央で揃え、上下 −8 で重ねる)。
1738
+ 置き場所と高さの上限は UA の既定に任せない。中央に置く UA の margin: auto は、cui より下の層に置かれたホストのリセット (全ての要素の
1739
+ margin を 0 にするもの) が消すので宣言し直す。UA の高さの上限 calc(100% - 6px - 2em) は格子を外れるので、包含ブロックから上下 24 ずつを
1740
+ 除いた高さを格子へ切り下げる (上下の余りは 24 以上 26 未満で、外向きの焦点の輪が表示域の縁で切れない)。モーダルの包含ブロックは
1741
+ 表示域からスクロールバーを除いた箱で、百分率はそれを読むので、古典的な横のスクロールバーの出た頁でも余りは 24 を保つ (表示域の単位は
1742
+ スクロールバーを数えないので、帯の分だけ余りが減る)。百分率は長さへ解けるので、round() の引数の型は揃う */
1728
1743
  .cui-dialog {
1729
1744
  box-sizing: border-box;
1730
1745
  inline-size: var(--cui-measure-dialog);
1731
1746
  max-inline-size: calc(100% - 2 * var(--cui-space-6));
1747
+ max-block-size: round(down, 100% - 2 * var(--cui-space-6), var(--cui-space-1));
1748
+ margin: auto;
1732
1749
  padding: calc(var(--cui-space-6) - var(--cui-border-width));
1733
1750
  border: var(--cui-border-width) solid var(--cui-border-subtle);
1734
1751
  border-radius: var(--cui-radius-container);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -59,13 +59,16 @@
59
59
  ],
60
60
  "author": "AI Quants",
61
61
  "license": "MIT",
62
+ "dependencies": {
63
+ "@aiquants/input-method": "^0.1.0"
64
+ },
62
65
  "peerDependencies": {
63
66
  "@aiquants/auth-core": "^0.9.0",
64
67
  "react": ">=19",
65
68
  "react-dom": ">=19"
66
69
  },
67
70
  "devDependencies": {
68
- "@aiquants/auth-core": "0.9.2",
71
+ "@aiquants/auth-core": "0.9.3",
69
72
  "@testing-library/jest-dom": "^6.9.1",
70
73
  "@testing-library/react": "^16.3.2",
71
74
  "@testing-library/user-event": "^14.6.1",
@@ -74,6 +77,7 @@
74
77
  "@types/react-dom": "^19.2.3",
75
78
  "@vitest/coverage-v8": "^4.1.8",
76
79
  "jsdom": "^27.4.0",
80
+ "playwright": "^1.64.1",
77
81
  "postcss": "^8.5.6",
78
82
  "react": "^19.2.7",
79
83
  "react-dom": "^19.2.7",
@@ -84,7 +88,7 @@
84
88
  "vitest": "^4.1.10"
85
89
  },
86
90
  "engines": {
87
- "node": ">=18.0.0",
91
+ "node": ">=18.17.0",
88
92
  "pnpm": ">=8.0.0"
89
93
  },
90
94
  "publishConfig": {