@aiquants/console-ui 0.7.0 → 0.7.2

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
@@ -137,7 +137,7 @@ A console has exactly one root: a `ConsoleUiRoot` rendered inside another one th
137
137
  The root sets no font property: host content inside the root keeps its own font family, size, weight and line height, and inherits only the root's text colour (the `fg` role) and the `--cui-*` variables, drawn over the root's `surface` background. The package's body type (13/20) and sans face are declared by `Card` for what is drawn in it.
138
138
  The root declares no `color-scheme` either: every colour is a `light-dark()` pair, so the palette follows the scheme the root inherits. A host with its own light and dark modes binds them to `color-scheme` (`html { color-scheme: light; }` and `html.dark { color-scheme: dark; }`), so the console and the host never show different schemes; `color-scheme: light dark` on `:root` would follow the operating system instead and can disagree with the host's own switch.
139
139
 
140
- Every component that renders an element throws outside the root, because the token variables and the colour roles are scoped to the root's DOM and would not reach it; the hooks `useFocusRescue`, `useEscapeToClose`, `useResource` and `usePagedResource` do not need the root. For the same reason an overlay must render inside the root's DOM, not in a portal to `<body>`: a portal keeps the React context but loses every `--cui-*` variable.
140
+ Every component that renders an element throws outside the root, because the token variables and the colour roles are scoped to the root's DOM and would not reach it; the hooks `useFocusRescue`, `useEscapeToClose`, `useFailureOccurrence`, `useResource` and `usePagedResource` do not need the root. For the same reason an overlay must render inside the root's DOM, not in a portal to `<body>`: a portal keeps the React context but loses every `--cui-*` variable.
141
141
  Draw a modal as a `Dialog`: a modal `<dialog>` (`showModal()`) makes everything outside it inert, the live region of every root included, so `Dialog` holds a live region of its own, which takes the announcements of every console on the page while it is the topmost open modal (see Focus and announcements).
142
142
  Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a popover placed in the tree. A modal that is not a `Dialog` and does not contain the console, or a host's `inert` or `aria-hidden="true"` on the console, hides the announcer: a write to it then throws instead of being dropped; announce after that modal closes.
143
143
 
@@ -148,16 +148,16 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
148
148
  - type steps of round(16 × 1.25^k) px, never below 11 px, each line the smallest lattice multiple at or above 1.5 times its size (WCAG 1.4.8; `title`, beside controls, and `prose`, the reading line, at 1.75): `caption` 11/20, `body` 13/20, `prose` 13/24, `body-lg` 16/24 (the body of a surface read at length, such as a conversation or an article: the 16 px base step with the 1.5 line), `title` 16/28, `heading` 20/32, `display` 25/40, `display-lg` 31/48;
149
149
  - the 44 px target (`TARGET_PX`: a `body` line with 12 px above and below), which is also the height of a control and of a table row (`size-target`, `size-control`, `size-row`), the 52 px row that holds a control (`ROW_WITH_CONTROL_PX`: the target with one lattice unit above and below, `size-row-control`) and the 28 px compact row of a read-only line table (`COMPACT_ROW_PX`: a `body` line with one lattice unit above and below, `size-row-compact`);
150
150
  - motion of 120, 180 and 270 ms (`motion-1` … `motion-3`, 120 × 1.5^(k − 1)).
151
- Only `body` (20) and `title` (28) lines, whose difference from 44 is a multiple of 8, can be centred in a 44 px box on the lattice, so every control draws its text in `body` or `title`.
151
+ Only the 20 px lines (`caption` and `body`) and the 28 px `title` line, whose difference from 44 is a multiple of 8, can be centred in a 44 px box on the lattice, and every control draws its text in `body` or `title`, except a compact `SegmentedControl` (a band of supplementary controls), whose 28 px faces draw `caption` text inside 44 px targets.
152
152
  - The token variables are declared on `[data-cui-root]` (never `:root`) with lengths in rem, the strokes (`border-width` 1, `focus-width` 2, `focus-offset` 2, `marker-width` 2) in px and the durations in ms. A browser snaps a used border width down to whole device pixels, so a rem stroke would leave the paddings that compensate for the border (`calc(… - var(--cui-border-width))`) off the lattice for a reader who enlarges the root font size; in px every lattice measure scales exactly with the root font size around a 1 px border.
153
153
  - Every duration is read from the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion (`prefers-reduced-motion: reduce`), so a component that moves stops without a rule of its own; no rule writes a duration by hand, and the indeterminate progress segment sweeps only for a reader who allows motion.
154
154
  - Text and surface colours are applied through role attributes only. `data-cui-fg` paints text, `data-cui-surface` paints the surface text sits on, `data-cui-accent` paints non-text graphics, `data-cui-fill` paints the surface of a figure's shape (always the surface of the shape's group, which its text is measured on) and `data-cui-stroke` a figure's lines. Every role has a light and a dark value, written as `light-dark(<light>, <dark>)` (see Wrapping a console for the scheme). `CONTRAST_PAIRS.light` and `CONTRAST_PAIRS.dark` list the same pairs: for every role,
155
155
  the surfaces it may be drawn on with the WCAG 2 ratio on each in that scheme.
156
156
  Every pair meets AAA (`CONTRAST_MINIMUM`: 7 for text, 4.5 for large text, 3 for non-text; the lowest text and non-text ratios are 7.12 and 3.47 in the light scheme, 9.29 and 5.54 in the dark one), and a pair not in the table is never drawn. `Text` is the only component that paints caller text, and it paints only through a text role.
157
- - The remaining colours are fixed non-text graphics, each drawn against listed surfaces of `CONTRAST_PAIRS`: the control border (`border-control`) of inputs, secondary buttons, segments and the switch's track, the slider's rail and a pending step's ring, the invalid border (`danger-accent`), the selected-row band, the radio mark, the current tab's marker and the slider's thumb (`info-accent`), and the focus ring (`focus`).
157
+ - The remaining colours are fixed non-text graphics, each drawn against listed surfaces of `CONTRAST_PAIRS`: the control border (`border-control`) of inputs, secondary buttons, segments (a compact segment's face) and the switch's track, the slider's rail and a pending step's ring, the invalid border (`danger-accent`), the selected-row band, the radio mark, the current tab's marker and the slider's thumb (`info-accent`), and the focus ring (`focus`).
158
158
  A figure's lines are the same roles (see Figures): a node's plate line on both the figure's `surface` and its own face (`border-control` on `surface` 4.76 / 6.78; `info-accent` 5.25 / 6.76 and 4.82 / 5.6 on `info-tint`; `success-accent` 3.65 / 9.2 and 3.47 / 7.83; `warning-accent` 5.03 / 10.4 and 4.85 / 8.75; `danger-accent` 4.77 / 6.17 and 4.36 / 5.6, light / dark), an edge and its arrowhead (`border-control`, or `info-accent` when strong) and a node's focus ring (`focus`, 5.25 / 6.76) on `surface`. A figure's text takes its text role's colour as its fill (`currentColor`,
159
159
  in that one declaration only).
160
- The solid buttons', the pressed segment's and the checked switch track's border is their own fill, and the rules of cards, tables, comparison headings, description lists and dialogs (`border-subtle`) are decorative, never a component's only boundary. A switch's thumb stands out from its track by at least 3 : 1 in both schemes.
160
+ The solid buttons', the pressed segment's (a compact segment's pressed face's) and the checked switch track's border is their own fill, and the rules of cards, tables, comparison headings, description lists and dialogs (`border-subtle`) are decorative, never a component's only boundary. A switch's thumb stands out from its track by at least 3 : 1 in both schemes.
161
161
  - The tone table (`TONES`) is for a host that colours by hue outside the components (a category, a tag, a person, a kind of record); the components paint only with the roles above.
162
162
  It holds seventeen hues (`TONE_HUES`: indigo, violet, purple, fuchsia, pink, rose, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky and blue, each Tailwind CSS's family of that name) with six roles each (`TONE_ROLES`): the text `fg`, the tinted surface `tint`, the mark `accent` (a status dot, a bar, the ring of a selected item), the decorative line `line`, the solid fill under `on-solid` text `solid` and its hover `solid-hover`.
163
163
  In both schemes every tone's text keeps 7:1, and every tone's mark, `focus` and `border-control` keep 3:1, on `surface`, `subtle`, `sunken` and every tone's tint; every neutral text keeps 7:1 on every tint; and `on-solid` keeps 7:1 on every solid and its hover. The line is decorative, never a component's only boundary, and nothing in the table is translucent.
@@ -165,7 +165,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
165
165
  A host writes a role into an inline style as `lightDark(TONES.blue.fg)` (`light-dark(#193cb8, #bedbff)`; `lightDark` refuses a value that is not `#rrggbb`, and the stylesheet's token variables are written through it), or reads one scheme's value, `TONES.blue.fg.light`, where `light-dark()` cannot be resolved (a canvas).
166
166
  - An inline style cannot reach a field's placeholder, and a browser's own placeholder colour, or a reset's translucent one, falls below 7:1. A host that paints its fields inline writes `placeholderRule("data-my-console")` into a `<style>` element and puts that attribute on its root: every placeholder under the root takes `fg-muted` at full opacity, and the host's other fields are not reached. The attribute is lowercase letters, digits and hyphens, starting with a letter; any other name is refused.
167
167
  - In forced-colors mode (Windows high contrast), which removes surfaces, shadows and backgrounds and paints transparent borders, the package redraws its non-colour cues in system colours: the selected row's start band (`Highlight`), the progress and meter tracks and fills (`CanvasText` / `Highlight`), the current tab's marker (`Highlight`, the other tabs' markers sunk into `Canvas`), the switch's thumb (`CanvasText`, `HighlightText` on a `Highlight` track when on), the slider's rail and thumb (`CanvasText` / `Highlight`),
168
- and the pressed segment and the current step's marker (`Highlight` with `HighlightText`); a figure's surfaces are redrawn in `Canvas` and its lines and arrowheads in `CanvasText`, with a selected plate, a focus ring and a strong edge and its arrowhead in `Highlight` (their widths and dashes stay), while its text keeps the forced `CanvasText`.
168
+ and the pressed segment (a compact segment's face, whose target stays transparent) and the current step's marker (`Highlight` with `HighlightText`); a figure's surfaces are redrawn in `Canvas` and its lines and arrowheads in `CanvasText`, with a selected plate, a focus ring and a strong edge and its arrowhead in `Highlight` (their widths and dashes stay), while its text keeps the forced `CanvasText`.
169
169
  The band is the row's own inline-start border, taken out of its inline-start padding (the row's box and text stay where an unselected row has them, and the band stays at the start in a right-to-left root). The focus ring sets only `outline`, so a selected row that has focus keeps its band.
170
170
  Every rule is a border (the cell's own bottom border, taken out of the cell's bottom padding; no rule is drawn as a shadow, which forced colours remove), so it stays in the forced `CanvasText` with no rule of its own, and nothing is positioned for forced colours, so the focus rings of rows and of controls in cells stay whole.
171
171
  - A console scans its own rendered DOM with `scanColourRoles(root, { exclude })` from `@aiquants/console-ui/testing`, the same oracle the package runs on its components: for each text node it reads the nearest `data-cui-fg` and `data-cui-surface` and looks the pair up in `CONTRAST_PAIRS` (both schemes list the same pairs), and it fails a text with no role, a pair not in the table, and any inline paint declaration from the text up to its farther role element
@@ -206,6 +206,8 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
206
206
  In a table whose rows hold controls (`rowSize="row-control"`, 52 px rows: 4 + 44 + 3 + 1) the cells are centred, which puts a one-line text on the centre line of a one-line bordered button's label. Size the button column so the label fits on one line (its width + 24 px padding + 2 px border): a label that wraps to k lines makes the button 24 + 20k px and the row 32 + 20k px, and its centred lines no longer share the text's line.
207
207
  This also holds only for buttons that do not draw an `unavailable` reason: a button with `unavailable: { reason }` belongs in card actions or a `Cluster`, because its reason is drawn beside it in `body` (13/20) and wraps under it in a narrow cell. The buttons, switches and selects of a table's rows name one visible reason the caller draws outside the table instead (`unavailable: { reasonId }`).
208
208
  - Controls size by `box-sizing: border-box` whatever the host's reset: a text input, a select, a one-line bordered button and a segment are all 44 px high (1 + 11 + 20 + 11 + 1), a bordered label that wraps to k lines is 24 + 20k px, and a text area of k rows is 24(k + 1) px (1 + 11 + 24k + 11 + 1), never the height of a one-line field.
209
+ - A compact `SegmentedControl` (`density="compact"`) is one 44 px line for a band of supplementary controls: its `caption` label (regular weight, a 20 px line 12 px from the line's top and bottom) sits 8 px (`space-2`) before the options, and each option is a bare target at least 44 × 44 holding a 28 px face (a `caption` line with a `Pill`'s 4 px and 8 px padding, the 1 px border taken out of it, so the face is as wide as a `Pill` of the same text), 8 px from the target's top and bottom.
210
+ When the label does not fit beside the options, the options go below it with no gap (20 + 44 = 64 px, the face 8 px below the label); k rows of options make 20 + 48k − 4 px, and a face whose text wraps to m lines makes its target max(44, 8 + 20m) px high.
209
211
  - A `RowButton` is `body` text with 12 px of block padding, so a one-line row is the 44 px target. Its direct children are lines 4 px apart (the reach of a `Pill` beyond the 20 px line it sits on), each keeping its own type step's line, so a row of k `body` lines is 20 + 24k px and a row mixing a `title` name and `body` lines stays on the lattice.
210
212
  - `Cluster as="span"` is the phrasing form of `Cluster` for a group of labels inside a control: an inline-flex `span` with the same gap tokens, aligned to the top of its line and never wider than its container, so a one-row group of pills and measured values keeps a 20 px line 20 px high (a `RowButton` line, a `Button` label, a `Disclosure` summary), and k wrapped rows with gap g are 20k + g(k − 1) px.
211
213
  - A `Pill` is 28 px high (a `caption` line with 4 px above and below): in a 44 px control or row it sits 8 px from each edge, and on a `body` line it overlaps the line by 4 px above and below (negative block margins), so its box is centred on the line and the line stays 20 px. Lines stacked next to a line of pills therefore need 4 px between them (a `RowButton` keeps them apart), and pills that may wrap onto several lines belong in a `Cluster` with a gap of at least `space-2`, whose wrapped rows keep the 28 px boxes apart (pills inline in one run of text overlap by 8 px when the run wraps).
@@ -337,6 +339,9 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
337
339
  ```
338
340
 
339
341
  `failure` carries its `occurrence`, a number that advances with every failure shown (a `ResourceFailure` carries it; a screen counts its own command's failures), and both the presenter's node and the `AlertMessage` are keyed by it, so the same failure again is mounted and read again.
342
+ `useFailureOccurrence(failure)` counts the failures of a component that holds failure objects of its own (a loader's failure, the refusal a command answered, a failure in its own state): the number is `0` before any failure, advances in the render that brings a failure object other than the last one counted, compared by identity, so the same contents in a new object are the next failure (and so is an object counted before the last one), and stays while that object is re-rendered.
343
+ `null` (no failure) counts nothing and keeps the last number and the last object, so the last object handed again after `null` is the same failure.
344
+ The number advances before the commit, so no commit shows a new failure under the old number, and StrictMode's second render counts nothing more. The host hands a new object for each failure and the same object while it holds that failure, and the number keys what the component draws itself for the failure: the `occurrence` of a failure it hands `FailureMessage`, an `AlertMessage`, or an element around the presenter's node.
340
345
  A notice can hold buttons, so a screen that keeps a failure on screen through a retry attaches its `useFocusRescue` ref to an element keyed by the same occurrence around it, as `ResourceFailed` does (below).
341
346
  A blank `deniedSentence` throws `RangeError` whatever the status, so a forgotten sentence fails at the first render instead of at the first 403.
342
347
 
@@ -417,12 +422,12 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
417
422
  | `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`. |
418
423
  | `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. |
419
424
  | `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. |
420
- | `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. |
425
+ | `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`. |
421
426
  | `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"`. |
422
427
  | `DescriptionList` | A `dl` of name–value rows (`dt` and `dd` grouped in a `div`), the term a third of the row in `fg-secondary`. |
423
428
  | `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. |
424
429
  | `JobCard` | One job in a `Card`: its state pill in a live region of its own, an optional `ProgressBar` and an optional cancel button in the card's actions that is busy while the cancel is under way. |
425
- | `useEscapeToClose`, `useFocusRescue`, `usePendingPress`, `useResource`, `usePagedResource`, `ResourceFailed` | See above. |
430
+ | `useEscapeToClose`, `useFocusRescue`, `useFailureOccurrence`, `usePendingPress`, `useResource`, `usePagedResource`, `ResourceFailed` | See above. |
426
431
 
427
432
  Every component except `Text` requires `testId`, exposes its state as `data-*` attributes, takes no `className`, and accepts caller `data-*` attributes through `dataAttributes` where a host needs to mark it (`data-cui-*` and `data-testid` are reserved and rejected there). The one `data-cui-*` attribute a host writes itself is the row-focus hook `data-cui-row-focus`, on the row elements of its own row list (see Focus and announcements).
428
433
 
@@ -440,7 +445,7 @@ The test ids a component derives from its `testId` are public test hooks:
440
445
  | `Switch` | `<testId>-track`, `<testId>-thumb`, `<testId>-reason` (the `unavailable` reason it draws) |
441
446
  | `PanelTabs` | `<testId>-<id>` (each tab's button), `<testId>-panel` (the `tabpanel`) |
442
447
  | `Slider` | `<testId>-field` (the field root; `testId` itself is on the input), `<testId>-value` (the drawn value text) |
443
- | `SegmentedControl` | `<testId>-<value>` (each option's button) |
448
+ | `SegmentedControl` | `<testId>-<value>` (each option's button), `<testId>-<value>-face` (its face, `density="compact"` only) |
444
449
  | `Disclosure` | `<testId>-button`, `<testId>-panel` |
445
450
  | `DescriptionList` | `<testId>-<key>` (each row) |
446
451
  | `Stepper` | `<testId>-<id>` (each step) |
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 _chunkWUST5VT6cjs = require('./chunk-WUST5VT6.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ae=_react.createContext.call(void 0, null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",De="data-cui-dialog-announcer",Cn=`:scope > [${De}]`,kn=e=>{if(e.closest(Ct)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(It)],o=t.activeElement,a=n.filter(s=>s.contains(o)),r=a.length>0?a:n;if(r.every(s=>s.contains(e)))return{region:e};let i=r.find(s=>r.every(u=>u.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=i.querySelector(Cn);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(Ct)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Ln=e=>{try{e.querySelectorAll(It)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce= exports.ANNOUNCE_SETTLE_MS =150,Sn=1e3,kt=new WeakMap,Mn=(e,t)=>{let n=_nullishCoalesce(kt.get(e), () => (new Set)),o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},In= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(_react.useContext.call(void 0, Ae)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof o!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");let d=_chunkWUST5VT6cjs.n.call(void 0, e),[s]=Intl.getCanonicalLocales(t),u=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(s,{timeZone:n}).resolvedOptions().timeZone,[s,n]),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Ln(p.current.ownerDocument)},[]);let c=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=l.current;l.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let x=y.join(Mt),k=kn(T);if("hidden"in k)throw new Error(`announce: the live region is hidden from assistive technology (${k.hidden}), so this announcement would be lost: ${x}`);Mn(k.region,x)},h=l.current;if(h===null){l.current={texts:[m],settle:setTimeout(f,ce),deadline:setTimeout(f,Sn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,ce)},[]),b=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:s,timeZone:u,labels:d,announce:c,accessFailure:o}),[e,s,u,d,c,o]);return _jsxruntime.jsx.call(void 0, Ae.Provider,{value:b,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ae);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},He= exports.useAnnounce =()=>C().announce,Fn= exports.useAccessFailure =()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var pe=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var Dn=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"]),Hn=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Dn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=Hn(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${o} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:i,tabIndex:d,ref:s,children:u})=>(g(),_jsxruntime.jsx.call(void 0, o,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":o==="p"?"reading":void 0,"data-testid":r,id:i,tabIndex:d,ref:s,children:u}));var Kn=/\s/,Oe=(e,t)=>{if(e===""||Kn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(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 Oe(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var _n={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"}},Ke=({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:o="button",onClick:a,unavailable:r,describedBy:i,expanded:d,controls:s,ref:u,dataAttributes:p,busy:l,busyLabel:c})=>{g();let b=_react.useId.call(void 0, ),m=J(r,b),f=l===!0||r!==void 0,h=_n[e],y=E=>{if(pe(E),f){E.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(E)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:o==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":l===!0?!0:void 0,"aria-describedby":B(i,m),"aria-expanded":d,"aria-controls":s,onClick:y,ref:u,...w(p),children:_jsxruntime.jsx.call(void 0, Ke,{subject:{testId:n,part:"label",host:"button"},children:l===!0?c:t})}),_optionalChain([r, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},qn= exports.Link =({onNavigate:e,children:t,testId:n,ref:o})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:_jsxruntime.jsx.call(void 0, Ke,{subject:{testId:n,part:"label",host:"button"},children:t})})),Gn=/^[^\s#]+$/,Vn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Gn.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,onClick:o,...w(a),children:_jsxruntime.jsx.call(void 0, Ke,{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})),Ue= exports.Cluster =({gap:e,as:t="div",testId:n,children:o})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));var jn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Yn=" ",Zn= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let o=He(),a=e.actions.map(({action:d,label:s})=>{let u=t[d];if(u===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:s,handler:u}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Yn):null,i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{r===null||i.current===r||(i.current=r,o(r))},[o,r]),_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(d=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Ue,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:s,handler:u})=>_jsxruntime.jsx.call(void 0, I,{variant:jn.has(d)?"primary":"secondary",onClick:u,testId:`${n}-${d}`,children:s},d))})]})};var fe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var Qn=({items:e,current:t,onNavigate:n,testId:o})=>{let{labels:a}=C();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:i=>fe(i,r.href,n),children:r.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.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":`${o}-current`,children:t})})]})})};var tr=229,nr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),me=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&nr.has(e.type)&&(e.value!==""||e.validity.badInput),Be=e=>e.nativeEvent.isComposing||e.keyCode===tr,_=(e,t)=>{e.key!=="Escape"||Be(e)||me(e.target)||(e.stopPropagation(),t())},rr= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>_(t,e),[e]);var Ht=e=>e===void 0?void 0:t=>_(t,e),_e= exports.Card =({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:i,ref:d,dataAttributes:s,children:u})=>{g();let p=_react.useId.call(void 0, ),l=Ht(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":r,ref:d,onKeyDown:l,...w(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":`${r}-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})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:o})]}),u]})},or={3:"h3",4:"h4"},ar= exports.CardSection =({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:i,headingRef:d,ref:s,dataAttributes:u,children:p})=>{g();let l=_react.useId.call(void 0, ),c=Ht(r),b=or[o],m=_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:l,"data-cui-type":"body","data-testid":`${i}-heading`,ref:d,tabIndex:d===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":l,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:m}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:m})};var sr=({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 X=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var ur=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let i=_react.useId.call(void 0, );for(let l of[o,a])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of n)for(let c of t)if(!Object.hasOwn(l.cells,c.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${c.key}"`);let d=o+n.length*a,s=`cui-comparison-a${o}-c${a}-n${n.length}`,u=l=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${l}"]`,p=`${u("table")}{display:none}@container (min-width:${_chunkWUST5VT6cjs.M.call(void 0, d)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, X,{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:_chunkWUST5VT6cjs.M.call(void 0, o)}}),n.map(l=>_jsxruntime.jsx.call(void 0, "col",{},l.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(l=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:l.heading},l.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(l=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:l.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[l.key]("table")},c.key))]},l.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((l,c)=>{let b=`${i}-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:l.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(m=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:m.label}),_jsxruntime.jsx.call(void 0, "dd",{children:l.cells[m.key]("stack")})]},m.key))})]},l.key)})})]})};var re="[data-cui-row-focus]",qe="[data-cui-row-detail]",cr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],Kt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let o=-1;for(let a of e===null?[]:e.children)a.matches(re)?(o+=1,n.set(a,o)):o>=0&&a.matches(qe)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=cr(t);if(a.length===0)return n;let r=o.get(e);if(r===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(r,a.length-1)]};var fr=e=>e+1,oe= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),o=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, fr,0),r=_react.useCallback.call(void 0, (i=>()=>{o.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(o.current=!0,()=>{o.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 d=[null,document.body].includes(document.activeElement);i.isConnected||!d||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(i), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),r};var hr=new Map,Rr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Tr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Rr)].find(r=>r.parentElement!==o);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkWUST5VT6cjs.q} px target does not fit its ${_chunkWUST5VT6cjs.s} px; use row-control), not <${a.localName}>`)})},Er=(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 o=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(o!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${o.key}`)},xr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),vr=(e,t,n,o,a)=>{let r=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},wr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:i,rowSize:d,rowDetail:s,empty:u,testId:p,ref:l})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Tr(b,d,p);let m=_react.useRef.call(void 0, null),f=_react.useRef.call(void 0, hr),h=oe(R=>Ut(R,b.current,m.current,f.current));_react.useLayoutEffect.call(void 0, ()=>{f.current=Kt(b.current,m.current)});let y=_react.useCallback.call(void 0, R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=_chunkWUST5VT6cjs.P.call(void 0, n);return Er(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:l,children:o.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:u}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkWUST5VT6cjs.M.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(R=>_jsxruntime.jsx.call(void 0, "col",{style:R.width.fixedPx===void 0?void 0:{width:_chunkWUST5VT6cjs.M.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:b,children:o.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":r,...w(_optionalChain([i, 'optionalCall', _8 => _8(R)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),s===void 0?null:vr(s,R,n.length,r,h)]},a(R)))})]})})})};var Pr=({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 Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Cr=(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},kr=(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")},Lr=e=>e instanceof HTMLInputElement&&e.type==="search",Sr= exports.Dialog =({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:i})=>{let{labels:d}=C(),s=_react.useId.call(void 0, ),u=_react.useId.call(void 0, ),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Cr(y,a.current);l.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&kr(y,E)}else!n&&y.open&&y.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(l.current),l.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:p,onClose:y=>{y.currentTarget.open||(Gt(l.current),l.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||me(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=Be(y);c.current=E,y.key==="Escape"&&!E&&me(y.target)&&!Lr(y.target)&&y.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: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:`${r}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:d.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:u,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),i,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[De]:"","data-testid":`${r}-announcer`})]})};var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, null);return H(i,{testId:o,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":o,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${o}-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:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var $r=({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})),ie= 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 je=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:i,accessFailure:d}=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, ie,{occurrence:e.occurrence,testId:r,children:i.failureSentence(e,o)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:d({kind:s,place:t,deniedSentence:s==="forbidden"?i.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var Hr=/\s/,Ye=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Hr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Xt=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},Y=({description:e,error:t,errorId:n})=>{g();let o=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),i=n===void 0?r:Oe(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:o,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:o,testId:`${a}-error`,children:t})]}),be=({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}),Or= exports.Field =({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:i,descriptionId:d,errorId:s}=Y({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, be,{htmlFor:i.id,hidden:void 0,children:e}),r(i),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:d,errorId:s,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:i,name:d,maxLength:s,list:u,autoComplete:p,inputMode:l,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Y({label:e,description:t,error:n,errorId:o}),T=_react.useId.call(void 0, );if(c!==void 0&&c.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 x=i==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:i,name:Ye(d),maxLength:Xt(s),value:a,list:u,autoComplete:p,inputMode:l,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:m,onChange:K=>r(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[_jsxruntime.jsx.call(void 0, be,{htmlFor:y.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":`${f}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Kr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e}),Ur= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e,type:"password"}),Br= exports.TextArea =({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:i,maxLength:d,required:s,testId:u,ref:p})=>{let{control:l,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[_jsxruntime.jsx.call(void 0, be,{htmlFor:l.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:Ye(i),maxLength:Xt(d),value:a,required:s,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...l}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},_r= exports.Select =({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,name:d,labelHidden:s,unavailable:u,testId:p,ref:l})=>{let{control:c,descriptionId:b,errorId:m}=Y({label:e,description:t,error:n,errorId:o}),f=_react.useId.call(void 0, ),h=J(u,f);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, be,{htmlFor:c.id,hidden:s,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:Ye(d),value:a,onChange:y=>{u===void 0&&i(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:l,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>_jsxruntime.jsx.call(void 0, "option",{value:y.value,children:y.label},y.value))}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),_optionalChain([u, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:u.reason})]})},qr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,testId:d,ref:s})=>{let u=_react.useId.call(void 0, ),{control:p,descriptionId:l,errorId:c}=Y({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:l,errorId:c,testId:d})]})},Gr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:i,testId:d,ref:s})=>{let{control:u,descriptionId:p,errorId:l}=Y({label:e,description:t,error:n,errorId:o}),c=r.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>i(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":u["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:f.label})]},f.value)),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:p,errorId:l,testId:d})]})};var nn=_react.createContext.call(void 0, null),Yt="surface",Zt={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"}},Qt={face:"info-tint",line:"info-accent"},rn={normal:"border-control",high:"info-accent"},Xr=["normal","high"],jr=[1,2,3,4],A=_chunkWUST5VT6cjs.t.space["space-2"],Yr="fg",Zr="fg-secondary",on=e=>{let t=_react.useContext.call(void 0, nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Ze=(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}`)},Qr= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:i,children:d}=e;Ze(r,"widthPx",o),Ze(r,"heightPx",a);let s=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),u=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:Xr.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:s.arrowIds[b],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, nn.Provider,{value:s,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!_chunkWUST5VT6cjs.f.call(void 0, b))throw new RangeError(`${r}: 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":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${o} ${a}`,"data-cui-figure":"group","data-cui-surface":Yt,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-block":_chunkWUST5VT6cjs.M.call(void 0, a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(i),children:u})})}let{viewBox:p,pointer:l,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${o} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Yt,"data-cui-face":"sans","data-cui-pan":l===void 0?void 0:"true","data-cui-cursor":_optionalChain([l, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(i),..._optionalChain([l, 'optionalAccess', _14 => _14.handlers]),children:u})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},eo=(e,t,n)=>{for(let o of t){let a=_chunk7M4I26BScjs.d.light[o.fg],r=n.find(i=>a[i]===void 0);if(r!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(o.text)} in ${o.fg} is not in the contrast table on ${r}, a face the node takes`)}},to= exports.FigureNode =e=>{g();let t=on("FigureNode"),n=_react.useId.call(void 0, ),{x:o,y:a,shape:r,tone:i,outline:d,selected:s,name:u,title:p,press:l,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(o)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${o}, ${a}`);if(t.kind==="group"&&l===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&l!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(l!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, l.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(l.label)}`);let f=s?Qt:Zt[i];eo(c,m,[Zt[i].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(u===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=en(c,()=>_chunkWUST5VT6cjs.G.call(void 0, {name:u,notes:m.map(k=>k.text)}));if(Ze(c,"a box's widthPx",r.widthPx),r.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${r.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:r.widthPx,height:T.heightPx,left:o,top:a};let x=_chunkWUST5VT6cjs.H.call(void 0, m.length);y=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":f.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:_chunkWUST5VT6cjs.t.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:_chunkWUST5VT6cjs.t.type.body.size,"data-cui-fg":Yr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),m.map((k,K)=>_jsxruntime.jsx.call(void 0, "text",{x:x.insetPx,y:x.notesPx[K],fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkWUST5VT6cjs.K,y:-_chunkWUST5VT6cjs.K,width:r.widthPx+2*_chunkWUST5VT6cjs.K,height:T.heightPx+2*_chunkWUST5VT6cjs.K,rx:_chunkWUST5VT6cjs.t.radius["radius-item"]+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=en(c,()=>_chunkWUST5VT6cjs.I.call(void 0, u,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":f.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),u===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkWUST5VT6cjs.t.type.caption.lineHeight/2,fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":Zr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:r.radiusPx+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(l!==void 0){if(h.width<_chunkWUST5VT6cjs.q||h.height<_chunkWUST5VT6cjs.q)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkWUST5VT6cjs.q} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkWUST5VT6cjs.J||h.top<_chunkWUST5VT6cjs.J||h.left+h.width+_chunkWUST5VT6cjs.J>t.widthPx||h.top+h.height+_chunkWUST5VT6cjs.J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkWUST5VT6cjs.J} px to the figure's edge for its focus ring`)}let R=l===void 0?{}:{role:"button",tabIndex:0,"aria-label":l.label,"aria-describedby":l.description===void 0?void 0:n,"aria-expanded":l.expanded,"aria-controls":l.expanded?l.controls:void 0,onClick:T=>{T.currentTarget.focus(),l.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||l.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":i,"data-cui-outline":d,"data-selected":String(s),...R,"data-testid":c,...w(b),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([l, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:l.description}),l===void 0?null:E,y]})},no= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:i})=>{g();let d=on("FigureEdge");if(!jr.includes(n))throw new RangeError(`${r}: 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:o?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":rn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":r,...w(i),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var ro={1:"h1",2:"h2",3:"h3"},oo= exports.Heading =({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=ro[e];return _jsxruntime.jsx.call(void 0, r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:o,tabIndex:o===void 0?void 0:-1,children:a})};var io={removed:"danger-tint",added:"success-tint"},so= 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":io[e],"data-cui-fg":"fg","data-testid":t,children:n})};var uo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},co={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Qe= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?uo[e]:{fg:"on-solid",surface:co[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":n,...w(o),children:a})};var et=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=_react.useId.call(void 0, );if(o!==null){if(!(Number.isFinite(o)&&o>0))throw new RangeError(`Progress maximum must be positive: ${o}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let i=o===null?null:{max:o,now:Math.min(n,o)};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:r,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"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 mo=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>_jsxruntime.jsxs.call(void 0, _e,{title:e,actions:o===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.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, Qe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, et,{...n,testId:`${a}-progress`}),r]});var tt=_react.createContext.call(void 0, null),ho="space-2",Ro= exports.List =e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:i}=e;if(n!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, n))throw new RangeError(`${r}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let d=e.marker==="none"?void 0:e.type,s=d!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, tt.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, u,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?ho:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:i})})},To= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let o=_react.useContext.call(void 0, tt);if(o===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,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, tt.Provider,{value:null,children:n})})})};var ln=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(qe);return n===null||!e.contains(n)}),xo=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=ln(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${re} elements for ${e.count} rows`);return n},vo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},wo= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:i})=>{let{formatLocale:d,labels:s}=C(),u=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let y=r.ref.current;u.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let y=c.current;c.current=!1;let E=u.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=vo(R,E.shown),x=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(u.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||y&&k)&&T.focus()});let m=oe(()=>n?p.current:l.current),f=_react.useCallback.call(void 0, (y=>{l.current=y;let E=m(y);return()=>{l.current=null,c.current=y===document.activeElement,E()}}),[m]),h=_react.useCallback.call(void 0, (y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);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:b,ref:f,testId:`${i}-button`,children:s.loadMore(_chunkWUST5VT6cjs.a.call(void 0, a,d))}),o===null?null:_jsxruntime.jsx.call(void 0, ie,{occurrence:o.occurrence,testId:`${i}-failure`,children:s.loadFailed(o.reason)})]})};var No=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=_chunkWUST5VT6cjs.O.call(void 0, {masterMinPx:n,detailMinPx:o,gapPx:_chunkWUST5VT6cjs.t.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, X,{ruleKey:r.key,css:r.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":r.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 ve=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:i,unit:d}=e;if(d!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(i===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let s=_chunkWUST5VT6cjs.a.call(void 0, i,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:_chunkWUST5VT6cjs.c.call(void 0, s,d)})}let{text:a,keep:r}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!_chunkWUST5VT6cjs.f.call(void 0, a))throw new RangeError(`${o}: 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":r,"data-testid":o,children:a})};var Co=({label:e,value:t,min:n,max:o,valueText:a,testId:r})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(o)&&n<o))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${o}`);if(!(Number.isFinite(t)&&t>=n&&t<=o))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${o}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":r,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${r}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};var Mo={ArrowLeft:-1,ArrowRight:1},Io= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:i})=>{g();let d=_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 u=t.map(f=>f.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let l=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(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:f=>{let h=t.findIndex(T=>s.current.get(T.id)===f.target),y=h<0?p:h,E=Mo[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:l(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?s.current.delete(f.id):s.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":l(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:i})]})};var Ao=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:i}=C(),d=_jsxruntime.jsx.call(void 0, je,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?i.loadFailed:o,retry:t,testId:`${r}-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":r,children:d},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":r,children:[d,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${r}-reload`,children:i.reload})]})};var Ho=({label:e,options:t,value:n,onValueChange:o,testId:a})=>{g();let r=new Set(t.map(i=>i.value));if(t.length<2||r.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!r.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...r].join(", ")}`);return _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||o(i.value)},children:i.label},i.value)})})]})};var cn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:i})=>{g();let d=_react.useRef.call(void 0, null);H(d,{testId:o,part:"row",host:"button"});let s=_react.useCallback.call(void 0, p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":o,onClick:p=>{pe(p),n()},ref:s,...w(a),children:i})},Bo= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:i,rowTestId:d,rowData:s,empty:u,testId:p,ref:l})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):_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, cn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:_optionalChain([s, 'optionalCall', _23 => _23(c)]),children:i(c)})},b)})})}));var qo=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:i,testId:d})=>{g();let s=_react.useId.call(void 0, );if(!([t,n,o,a].every(Number.isFinite)&&n<o&&a>0&&n<=t&&t<=o))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${o}, step ${a}`);let u=r(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-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:o,step:a,value:t,"aria-valuetext":u,"data-testid":d,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:`${d}-value`,children:u})})]})]})};var yn={done:0,current:1,pending:2},Go={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Vo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:o}=C();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,i)=>i>0&&yn[r.state]<yn[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let a={done:o.stepDone,current:null,pending:o.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((r,i)=>{let d=Go[r.state],s=a[r.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":i+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,s===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${s})`})]})]},r.id)})})};var Jo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:i,dataAttributes:d})=>{g();let s=_react.useId.call(void 0, ),u=_react.useRef.call(void 0, null);H(u,{testId:r,part:"label",host:"button"});let p=J(a,s),l=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":l?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:i,onClick:()=>{l||o(!n)},...w(d),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,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:s,testId:`${r}-reason`,children:a.reason})]})};var Qo=({label:e,items:t,currentId:n,onNavigate:o,testId:a,collapsible:r=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(m=>m.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let d=t.find(m=>m.id===n);if(d===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...i].join(", ")}`);let[s,u]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, m=>{u(!1),m&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([l, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(r&&s))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[r,s,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&s?"":void 0,onKeyDown:r&&s?m=>_(m,()=>b(!0)):void 0,children:[r?_jsxruntime.jsxs.call(void 0, "button",{ref:l,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(m=>!m),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:d.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:c,role:"list","data-cui-surface":r?"surface":void 0,children:t.map(m=>{let f=m.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{fe(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};var ra={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},oa= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:o,testId:a,dataAttributes:r}=e;if((e.text===void 0?e.value===null:e.text===null)&&o!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${o}`);let d=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),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":ra[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, ve,{value:e.value,unit:e.unit,testId:d}):_jsxruntime.jsx.call(void 0, ve,{text:e.text,keep:"wrap",testId:d})})]})},hn=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?hn(t.props.children):[t]}),aa= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=_chunkWUST5VT6cjs.R.call(void 0, e,t,_chunkWUST5VT6cjs.t.space["space-2"]),r=hn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, X,{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:o})]})};var Ce=e=>[...e.querySelectorAll("button")],sa= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let o=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let s=Ce(o.current),u=a.current!==null&&s.includes(a.current)?a.current:_nullishCoalesce(s[0], () => (null));a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let r=s=>{for(let u of Ce(o.current))u.tabIndex=u===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:o,onFocus:s=>{let u=Ce(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&r(u)},onKeyDown:s=>{let u=Ce(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let l=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=l==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[l]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(m===void 0)return;s.preventDefault();let f=u[m];r(f),f.focus()},children:n})};var En=e=>e===null?_chunkWUST5VT6cjs.V:_chunkWUST5VT6cjs.W,Le=(e,t,n,o,a)=>{let[r,i]=_react.useState.call(void 0, ()=>({key:e,state:En(e)})),[d,s]=_react.useState.call(void 0, 0),[u,p]=_react.useState.call(void 0, 0),l=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{l.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){i({key:null,state:_chunkWUST5VT6cjs.V});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,i(x=>Object.is(x.key,e)?{key:e,state:o(x.state,T)}:{key:e,state:_chunkWUST5VT6cjs.W}),l.current(R.signal).then(x=>{R.signal.aborted||(c.current=null,i(k=>({key:e,state:a(k.state,x)})))},x=>{R.signal.aborted||i(()=>{throw x})}),()=>{R.abort(),c.current=null}},[e,n,d,u]);let m=_react.useCallback.call(void 0, ()=>s(R=>R+1),[]),f=_react.useCallback.call(void 0, ()=>p(R=>R+1),[]),h=_react.useCallback.call(void 0, (R,T)=>{i(x=>Object.is(x.key,R)?{key:R,state:T(x.state)}:x)},[]),y=_react.useCallback.call(void 0, (R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:En(e),reload:m,refresh:f,update:h,write:y}};var pa=(e,t,n)=>{let o=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{o.current=t});let a=_react.useCallback.call(void 0, y=>o.current.first(y),[]),{state:r,reload:i,refresh:d,update:s,write:u}=Le(e,a,n,_chunkWUST5VT6cjs.Z,_chunkWUST5VT6cjs._),p=_react.useRef.call(void 0, {key:e,state:r});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:r}});let l=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([l, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),l.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),i()},[c,i]),m=_react.useCallback.call(void 0, ()=>{c(),d()},[c,d]),f=_react.useCallback.call(void 0, ()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};l.current=T,s(y,_chunkWUST5VT6cjs.$),o.current.next(R,T.controller.signal).then(x=>{l.current===T&&(l.current=null,s(y,k=>T.maps.reduce((K,vn)=>_chunkWUST5VT6cjs.ba.call(void 0, K,vn),_chunkWUST5VT6cjs.aa.call(void 0, k,R,x))))},x=>{l.current===T&&s(y,()=>{throw x})})},[s]),h=_react.useCallback.call(void 0, (y,E)=>{let R=l.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),u(y,T=>_chunkWUST5VT6cjs.ba.call(void 0, T,E))},[u]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};var ga=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",ba= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),o=_react.useCallback.call(void 0, (a,r)=>{let i=r();if(!ga(i))return;let d=Symbol(a);n.current=d,t(a);let s=()=>{n.current===d&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:o}};var Ra=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:i}=Le(e,t,n,_chunkWUST5VT6cjs.X,_chunkWUST5VT6cjs.Y),d=_react.useCallback.call(void 0, (s,u)=>i(s,p=>_chunkWUST5VT6cjs.Y.call(void 0, p,{ok:!0,value:u})),[i]);return{state:o,reload:a,refresh:r,put:d}};var Ta=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ce; exports.AccessFailureNotice = Zn; exports.AlertMessage = ie; exports.Breadcrumb = Qn; exports.Button = I; exports.COMPACT_ROW_PX = _chunkWUST5VT6cjs.s; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkWUST5VT6cjs.m; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.Card = _e; exports.CardSection = ar; exports.CheckboxGroup = Gr; exports.Cluster = Ue; exports.CodeBlock = sr; exports.ComparisonGrid = ur; exports.ConsoleUiRoot = In; exports.DataTable = wr; exports.DescriptionList = Pr; exports.Dialog = Sr; exports.Disclosure = Fr; exports.FIGURE_RING_REACH_PX = _chunkWUST5VT6cjs.J; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkWUST5VT6cjs.A; exports.FailureMessage = je; exports.Field = Or; exports.Figure = Qr; exports.FigureEdge = no; exports.FigureNode = to; exports.FragmentLink = Vn; exports.HTTP_FORBIDDEN = _chunkWUST5VT6cjs.S; exports.Heading = oo; exports.InlineChange = so; exports.JobCard = mo; exports.LATTICE_PX = _chunkWUST5VT6cjs.o; exports.Link = qn; exports.List = Ro; exports.ListItem = To; exports.LoadMore = wo; exports.MasterDetail = No; exports.Measured = ve; exports.Meter = Co; exports.MetricTile = oa; exports.Notice = $r; exports.PanelTabs = Io; exports.PasswordInput = Ur; exports.Pill = Qe; exports.ProgressBar = et; exports.ROW_WITH_CONTROL_PX = _chunkWUST5VT6cjs.r; exports.RadioGroup = qr; exports.ResourceFailed = Ao; exports.RowButton = cn; exports.SegmentedControl = Ho; exports.Select = _r; exports.SelectableList = Bo; exports.Slider = qo; exports.Stack = zn; exports.Stepper = Vo; exports.Switch = Jo; exports.TARGET_PX = _chunkWUST5VT6cjs.q; exports.TOKENS = _chunkWUST5VT6cjs.t; exports.TONES = _chunkWUST5VT6cjs.ga; exports.TONE_HUES = _chunkWUST5VT6cjs.ea; exports.TONE_ROLES = _chunkWUST5VT6cjs.fa; exports.Tabs = Qo; exports.Text = P; exports.TextArea = Br; exports.TextInput = Kr; exports.TileGrid = aa; exports.Toolbar = sa; exports.VisuallyHidden = Ta; exports.ZonedTimeError = _chunkWUST5VT6cjs.g; exports.beginPage = _chunkWUST5VT6cjs.$; exports.beginPagedReload = _chunkWUST5VT6cjs.Z; exports.beginReload = _chunkWUST5VT6cjs.X; exports.ceil8 = _chunkWUST5VT6cjs.x; exports.ceilToLattice = _chunkWUST5VT6cjs.p; exports.cellContentInlinePx = _chunkWUST5VT6cjs.y; exports.comparisonAttributePx = _chunkWUST5VT6cjs.B; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkWUST5VT6cjs.D; exports.cssVar = _chunkWUST5VT6cjs.u; exports.figureBoxPlan = _chunkWUST5VT6cjs.G; exports.figureDiscLabelPlan = _chunkWUST5VT6cjs.I; exports.fillLabel = _chunkWUST5VT6cjs.k; exports.fixedColumnPx = _chunkWUST5VT6cjs.z; exports.flatMapOutcome = _chunkWUST5VT6cjs.U; exports.formatByteSize = _chunkWUST5VT6cjs.b; exports.formatCount = _chunkWUST5VT6cjs.a; exports.formatInstant = _chunkWUST5VT6cjs.j; exports.goldenSectionPx = _chunkWUST5VT6cjs.L; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkWUST5VT6cjs.C; exports.isReadableText = _chunkWUST5VT6cjs.f; exports.keepLastGood = _chunkWUST5VT6cjs.Y; exports.lightDark = _chunkWUST5VT6cjs.ca; exports.mapOutcome = _chunkWUST5VT6cjs.T; exports.mapPagedList = _chunkWUST5VT6cjs.ba; exports.masterDetailPlan = _chunkWUST5VT6cjs.N; exports.monoTextWidthEm = _chunkWUST5VT6cjs.w; exports.placeholderRule = _chunkWUST5VT6cjs.da; exports.pxToRem = _chunkWUST5VT6cjs.M; exports.readDecimalText = _chunkWUST5VT6cjs.d; exports.readIntegerText = _chunkWUST5VT6cjs.e; exports.reasonAside = _chunkWUST5VT6cjs.l; exports.resolveConsoleUiLabels = _chunkWUST5VT6cjs.n; exports.settleFirstPage = _chunkWUST5VT6cjs._; exports.settlePage = _chunkWUST5VT6cjs.aa; exports.spacedTextWidthEm = _chunkWUST5VT6cjs.F; exports.tableFrameMinInlinePx = _chunkWUST5VT6cjs.Q; exports.tableMinInlinePx = _chunkWUST5VT6cjs.P; exports.textWidthEm = _chunkWUST5VT6cjs.v; exports.tileGridPlan = _chunkWUST5VT6cjs.R; exports.tileMinInlinePx = _chunkWUST5VT6cjs.E; exports.toOffsetIso = _chunkWUST5VT6cjs.h; exports.toWallTime = _chunkWUST5VT6cjs.i; exports.useAccessFailure = Fn; exports.useAnnounce = He; exports.useConsoleUi = C; exports.useEscapeToClose = rr; exports.useFocusRescue = oe; exports.usePagedResource = pa; exports.usePendingPress = ba; exports.useResource = Ra;
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 _chunkWUST5VT6cjs = require('./chunk-WUST5VT6.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var De=_react.createContext.call(void 0, null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",He="data-cui-dialog-announcer",kn=`:scope > [${He}]`,Ln=e=>{if(e.closest(Ct)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(It)],o=t.activeElement,a=n.filter(i=>i.contains(o)),r=a.length>0?a:n;if(r.every(i=>i.contains(e)))return{region:e};let s=r.find(i=>r.every(l=>l.contains(i)));if(s===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=s.querySelector(kn);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(Ct)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Sn=e=>{try{e.querySelectorAll(It)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe= exports.ANNOUNCE_SETTLE_MS =150,Mn=1e3,kt=new WeakMap,In=(e,t)=>{let n=_nullishCoalesce(kt.get(e), () => (new Set)),o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},$n= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(_react.useContext.call(void 0, De)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof o!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");let d=_chunkWUST5VT6cjs.n.call(void 0, e),[i]=Intl.getCanonicalLocales(t),l=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(i,{timeZone:n}).resolvedOptions().timeZone,[i,n]),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Sn(p.current.ownerDocument)},[]);let c=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=u.current;u.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let v=y.join(Mt),k=Ln(T);if("hidden"in k)throw new Error(`announce: the live region is hidden from assistive technology (${k.hidden}), so this announcement would be lost: ${v}`);In(k.region,v)},h=u.current;if(h===null){u.current={texts:[m],settle:setTimeout(f,pe),deadline:setTimeout(f,Mn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,pe)},[]),b=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:i,timeZone:l,labels:d,announce:c,accessFailure:o}),[e,i,l,d,c,o]);return _jsxruntime.jsx.call(void 0, De.Provider,{value:b,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, De);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Oe= exports.useAnnounce =()=>C().announce,Fn= exports.useAccessFailure =()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var Hn=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"]),On=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Hn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=On(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${o} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:s,tabIndex:d,ref:i,children:l})=>(g(),_jsxruntime.jsx.call(void 0, o,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":o==="p"?"reading":void 0,"data-testid":r,id:s,tabIndex:d,ref:i,children:l}));var Un=/\s/,Ke=(e,t)=>{if(e===""||Un.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ke(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var qn={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"}},Ue=({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:o="button",onClick:a,unavailable:r,describedBy:s,expanded:d,controls:i,ref:l,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=_react.useId.call(void 0, ),m=X(r,b),f=u===!0||r!==void 0,h=qn[e],y=E=>{if(ye(E),f){E.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(E)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:o==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":d,"aria-controls":i,onClick:y,ref:l,...w(p),children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),_optionalChain([r, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},Gn= exports.Link =({onNavigate:e,children:t,testId:n,ref:o})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"button"},children:t})})),Vn=/^[^\s#]+$/,Wn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Vn.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,onClick:o,...w(a),children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Jn=({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})),Be= exports.Cluster =({gap:e,as:t="div",testId:n,children:o})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));var Yn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Zn=" ",Qn= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let o=Oe(),a=e.actions.map(({action:d,label:i})=>{let l=t[d];if(l===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:i,handler:l}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Zn):null,s=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{r===null||s.current===r||(s.current=r,o(r))},[o,r]),_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(d=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Be,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:i,handler:l})=>_jsxruntime.jsx.call(void 0, I,{variant:Yn.has(d)?"primary":"secondary",onClick:l,testId:`${n}-${d}`,children:i},d))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var er=({items:e,current:t,onNavigate:n,testId:o})=>{let{labels:a}=C();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:s=>me(s,r.href,n),children:r.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.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":`${o}-current`,children:t})})]})})};var nr=229,rr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&rr.has(e.type)&&(e.value!==""||e.validity.badInput),_e=e=>e.nativeEvent.isComposing||e.keyCode===nr,_=(e,t)=>{e.key!=="Escape"||_e(e)||ge(e.target)||(e.stopPropagation(),t())},or= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>_(t,e),[e]);var Ht=e=>e===void 0?void 0:t=>_(t,e),qe= exports.Card =({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:s,ref:d,dataAttributes:i,children:l})=>{g();let p=_react.useId.call(void 0, ),u=Ht(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":r,ref:d,onKeyDown:u,...w(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:p,"data-cui-type":"title","data-testid":`${r}-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})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:o})]}),l]})},ar={3:"h3",4:"h4"},ir= exports.CardSection =({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:s,headingRef:d,ref:i,dataAttributes:l,children:p})=>{g();let u=_react.useId.call(void 0, ),c=Ht(r),b=ar[o],m=_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:d,tabIndex:d===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":s,ref:i,onKeyDown:c,...w(l),children:m}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(l),children:m})};var dr=({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 j=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var cr=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let s=_react.useId.call(void 0, );for(let u of[o,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 d=o+n.length*a,i=`cui-comparison-a${o}-c${a}-n${n.length}`,l=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${l("table")}{display:none}@container (min-width:${_chunkWUST5VT6cjs.M.call(void 0, d)}){${l("table")}{display:block}${l("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:i,css:p}),_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:_chunkWUST5VT6cjs.M.call(void 0, o)}}),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(m=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:m.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};var oe="[data-cui-row-focus]",Ge="[data-cui-row-detail]",pr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Kt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let o=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(o+=1,n.set(a,o)):o>=0&&a.matches(Ge)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=pr(t);if(a.length===0)return n;let r=o.get(e);if(r===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(r,a.length-1)]};var mr=e=>e+1,ae= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),o=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, mr,0),r=_react.useCallback.call(void 0, (s=>()=>{o.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(o.current=!0,()=>{o.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 d=[null,document.body].includes(document.activeElement);s.isConnected||!d||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),r};var Rr=new Map,Tr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Er=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Tr)].find(r=>r.parentElement!==o);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkWUST5VT6cjs.q} px target does not fit its ${_chunkWUST5VT6cjs.s} px; use row-control), not <${a.localName}>`)})},vr=(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 o=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(o!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${o.key}`)},xr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),wr=(e,t,n,o,a)=>{let r=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},Pr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:s,rowSize:d,rowDetail:i,empty:l,testId:p,ref:u})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Er(b,d,p);let m=_react.useRef.call(void 0, null),f=_react.useRef.call(void 0, Rr),h=ae(R=>Ut(R,b.current,m.current,f.current));_react.useLayoutEffect.call(void 0, ()=>{f.current=Kt(b.current,m.current)});let y=_react.useCallback.call(void 0, R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=_chunkWUST5VT6cjs.P.call(void 0, n);return vr(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:u,children:o.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:l}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkWUST5VT6cjs.M.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(R=>_jsxruntime.jsx.call(void 0, "col",{style:R.width.fixedPx===void 0?void 0:{width:_chunkWUST5VT6cjs.M.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:b,children:o.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":r,...w(_optionalChain([s, 'optionalCall', _8 => _8(R)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:wr(i,R,n.length,r,h)]},a(R)))})]})})})};var Nr=({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 Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},kr=(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},Lr=(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")},Sr=e=>e instanceof HTMLInputElement&&e.type==="search",Mr= exports.Dialog =({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:s})=>{let{labels:d}=C(),i=_react.useId.call(void 0, ),l=_react.useId.call(void 0, ),p=_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 y=p.current;if(n&&!y.open){let E=a===void 0?null:kr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Lr(y,E)}else!n&&y.open&&y.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:l,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:p,onClose:y=>{y.currentTarget.open||(Gt(u.current),u.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=_e(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Sr(y.target)&&y.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:`${r}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:d.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:l,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[He]:"","data-testid":`${r}-announcer`})]})};var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return H(s,{testId:o,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":o,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${o}-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:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Ar=({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})),se= 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 Ye=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:s,accessFailure:d}=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, se,{occurrence:e.occurrence,testId:r,children:s.failureSentence(e,o)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:d({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var Or=/\s/,Ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Or.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Xt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let o=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),s=n===void 0?r:Ke(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:s].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:o,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:o,testId:`${a}-error`,children:t})]}),he=({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}),Kr= exports.Field =({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:s,descriptionId:d,errorId:i}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:s.id,hidden:void 0,children:e}),r(s),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:d,errorId:i,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:s,name:d,maxLength:i,list:l,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:o}),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 v=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:Ze(d),maxLength:Xt(i),value:a,list:l,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:K=>r(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:y.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":`${f}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Ur= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e}),Br= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e,type:"password"}),_r= exports.TextArea =({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:s,maxLength:d,required:i,testId:l,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:Ze(s),maxLength:Xt(d),value:a,required:i,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":l,ref:p,...u}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:c,errorId:b,testId:l})]})},qr= exports.Select =({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,name:d,labelHidden:i,unavailable:l,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:o}),f=_react.useId.call(void 0, ),h=X(l,f);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, he,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:Ze(d),value:a,onChange:y=>{l===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":l===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>_jsxruntime.jsx.call(void 0, "option",{value:y.value,children:y.label},y.value))}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),_optionalChain([l, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:l.reason})]})},Gr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,testId:d,ref:i})=>{let l=_react.useId.call(void 0, ),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:l,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:u,errorId:c,testId:d})]})},Vr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:s,testId:d,ref:i})=>{let{control:l,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:o}),c=r.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":l["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":l["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:f.label})]},f.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:p,errorId:u,testId:d})]})};var nn=_react.createContext.call(void 0, null),Yt="surface",Zt={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"}},Qt={face:"info-tint",line:"info-accent"},rn={normal:"border-control",high:"info-accent"},jr=["normal","high"],Yr=[1,2,3,4],A=_chunkWUST5VT6cjs.t.space["space-2"],Zr="fg",Qr="fg-secondary",on=e=>{let t=_react.useContext.call(void 0, nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Qe=(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}`)},eo= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:s,children:d}=e;Qe(r,"widthPx",o),Qe(r,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),l=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:jr.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:i.arrowIds[b],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, nn.Provider,{value:i,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!_chunkWUST5VT6cjs.f.call(void 0, b))throw new RangeError(`${r}: 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":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${o} ${a}`,"data-cui-figure":"group","data-cui-surface":Yt,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-block":_chunkWUST5VT6cjs.M.call(void 0, a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(s),children:l})})}let{viewBox:p,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${o} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Yt,"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":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(s),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:l})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},to=(e,t,n)=>{for(let o of t){let a=_chunk7M4I26BScjs.d.light[o.fg],r=n.find(s=>a[s]===void 0);if(r!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(o.text)} in ${o.fg} is not in the contrast table on ${r}, a face the node takes`)}},no= exports.FigureNode =e=>{g();let t=on("FigureNode"),n=_react.useId.call(void 0, ),{x:o,y:a,shape:r,tone:s,outline:d,selected:i,name:l,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(o)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${o}, ${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&&!_chunkWUST5VT6cjs.f.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?Qt:Zt[s];to(c,m,[Zt[s].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(l===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=en(c,()=>_chunkWUST5VT6cjs.G.call(void 0, {name:l,notes:m.map(k=>k.text)}));if(Qe(c,"a box's widthPx",r.widthPx),r.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${r.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:r.widthPx,height:T.heightPx,left:o,top:a};let v=_chunkWUST5VT6cjs.H.call(void 0, m.length);y=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":f.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:_chunkWUST5VT6cjs.t.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:_chunkWUST5VT6cjs.t.type.body.size,"data-cui-fg":Zr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:l}),m.map((k,K)=>_jsxruntime.jsx.call(void 0, "text",{x:v.insetPx,y:v.notesPx[K],fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkWUST5VT6cjs.K,y:-_chunkWUST5VT6cjs.K,width:r.widthPx+2*_chunkWUST5VT6cjs.K,height:T.heightPx+2*_chunkWUST5VT6cjs.K,rx:_chunkWUST5VT6cjs.t.radius["radius-item"]+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=en(c,()=>_chunkWUST5VT6cjs.I.call(void 0, l,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":f.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),l===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkWUST5VT6cjs.t.type.caption.lineHeight/2,fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":Qr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:l})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:r.radiusPx+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<_chunkWUST5VT6cjs.q||h.height<_chunkWUST5VT6cjs.q)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkWUST5VT6cjs.q} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkWUST5VT6cjs.J||h.top<_chunkWUST5VT6cjs.J||h.left+h.width+_chunkWUST5VT6cjs.J>t.widthPx||h.top+h.height+_chunkWUST5VT6cjs.J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkWUST5VT6cjs.J} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":s,"data-cui-outline":d,"data-selected":String(i),...R,"data-testid":c,...w(b),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":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ro= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:s})=>{g();let d=on("FigureEdge");if(!Yr.includes(n))throw new RangeError(`${r}: 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:o?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":rn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":r,...w(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var oo={1:"h1",2:"h2",3:"h3"},ao= exports.Heading =({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=oo[e];return _jsxruntime.jsx.call(void 0, r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:o,tabIndex:o===void 0?void 0:-1,children:a})};var so={removed:"danger-tint",added:"success-tint"},lo= 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":so[e],"data-cui-fg":"fg","data-testid":t,children:n})};var co={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"}},po={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},et= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?co[e]:{fg:"on-solid",surface:po[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":n,...w(o),children:a})};var tt=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=_react.useId.call(void 0, );if(o!==null){if(!(Number.isFinite(o)&&o>0))throw new RangeError(`Progress maximum must be positive: ${o}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=o===null?null:{max:o,now:Math.min(n,o)};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:r,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"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 go=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>_jsxruntime.jsxs.call(void 0, qe,{title:e,actions:o===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.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, et,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, tt,{...n,testId:`${a}-progress`}),r]});var nt=_react.createContext.call(void 0, null),Ro="space-2",To= exports.List =e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:s}=e;if(n!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, n))throw new RangeError(`${r}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let d=e.marker==="none"?void 0:e.type,i=d!==void 0,l=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, nt.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, l,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Ro:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:s})})},Eo= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let o=_react.useContext.call(void 0, nt);if(o===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,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, nt.Provider,{value:null,children:n})})})};var ln=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ge);return n===null||!e.contains(n)}),xo=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=ln(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},wo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},Po= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=C(),l=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let y=r.ref.current;l.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let y=c.current;c.current=!1;let E=l.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=wo(R,E.shown),v=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(l.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=_react.useCallback.call(void 0, (y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=_react.useCallback.call(void 0, (y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);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:h,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:f,testId:`${s}-button`,children:i.loadMore(_chunkWUST5VT6cjs.a.call(void 0, a,d))}),o===null?null:_jsxruntime.jsx.call(void 0, se,{occurrence:o.occurrence,testId:`${s}-failure`,children:i.loadFailed(o.reason)})]})};var Co=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=_chunkWUST5VT6cjs.O.call(void 0, {masterMinPx:n,detailMinPx:o,gapPx:_chunkWUST5VT6cjs.t.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:r.key,css:r.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":r.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 we=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:s,unit:d}=e;if(d!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let i=_chunkWUST5VT6cjs.a.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:_chunkWUST5VT6cjs.c.call(void 0, i,d)})}let{text:a,keep:r}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!_chunkWUST5VT6cjs.f.call(void 0, a))throw new RangeError(`${o}: 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":r,"data-testid":o,children:a})};var ko=({label:e,value:t,min:n,max:o,valueText:a,testId:r})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(o)&&n<o))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${o}`);if(!(Number.isFinite(t)&&t>=n&&t<=o))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${o}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":r,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${r}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};var Io={ArrowLeft:-1,ArrowRight:1},$o= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:s})=>{g();let d=_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 l=t.map(f=>f.id);if(new Set(l).size!==l.length)throw new RangeError(`Tab keys must be unique: ${l.join(", ")}`);let p=l.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${l.join(", ")}`);let u=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(h.id),_optionalChain([i, '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:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Io[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:s})]})};var Do=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:s}=C(),d=_jsxruntime.jsx.call(void 0, Ye,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?s.loadFailed:o,retry:t,testId:`${r}-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":r,children:d},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":r,children:[d,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${r}-reload`,children:s.reload})]})};var Ko=({label:e,options:t,value:n,onValueChange:o,testId:a,density:r="regular"})=>{g();let s=_react.useId.call(void 0, ),d=new Set(t.map(i=>i.value));if(t.length<2||d.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!d.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...d].join(", ")}`);if(r!=="regular"&&r!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(r)}`);return r==="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 l=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":l,"data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"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 l=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":l,"data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:i.label},i.value)})})]})};var pn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:s})=>{g();let d=_react.useRef.call(void 0, null);H(d,{testId:o,part:"row",host:"button"});let i=_react.useCallback.call(void 0, p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":o,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},_o= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:s,rowTestId:d,rowData:i,empty:l,testId:p,ref:u})=>(g(),_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:l}):_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, pn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var Go=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:s,testId:d})=>{g();let i=_react.useId.call(void 0, );if(!([t,n,o,a].every(Number.isFinite)&&n<o&&a>0&&n<=t&&t<=o))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${o}, step ${a}`);let l=r(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-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:o,step:a,value:t,"aria-valuetext":l,"data-testid":d,onChange:p=>s(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:`${d}-value`,children:l})})]})]})};var fn={done:0,current:1,pending:2},Vo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Wo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:o}=C();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,s)=>s>0&&fn[r.state]<fn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let a={done:o.stepDone,current:null,pending:o.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((r,s)=>{let d=Vo[r.state],i=a[r.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};var Xo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:s,dataAttributes:d})=>{g();let i=_react.useId.call(void 0, ),l=_react.useRef.call(void 0, null);H(l,{testId:r,part:"label",host:"button"});let p=X(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":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:s,onClick:()=>{u||o(!n)},...w(d),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:l,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:`${r}-reason`,children:a.reason})]})};var ea=({label:e,items:t,currentId:n,onNavigate:o,testId:a,collapsible:r=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let d=t.find(m=>m.id===n);if(d===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,l]=_react.useState.call(void 0, !1),p=_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, m=>{l(!1),m&&_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(!(r&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[r,i,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&i?"":void 0,onKeyDown:r&&i?m=>_(m,()=>b(!0)):void 0,children:[r?_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:()=>l(m=>!m),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:d.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":r?"surface":void 0,children:t.map(m=>{let f=m.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};var oa={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},aa= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:o,testId:a,dataAttributes:r}=e;if((e.text===void 0?e.value===null:e.text===null)&&o!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${o}`);let d=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),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":oa[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, we,{value:e.value,unit:e.unit,testId:d}):_jsxruntime.jsx.call(void 0, we,{text:e.text,keep:"wrap",testId:d})})]})},Rn=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?Rn(t.props.children):[t]}),ia= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=_chunkWUST5VT6cjs.R.call(void 0, e,t,_chunkWUST5VT6cjs.t.space["space-2"]),r=Rn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, j,{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:o})]})};var ke=e=>[...e.querySelectorAll("button")],da= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let o=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=ke(o.current),l=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(i[0], () => (null));a.current=l;for(let p of i)p.tabIndex=p===l?0:-1});let r=i=>{for(let l of ke(o.current))l.tabIndex=l===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:o,onFocus:i=>{let l=ke(i.currentTarget).find(p=>p.contains(i.target));l!==void 0&&r(l)},onKeyDown:i=>{let l=ke(i.currentTarget),p=l.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%l.length,[c]:(p-1+l.length)%l.length,Home:0,End:l.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=l[m];r(f),f.focus()},children:n})};var ca=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 vn=e=>e===null?_chunkWUST5VT6cjs.V:_chunkWUST5VT6cjs.W,Se=(e,t,n,o,a)=>{let[r,s]=_react.useState.call(void 0, ()=>({key:e,state:vn(e)})),[d,i]=_react.useState.call(void 0, 0),[l,p]=_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, d);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkWUST5VT6cjs.V});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,s(v=>Object.is(v.key,e)?{key:e,state:o(v.state,T)}:{key:e,state:_chunkWUST5VT6cjs.W}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,d,l]);let m=_react.useCallback.call(void 0, ()=>i(R=>R+1),[]),f=_react.useCallback.call(void 0, ()=>p(R=>R+1),[]),h=_react.useCallback.call(void 0, (R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=_react.useCallback.call(void 0, (R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:vn(e),reload:m,refresh:f,update:h,write:y}};var ma=(e,t,n)=>{let o=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{o.current=t});let a=_react.useCallback.call(void 0, y=>o.current.first(y),[]),{state:r,reload:s,refresh:d,update:i,write:l}=Se(e,a,n,_chunkWUST5VT6cjs.Z,_chunkWUST5VT6cjs._),p=_react.useRef.call(void 0, {key:e,state:r});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:r}});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]),m=_react.useCallback.call(void 0, ()=>{c(),d()},[c,d]),f=_react.useCallback.call(void 0, ()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,_chunkWUST5VT6cjs.$),o.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((K,wn)=>_chunkWUST5VT6cjs.ba.call(void 0, K,wn),_chunkWUST5VT6cjs.aa.call(void 0, k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=_react.useCallback.call(void 0, (y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),l(y,T=>_chunkWUST5VT6cjs.ba.call(void 0, T,E))},[l]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};var Ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ta= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),o=_react.useCallback.call(void 0, (a,r)=>{let s=r();if(!Ra(s))return;let d=Symbol(a);n.current=d,t(a);let i=()=>{n.current===d&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:o}};var va=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:s}=Se(e,t,n,_chunkWUST5VT6cjs.X,_chunkWUST5VT6cjs.Y),d=_react.useCallback.call(void 0, (i,l)=>s(i,p=>_chunkWUST5VT6cjs.Y.call(void 0, p,{ok:!0,value:l})),[s]);return{state:o,reload:a,refresh:r,put:d}};var xa=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = pe; exports.AccessFailureNotice = Qn; exports.AlertMessage = se; exports.Breadcrumb = er; exports.Button = I; exports.COMPACT_ROW_PX = _chunkWUST5VT6cjs.s; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkWUST5VT6cjs.m; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.Card = qe; exports.CardSection = ir; exports.CheckboxGroup = Vr; exports.Cluster = Be; exports.CodeBlock = dr; exports.ComparisonGrid = cr; exports.ConsoleUiRoot = $n; exports.DataTable = Pr; exports.DescriptionList = Nr; exports.Dialog = Mr; exports.Disclosure = Fr; exports.FIGURE_RING_REACH_PX = _chunkWUST5VT6cjs.J; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkWUST5VT6cjs.A; exports.FailureMessage = Ye; exports.Field = Kr; exports.Figure = eo; exports.FigureEdge = ro; exports.FigureNode = no; exports.FragmentLink = Wn; exports.HTTP_FORBIDDEN = _chunkWUST5VT6cjs.S; exports.Heading = ao; exports.InlineChange = lo; exports.JobCard = go; exports.LATTICE_PX = _chunkWUST5VT6cjs.o; exports.Link = Gn; exports.List = To; exports.ListItem = Eo; exports.LoadMore = Po; exports.MasterDetail = Co; exports.Measured = we; exports.Meter = ko; exports.MetricTile = aa; exports.Notice = Ar; exports.PanelTabs = $o; exports.PasswordInput = Br; exports.Pill = et; exports.ProgressBar = tt; exports.ROW_WITH_CONTROL_PX = _chunkWUST5VT6cjs.r; exports.RadioGroup = Gr; exports.ResourceFailed = Do; exports.RowButton = pn; exports.SegmentedControl = Ko; exports.Select = qr; exports.SelectableList = _o; exports.Slider = Go; exports.Stack = Jn; exports.Stepper = Wo; exports.Switch = Xo; exports.TARGET_PX = _chunkWUST5VT6cjs.q; exports.TOKENS = _chunkWUST5VT6cjs.t; exports.TONES = _chunkWUST5VT6cjs.ga; exports.TONE_HUES = _chunkWUST5VT6cjs.ea; exports.TONE_ROLES = _chunkWUST5VT6cjs.fa; exports.Tabs = ea; exports.Text = P; exports.TextArea = _r; exports.TextInput = Ur; exports.TileGrid = ia; exports.Toolbar = da; exports.VisuallyHidden = xa; exports.ZonedTimeError = _chunkWUST5VT6cjs.g; exports.beginPage = _chunkWUST5VT6cjs.$; exports.beginPagedReload = _chunkWUST5VT6cjs.Z; exports.beginReload = _chunkWUST5VT6cjs.X; exports.ceil8 = _chunkWUST5VT6cjs.x; exports.ceilToLattice = _chunkWUST5VT6cjs.p; exports.cellContentInlinePx = _chunkWUST5VT6cjs.y; exports.comparisonAttributePx = _chunkWUST5VT6cjs.B; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkWUST5VT6cjs.D; exports.cssVar = _chunkWUST5VT6cjs.u; exports.figureBoxPlan = _chunkWUST5VT6cjs.G; exports.figureDiscLabelPlan = _chunkWUST5VT6cjs.I; exports.fillLabel = _chunkWUST5VT6cjs.k; exports.fixedColumnPx = _chunkWUST5VT6cjs.z; exports.flatMapOutcome = _chunkWUST5VT6cjs.U; exports.formatByteSize = _chunkWUST5VT6cjs.b; exports.formatCount = _chunkWUST5VT6cjs.a; exports.formatInstant = _chunkWUST5VT6cjs.j; exports.goldenSectionPx = _chunkWUST5VT6cjs.L; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkWUST5VT6cjs.C; exports.isReadableText = _chunkWUST5VT6cjs.f; exports.keepLastGood = _chunkWUST5VT6cjs.Y; exports.lightDark = _chunkWUST5VT6cjs.ca; exports.mapOutcome = _chunkWUST5VT6cjs.T; exports.mapPagedList = _chunkWUST5VT6cjs.ba; exports.masterDetailPlan = _chunkWUST5VT6cjs.N; exports.monoTextWidthEm = _chunkWUST5VT6cjs.w; exports.placeholderRule = _chunkWUST5VT6cjs.da; exports.pxToRem = _chunkWUST5VT6cjs.M; exports.readDecimalText = _chunkWUST5VT6cjs.d; exports.readIntegerText = _chunkWUST5VT6cjs.e; exports.reasonAside = _chunkWUST5VT6cjs.l; exports.resolveConsoleUiLabels = _chunkWUST5VT6cjs.n; exports.settleFirstPage = _chunkWUST5VT6cjs._; exports.settlePage = _chunkWUST5VT6cjs.aa; exports.spacedTextWidthEm = _chunkWUST5VT6cjs.F; exports.tableFrameMinInlinePx = _chunkWUST5VT6cjs.Q; exports.tableMinInlinePx = _chunkWUST5VT6cjs.P; exports.textWidthEm = _chunkWUST5VT6cjs.v; exports.tileGridPlan = _chunkWUST5VT6cjs.R; exports.tileMinInlinePx = _chunkWUST5VT6cjs.E; exports.toOffsetIso = _chunkWUST5VT6cjs.h; exports.toWallTime = _chunkWUST5VT6cjs.i; exports.useAccessFailure = Fn; exports.useAnnounce = Oe; exports.useConsoleUi = C; exports.useEscapeToClose = or; exports.useFailureOccurrence = ca; exports.useFocusRescue = ae; exports.usePagedResource = ma; exports.usePendingPress = Ta; exports.useResource = va;
package/dist/index.d.cts CHANGED
@@ -559,8 +559,9 @@ type SegmentedControlProps = {
559
559
  readonly value: string;
560
560
  readonly onValueChange: (value: string) => void;
561
561
  readonly testId: string;
562
+ readonly density?: "regular" | "compact";
562
563
  };
563
- declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
564
+ declare const SegmentedControl: ({ label, options, value, onValueChange, testId, density }: SegmentedControlProps) => react.JSX.Element;
564
565
  type RowButtonProps = {
565
566
  readonly selected: boolean;
566
567
  readonly controls: string;
@@ -689,6 +690,7 @@ type ToolbarProps = {
689
690
  };
690
691
  declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
691
692
  declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
693
+ declare const useFailureOccurrence: (failure: object | null) => number;
692
694
  declare const useFocusRescue: (getTarget: (lost: HTMLElement) => HTMLElement | null) => ((node: HTMLElement | null) => () => void);
693
695
  type PagedLoaders<T, C, M> = {
694
696
  readonly first: (signal: AbortSignal) => Promise<ResourceOutcome<KeysetPage<T, C, M>>>;
@@ -719,4 +721,4 @@ type VisuallyHiddenProps = {
719
721
  readonly children: ReactNode;
720
722
  };
721
723
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
722
- export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, usePendingPress, useResource };
724
+ export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
package/dist/index.d.ts CHANGED
@@ -559,8 +559,9 @@ type SegmentedControlProps = {
559
559
  readonly value: string;
560
560
  readonly onValueChange: (value: string) => void;
561
561
  readonly testId: string;
562
+ readonly density?: "regular" | "compact";
562
563
  };
563
- declare const SegmentedControl: ({ label, options, value, onValueChange, testId }: SegmentedControlProps) => react.JSX.Element;
564
+ declare const SegmentedControl: ({ label, options, value, onValueChange, testId, density }: SegmentedControlProps) => react.JSX.Element;
564
565
  type RowButtonProps = {
565
566
  readonly selected: boolean;
566
567
  readonly controls: string;
@@ -689,6 +690,7 @@ type ToolbarProps = {
689
690
  };
690
691
  declare const Toolbar: ({ label, testId, children }: ToolbarProps) => react.JSX.Element;
691
692
  declare const useEscapeToClose: (onClose: () => void) => ((event: KeyboardEvent<HTMLElement>) => void);
693
+ declare const useFailureOccurrence: (failure: object | null) => number;
692
694
  declare const useFocusRescue: (getTarget: (lost: HTMLElement) => HTMLElement | null) => ((node: HTMLElement | null) => () => void);
693
695
  type PagedLoaders<T, C, M> = {
694
696
  readonly first: (signal: AbortSignal) => Promise<ResourceOutcome<KeysetPage<T, C, M>>>;
@@ -719,4 +721,4 @@ type VisuallyHiddenProps = {
719
721
  readonly children: ReactNode;
720
722
  };
721
723
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
722
- export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFocusRescue, usePagedResource, usePendingPress, useResource };
724
+ export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$ as xt,A as Ua,B as Ba,C as _a,D as qa,E as Ga,F as Va,G as yt,H as ft,I as mt,J as z,K as U,L as Wa,M as F,N as za,O as gt,P as bt,Q as Ja,R as ht,S as Xa,T as ja,U as Ya,V as Me,W as Ie,X as Rt,Y as Fe,Z as Tt,_ as Et,a as ue,aa as vt,b as xa,ba as $e,c as ut,ca as ti,d as va,da as ni,e as wa,ea as ri,f as D,fa as oi,g as Pa,ga as ai,h as Na,i as Ca,j as ka,k as La,l as Sa,m as Ma,n as ct,o as Se,p as Ia,q as W,r as Fa,s as pt,t as M,u as $a,v as Aa,w as Da,x as Ha,y as Oa,z as Ka}from"./chunk-H4DAGEIG.js";import{a as Za,b as Qa,c as ei,d as wt}from"./chunk-FXEGLGL7.js";import{useEffect as Jn,useRef as Xn}from"react";import{useId as Un,useRef as Bn}from"react";import{createContext as wn,useCallback as Pn,useContext as St,useLayoutEffect as Nn,useMemo as Pt,useRef as Nt}from"react";import{jsx as Lt,jsxs as $n}from"react/jsx-runtime";var Ae=wn(null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",De="data-cui-dialog-announcer",Cn=`:scope > [${De}]`,kn=e=>{if(e.closest(Ct)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(It)],o=t.activeElement,a=n.filter(s=>s.contains(o)),r=a.length>0?a:n;if(r.every(s=>s.contains(e)))return{region:e};let i=r.find(s=>r.every(u=>u.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=i.querySelector(Cn);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(Ct)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Ln=e=>{try{e.querySelectorAll(It)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce=150,Sn=1e3,kt=new WeakMap,Mn=(e,t)=>{let n=kt.get(e)??new Set,o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},In=({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(St(Ae)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof o!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");let d=ct(e),[s]=Intl.getCanonicalLocales(t),u=Pt(()=>new Intl.DateTimeFormat(s,{timeZone:n}).resolvedOptions().timeZone,[s,n]),p=Nt(null),l=Nt(null);Nn(()=>{Ln(p.current.ownerDocument)},[]);let c=Pn(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=l.current;l.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let x=y.join(Mt),k=kn(T);if("hidden"in k)throw new Error(`announce: the live region is hidden from assistive technology (${k.hidden}), so this announcement would be lost: ${x}`);Mn(k.region,x)},h=l.current;if(h===null){l.current={texts:[m],settle:setTimeout(f,ce),deadline:setTimeout(f,Sn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,ce)},[]),b=Pt(()=>({locale:e,formatLocale:s,timeZone:u,labels:d,announce:c,accessFailure:o}),[e,s,u,d,c,o]);return Lt(Ae.Provider,{value:b,children:$n("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,Lt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C=()=>{let e=St(Ae);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},He=()=>C().announce,Fn=()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var pe=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as An}from"react";var Dn=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"]),Hn=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Dn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{An(()=>{let a=Hn(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${o} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as On}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:i,tabIndex:d,ref:s,children:u})=>(g(),On(o,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":o==="p"?"reading":void 0,"data-testid":r,id:i,tabIndex:d,ref:s,children:u}));var Kn=/\s/,Oe=(e,t)=>{if(e===""||Kn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(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 Oe(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as O,jsxs as Wn}from"react/jsx-runtime";var _n={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"}},Ke=({subject:e,children:t})=>{let n=Bn(null);return H(n,e),O("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:o="button",onClick:a,unavailable:r,describedBy:i,expanded:d,controls:s,ref:u,dataAttributes:p,busy:l,busyLabel:c})=>{g();let b=Un(),m=J(r,b),f=l===!0||r!==void 0,h=_n[e],y=E=>{if(pe(E),f){E.preventDefault();return}a?.(E)};return Wn("span",{className:"cui-button-group",children:[O("button",{className:"cui-button",type:o==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":l===!0?!0:void 0,"aria-describedby":B(i,m),"aria-expanded":d,"aria-controls":s,onClick:y,ref:u,...w(p),children:O(Ke,{subject:{testId:n,part:"label",host:"button"},children:l===!0?c:t})}),r?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},qn=({onNavigate:e,children:t,testId:n,ref:o})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:O(Ke,{subject:{testId:n,part:"label",host:"button"},children:t})})),Gn=/^[^\s#]+$/,Vn=({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Gn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:o,...w(a),children:O(Ke,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ft}from"react/jsx-runtime";var zn=({gap:e,testId:t,children:n})=>(g(),Ft("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ue=({gap:e,as:t="div",testId:n,children:o})=>(g(),Ft(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));import{jsx as ye,jsxs as $t}from"react/jsx-runtime";var jn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Yn=" ",Zn=({view:e,handlers:t,testId:n})=>{let o=He(),a=e.actions.map(({action:d,label:s})=>{let u=t[d];if(u===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:s,handler:u}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Yn):null,i=Xn(null);return Jn(()=>{r===null||i.current===r||(i.current=r,o(r))},[o,r]),$t("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[$t("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:[ye("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(d=>ye("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:ye(Ue,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:s,handler:u})=>ye(I,{variant:jn.has(d)?"primary":"secondary",onClick:u,testId:`${n}-${d}`,children:s},d))})]})};var fe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as te,jsxs as At}from"react/jsx-runtime";var Qn=({items:e,current:t,onNavigate:n,testId:o})=>{let{labels:a}=C();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return te("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:At("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>At("li",{className:"cui-breadcrumb-item",children:[te("a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:i=>fe(i,r.href,n),children:r.label}),te("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),te("li",{className:"cui-breadcrumb-item",children:te("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${o}-current`,children:t})})]})})};import{useId as Dt}from"react";import{useCallback as er}from"react";var tr=229,nr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),me=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&nr.has(e.type)&&(e.value!==""||e.validity.badInput),Be=e=>e.nativeEvent.isComposing||e.keyCode===tr,_=(e,t)=>{e.key!=="Escape"||Be(e)||me(e.target)||(e.stopPropagation(),t())},rr=e=>er(t=>_(t,e),[e]);import{Fragment as ir,jsx as q,jsxs as ne}from"react/jsx-runtime";var Ht=e=>e===void 0?void 0:t=>_(t,e),_e=({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:i,ref:d,dataAttributes:s,children:u})=>{g();let p=Dt(),l=Ht(a);return ne("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":r,ref:d,onKeyDown:l,...w(s),children:[ne("div",{className:"cui-card-header",children:[ne("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${r}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),o===void 0?null:q("div",{className:"cui-card-actions",children:o})]}),u]})},or={3:"h3",4:"h4"},ar=({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:i,headingRef:d,ref:s,dataAttributes:u,children:p})=>{g();let l=Dt(),c=Ht(r),b=or[o],m=ne(ir,{children:[ne("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:l,"data-cui-type":"body","data-testid":`${i}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":l,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:m}):q("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:m})};import{jsx as Ot}from"react/jsx-runtime";var sr=({label:e,code:t,testId:n})=>(g(),Ot("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:Ot("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 lr}from"react";import{jsx as dr}from"react/jsx-runtime";var X=({ruleKey:e,css:t})=>dr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as G}from"react/jsx-runtime";var ur=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let i=lr();for(let l of[o,a])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of n)for(let c of t)if(!Object.hasOwn(l.cells,c.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${c.key}"`);let d=o+n.length*a,s=`cui-comparison-a${o}-c${a}-n${n.length}`,u=l=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${l}"]`,p=`${u("table")}{display:none}@container (min-width:${F(d)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[L(X,{ruleKey:s,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[L("col",{style:{width:F(o)}}),n.map(l=>L("col",{},l.key))]}),L("thead",{children:G("tr",{children:[L("td",{}),n.map(l=>L("th",{scope:"col",children:l.heading},l.key))]})}),L("tbody",{children:t.map(l=>G("tr",{children:[L("th",{scope:"row",children:l.label}),n.map(c=>L("td",{children:c.cells[l.key]("table")},c.key))]},l.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((l,c)=>{let b=`${i}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:l.heading}),L("dl",{className:"cui-comparison-list",children:t.map(m=>G("div",{children:[L("dt",{children:m.label}),L("dd",{children:l.cells[m.key]("stack")})]},m.key))})]},l.key)})})]})};import{Fragment as mr,useCallback as gr,useId as br,useLayoutEffect as Bt,useRef as We}from"react";var re="[data-cui-row-focus]",qe="[data-cui-row-detail]",cr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],Kt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let o=-1;for(let a of e===null?[]:e.children)a.matches(re)?(o+=1,n.set(a,o)):o>=0&&a.matches(qe)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=cr(t);if(a.length===0)return n;let r=o.get(e);if(r===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(r,a.length-1)]};import{useCallback as pr,useLayoutEffect as Ge,useReducer as yr,useRef as Ve}from"react";var fr=e=>e+1,oe=e=>{let t=Ve(e),n=Ve(null),o=Ve(!1),[,a]=yr(fr,0),r=pr((i=>()=>{o.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return Ge(()=>(o.current=!0,()=>{o.current=!1,n.current=null}),[]),Ge(()=>{t.current=e}),Ge(()=>{let i=n.current;if(i===null)return;n.current=null;let d=[null,document.body].includes(document.activeElement);i.isConnected||!d||t.current(i)?.focus()}),r};import{jsx as S,jsxs as ge}from"react/jsx-runtime";var hr=new Map,Rr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Tr=(e,t,n)=>{Bt(()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Rr)].find(r=>r.parentElement!==o);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${W} px target does not fit its ${pt} px; use row-control), not <${a.localName}>`)})},Er=(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 o=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(o!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${o.key}`)},xr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),vr=(e,t,n,o,a)=>{let r=e.open(t);return S("tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},wr=({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:i,rowSize:d,rowDetail:s,empty:u,testId:p,ref:l})=>{g();let c=br(),b=We(null);Tr(b,d,p);let m=We(null),f=We(hr),h=oe(R=>Ut(R,b.current,m.current,f.current));Bt(()=>{f.current=Kt(b.current,m.current)});let y=gr(R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=bt(n);return Er(n,p),S("div",{className:"cui-container","data-testid":p,ref:l,children:o.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:u}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:ge("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(R=>S("col",{style:R.width.fixedPx===void 0?void 0:{width:F(R.width.fixedPx)}},R.key))}),S("thead",{children:S("tr",{children:n.map(R=>ge("th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:S("div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),S("tbody",{ref:b,children:o.map(R=>ge(mr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...w(i?.(R)),children:n.map(T=>T.rowHeader===!0?ge("th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),s===void 0?null:vr(s,R,n.length,r,h)]},a(R)))})]})})})};import{jsx as ze,jsxs as Nr}from"react/jsx-runtime";var Pr=({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 ze("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Nr("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 _t,useLayoutEffect as qt,useRef as Je}from"react";import{jsx as ae,jsxs as Vt}from"react/jsx-runtime";var Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Cr=(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},kr=(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")},Lr=e=>e instanceof HTMLInputElement&&e.type==="search",Sr=({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:i})=>{let{labels:d}=C(),s=_t(),u=_t(),p=Je(null),l=Je(null),c=Je(!1);return qt(()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Cr(y,a.current);l.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&kr(y,E)}else!n&&y.open&&y.close()},[n,a]),qt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(l.current),l.current=null)}},[]),Vt("dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:p,onClose:y=>{y.currentTarget.open||(Gt(l.current),l.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||me(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=Be(y);c.current=E,y.key==="Escape"&&!E&&me(y.target)&&!Lr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[Vt("div",{className:"cui-dialog-header",children:[ae("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),ae("div",{className:"cui-dialog-actions",children:ae(I,{variant:"secondary",testId:`${r}-close`,onClick:()=>p.current?.close(),children:d.close})})]}),t===void 0?null:ae("div",{id:u,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),i,ae("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[De]:"","data-testid":`${r}-announcer`})]})};import{useId as Mr,useRef as Ir}from"react";import{jsx as Xe,jsxs as Wt}from"react/jsx-runtime";var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=Mr(),i=Ir(null);return H(i,{testId:o,part:"summary",host:"button"}),Wt("div",{className:"cui-disclosure","data-testid":o,children:[Wt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${o}-button`,onClick:()=>n(!t),children:[Xe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Xe("span",{ref:i,children:e})]}),Xe("div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ar}from"@aiquants/auth-core";import{Fragment as Dr}from"react";import{jsx as zt}from"react/jsx-runtime";var $r=({tone:e,testId:t,children:n})=>(g(),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})),ie=({occurrence:e,testId:t,children:n})=>(g(),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 Jt}from"react/jsx-runtime";var je=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:i,accessFailure:d}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let s=e.status===null?null:Ar(e.status);return s===null?Jt(ie,{occurrence:e.occurrence,testId:r,children:i.failureSentence(e,o)}):Jt(Dr,{children:d({kind:s,place:t,deniedSentence:s==="forbidden"?i.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as j}from"react";import{Fragment as Vr,jsx as v,jsxs as $}from"react/jsx-runtime";var Hr=/\s/,Ye=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Hr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Xt=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},Y=({description:e,error:t,errorId:n})=>{g();let o=j(),a=j(),r=j(),i=n===void 0?r:Oe(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:o,testId:a})=>$(Vr,{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:o,testId:`${a}-error`,children:t})]}),be=({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}),Or=({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:i,descriptionId:d,errorId:s}=Y({label:e,description:t,error:n,errorId:o});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[v(be,{htmlFor:i.id,hidden:void 0,children:e}),r(i),v(Z,{description:t,error:n,descriptionId:d,errorId:s,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:i,name:d,maxLength:s,list:u,autoComplete:p,inputMode:l,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Y({label:e,description:t,error:n,errorId:o}),T=j();if(c!==void 0&&c.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 x=i==="password",k=v("input",{className:"cui-input",type:i,name:Ye(d),maxLength:Xt(s),value:a,list:u,autoComplete:p,inputMode:l,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:m,onChange:K=>r(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[v(be,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:$("div",{className:"cui-input-group",children:[v("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),v(Z,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Kr=e=>v(jt,{...e}),Ur=e=>v(jt,{...e,type:"password"}),Br=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:i,maxLength:d,required:s,testId:u,ref:p})=>{let{control:l,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:o});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[v(be,{htmlFor:l.id,hidden:void 0,children:e}),v("textarea",{className:"cui-input cui-textarea",name:Ye(i),maxLength:Xt(d),value:a,required:s,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...l}),v(Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},_r=({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,name:d,labelHidden:s,unavailable:u,testId:p,ref:l})=>{let{control:c,descriptionId:b,errorId:m}=Y({label:e,description:t,error:n,errorId:o}),f=j(),h=J(u,f);return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[v(be,{htmlFor:c.id,hidden:s,children:e}),v("select",{className:"cui-input",name:Ye(d),value:a,onChange:y=>{u===void 0&&i(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:l,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>v("option",{value:y.value,children:y.label},y.value))}),v(Z,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),u?.reason===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:u.reason})]})},qr=({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,testId:d,ref:s})=>{let u=j(),{control:p,descriptionId:l,errorId:c}=Y({label:e,description:t,error:n,errorId:o});return $("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>$("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?s:void 0}),v("span",{children:b.label})]},b.value)),v(Z,{description:t,error:n,descriptionId:l,errorId:c,testId:d})]})},Gr=({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:i,testId:d,ref:s})=>{let{control:u,descriptionId:p,errorId:l}=Y({label:e,description:t,error:n,errorId:o}),c=r.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return $("fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[v("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>$("label",{className:"cui-checkbox","data-cui-type":"body",children:[v("input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>i(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":u["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?s:void 0}),v("span",{children:f.label})]},f.value)),v(Z,{description:t,error:n,descriptionId:p,errorId:l,testId:d})]})};import{createContext as Wr,useContext as zr,useId as tn,useMemo as Jr}from"react";import{Fragment as an,jsx as N,jsxs as he}from"react/jsx-runtime";var nn=Wr(null),Yt="surface",Zt={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"}},Qt={face:"info-tint",line:"info-accent"},rn={normal:"border-control",high:"info-accent"},Xr=["normal","high"],jr=[1,2,3,4],A=M.space["space-2"],Yr="fg",Zr="fg-secondary",on=e=>{let t=zr(nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Ze=(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}`)},Qr=e=>{g();let t=tn(),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:i,children:d}=e;Ze(r,"widthPx",o),Ze(r,"heightPx",a);let s=Jr(()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),u=he(an,{children:[N("defs",{children:Xr.map(b=>N("marker",{id:s.arrowIds[b],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),N(nn.Provider,{value:s,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!D(b))throw new RangeError(`${r}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${r}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${o} ${a}`,"data-cui-figure":"group","data-cui-surface":Yt,"data-cui-face":"sans",style:{"--cui-figure-inline":F(o),"--cui-figure-block":F(a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(i),children:u})})}let{viewBox:p,pointer:l,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${r}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${o} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Yt,"data-cui-face":"sans","data-cui-pan":l===void 0?void 0:"true","data-cui-cursor":l?.cursor,style:{"--cui-figure-inline":F(o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(i),...l?.handlers,children:u})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},eo=(e,t,n)=>{for(let o of t){let a=wt.light[o.fg],r=n.find(i=>a[i]===void 0);if(r!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(o.text)} in ${o.fg} is not in the contrast table on ${r}, a face the node takes`)}},to=e=>{g();let t=on("FigureNode"),n=tn(),{x:o,y:a,shape:r,tone:i,outline:d,selected:s,name:u,title:p,press:l,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(o)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${o}, ${a}`);if(t.kind==="group"&&l===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&l!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(l!==void 0&&!D(l.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(l.label)}`);let f=s?Qt:Zt[i];eo(c,m,[Zt[i].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(u===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=en(c,()=>yt({name:u,notes:m.map(k=>k.text)}));if(Ze(c,"a box's widthPx",r.widthPx),r.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${r.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:r.widthPx,height:T.heightPx,left:o,top:a};let x=ft(m.length);y=he("g",{"data-cui-surface":f.face,children:[N("rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:M.type.body.size,"data-cui-fg":Yr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),m.map((k,K)=>N("text",{x:x.insetPx,y:x.notesPx[K],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:r.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=en(c,()=>mt(u,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=he(an,{children:[N("g",{"data-cui-surface":f.face,children:N("circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),u===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":Zr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=N("circle",{className:"cui-figure-ring",r:r.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(l!==void 0){if(h.width<W||h.height<W)throw new RangeError(`${c}: a pressable node must be at least the ${W} px target: ${h.width} \xD7 ${h.height}`);if(h.left<z||h.top<z||h.left+h.width+z>t.widthPx||h.top+h.height+z>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${z} px to the figure's edge for its focus ring`)}let R=l===void 0?{}:{role:"button",tabIndex:0,"aria-label":l.label,"aria-describedby":l.description===void 0?void 0:n,"aria-expanded":l.expanded,"aria-controls":l.expanded?l.controls:void 0,onClick:T=>{T.currentTarget.focus(),l.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||l.onPress())}};return he("g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":i,"data-cui-outline":d,"data-selected":String(s),...R,"data-testid":c,...w(b),children:[p===void 0?null:N("title",{children:p}),l?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:l.description}),l===void 0?null:E,y]})},no=({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:i})=>{g();let d=on("FigureEdge");if(!jr.includes(n))throw new RangeError(`${r}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:o?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":rn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":r,...w(i),children:a===void 0?null:N("title",{children:a})})};import{jsx as ao}from"react/jsx-runtime";var ro={1:"h1",2:"h2",3:"h3"},oo=({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=ro[e];return ao(r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:o,tabIndex:o===void 0?void 0:-1,children:a})};import{jsx as lo}from"react/jsx-runtime";var io={removed:"danger-tint",added:"success-tint"},so=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return lo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":io[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as po}from"react/jsx-runtime";var uo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},co={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Qe=({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?uo[e]:{fg:"on-solid",surface:co[e]};return po("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":n,...w(o),children:a})};import{useId as yo}from"react";import{jsx as se,jsxs as fo}from"react/jsx-runtime";var et=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=yo();if(o!==null){if(!(Number.isFinite(o)&&o>0))throw new RangeError(`Progress maximum must be positive: ${o}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let i=o===null?null:{max:o,now:Math.min(n,o)};return fo("div",{className:"cui-progress","data-testid":a,children:[se(P,{as:"p",fg:"fg",type:"body",id:r,children:e}),se("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"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:se("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`})}),se("div",{"aria-hidden":"true",children:se(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as Re,jsxs as sn}from"react/jsx-runtime";var mo=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>sn(_e,{title:e,actions:o===void 0?void 0:Re(I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.label}),testId:a,children:[sn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[Re("span",{className:"cui-visually-hidden",children:`${e} `}),Re(Qe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:Re(et,{...n,testId:`${a}-progress`}),r]});import{createContext as go,useContext as bo}from"react";import{jsx as de}from"react/jsx-runtime";var tt=go(null),ho="space-2",Ro=e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:i}=e;if(n!==void 0&&!D(n))throw new RangeError(`${r}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let d=e.marker==="none"?void 0:e.type,s=d!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return de(tt.Provider,{value:e.marker,children:de(u,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?ho:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:i})})},To=({testId:e,dataAttributes:t,children:n})=>{g();let o=bo(tt);if(o===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return de("li",{className:"cui-list-item","data-testid":e,...w(t),children:de("div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:de(tt.Provider,{value:null,children:n})})})};import{useCallback as dn,useLayoutEffect as Eo,useRef as Te}from"react";import{jsx as Ee,jsxs as Po}from"react/jsx-runtime";var ln=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(qe);return n===null||!e.contains(n)}),xo=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=ln(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${re} elements for ${e.count} rows`);return n},vo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},wo=({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:i})=>{let{formatLocale:d,labels:s}=C(),u=Te(null),p=Te(null),l=Te(null),c=Te(!1),b=()=>{let y=r.ref.current;u.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};Eo(()=>{let y=c.current;c.current=!1;let E=u.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=vo(R,E.shown),x=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(u.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||y&&k)&&T.focus()});let m=oe(()=>n?p.current:l.current),f=dn((y=>{l.current=y;let E=m(y);return()=>{l.current=null,c.current=y===document.activeElement,E()}}),[m]),h=dn((y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?Ee("div",{className:"cui-load-more","data-testid":i,children:Ee(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):Po("div",{className:"cui-load-more","data-testid":i,children:[Ee(I,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:b,ref:f,testId:`${i}-button`,children:s.loadMore(ue(a,d))}),o===null?null:Ee(ie,{occurrence:o.occurrence,testId:`${i}-failure`,children:s.loadFailed(o.reason)})]})};import{jsx as nt,jsxs as un}from"react/jsx-runtime";var No=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=gt({masterMinPx:n,detailMinPx:o,gapPx:M.space["space-6"]});return un("div",{className:"cui-container","data-testid":a,children:[nt(X,{ruleKey:r.key,css:r.css}),un("div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[nt("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),nt("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as xe}from"react/jsx-runtime";var ve=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:i,unit:d}=e;if(d!==void 0&&!D(d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(i===null)return xe("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let s=ue(i,t);return xe("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:ut(s,d)})}let{text:a,keep:r}=e;if(a===null)return xe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!D(a))throw new RangeError(`${o}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return xe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":r,"data-testid":o,children:a})};import{jsx as we,jsxs as ko}from"react/jsx-runtime";var Co=({label:e,value:t,min:n,max:o,valueText:a,testId:r})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(o)&&n<o))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${o}`);if(!(Number.isFinite(t)&&t>=n&&t<=o))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${o}`);return ko("span",{className:"cui-meter","data-testid":r,children:[we("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${r}-bar`,children:we("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),we("span",{"aria-hidden":"true",children:we(P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};import{useId as Lo,useRef as So}from"react";import{jsx as rt,jsxs as Fo}from"react/jsx-runtime";var Mo={ArrowLeft:-1,ArrowRight:1},Io=({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:i})=>{g();let d=Lo(),s=So(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let u=t.map(f=>f.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let l=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(h.id),s.current.get(h.id)?.focus()};return Fo("div",{className:"cui-panel-tabs","data-testid":a,children:[rt("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>s.current.get(T.id)===f.target),y=h<0?p:h,E=Mo[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return rt("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:l(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?s.current.delete(f.id):s.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),rt("div",{role:"tabpanel",id:c,"aria-labelledby":l(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:i})]})};import{accessFailureKindOfStatus as $o}from"@aiquants/auth-core";import{jsx as ot,jsxs as Do}from"react/jsx-runtime";var Ao=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:i}=C(),d=ot(je,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?i.loadFailed:o,retry:t,testId:`${r}-alert`});return e.status!==null&&$o(e.status)!==null?ot("div",{className:"cui-resource-failed",ref:a,"data-testid":r,children:d},e.occurrence):Do("div",{className:"cui-resource-failed","data-testid":r,children:[d,ot(I,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${r}-reload`,children:i.reload})]})};import{jsx as at,jsxs as Oo}from"react/jsx-runtime";var Ho=({label:e,options:t,value:n,onValueChange:o,testId:a})=>{g();let r=new Set(t.map(i=>i.value));if(t.length<2||r.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!r.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...r].join(", ")}`);return Oo("fieldset",{className:"cui-segmented-group","data-testid":a,children:[at("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),at("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return at("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||o(i.value)},children:i.label},i.value)})})]})};import{useCallback as Ko,useRef as Uo}from"react";import{jsx as Q}from"react/jsx-runtime";var cn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:i})=>{g();let d=Uo(null);H(d,{testId:o,part:"row",host:"button"});let s=Ko(p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return Q("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":o,onClick:p=>{pe(p),n()},ref:s,...w(a),children:i})},Bo=({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:i,rowTestId:d,rowData:s,empty:u,testId:p,ref:l})=>(g(),Q("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?Q(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):Q("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return Q("li",{children:Q(cn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:s?.(c),children:i(c)})},b)})})}));import{useId as _o}from"react";import{jsx as Pe,jsxs as pn}from"react/jsx-runtime";var qo=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:i,testId:d})=>{g();let s=_o();if(!([t,n,o,a].every(Number.isFinite)&&n<o&&a>0&&n<=t&&t<=o))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${o}, step ${a}`);let u=r(t);return pn("div",{className:"cui-field","data-testid":`${d}-field`,children:[Pe("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),pn("div",{className:"cui-slider",children:[Pe("input",{className:"cui-slider-input",id:s,type:"range",min:n,max:o,step:a,value:t,"aria-valuetext":u,"data-testid":d,onChange:p=>i(p.currentTarget.valueAsNumber)}),Pe("span",{className:"cui-slider-value","aria-hidden":"true",children:Pe(P,{fg:"fg",type:"body",testId:`${d}-value`,children:u})})]})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var yn={done:0,current:1,pending:2},Go={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Vo=({label:e,steps:t,testId:n})=>{let{labels:o}=C();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,i)=>i>0&&yn[r.state]<yn[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let a={done:o.stepDone,current:null,pending:o.stepPending};return it("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((r,i)=>{let d=Go[r.state],s=a[r.state];return fn("li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[it("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":i+1}),fn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,s===null?null:it("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},r.id)})})};import{useId as Wo,useRef as zo}from"react";import{jsx as Ne,jsxs as mn}from"react/jsx-runtime";var Jo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:i,dataAttributes:d})=>{g();let s=Wo(),u=zo(null);H(u,{testId:r,part:"label",host:"button"});let p=J(a,s),l=a!==void 0,c=mn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":l?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:i,onClick:()=>{l||o(!n)},...w(d),children:[Ne("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:Ne("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ne("span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,children:e})]});return a?.reason===void 0?c:mn("span",{className:"cui-button-group",children:[c,Ne(P,{fg:"fg-muted",type:"body",id:s,testId:`${r}-reason`,children:a.reason})]})};import{useCallback as Xo,useEffect as jo,useId as Yo,useRef as gn,useState as Zo}from"react";import{jsx as le,jsxs as bn}from"react/jsx-runtime";var Qo=({label:e,items:t,currentId:n,onNavigate:o,testId:a,collapsible:r=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(m=>m.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let d=t.find(m=>m.id===n);if(d===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...i].join(", ")}`);let[s,u]=Zo(!1),p=gn(null),l=gn(null),c=Yo(),b=Xo(m=>{u(!1),m&&p.current?.contains(document.activeElement)&&l.current?.focus()},[]);return jo(()=>{if(!(r&&s))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[r,s,b]),bn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&s?"":void 0,onKeyDown:r&&s?m=>_(m,()=>b(!0)):void 0,children:[r?bn("button",{ref:l,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(m=>!m),children:[le("span",{className:"cui-tabs-summary-label",children:d.label}),le("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,le("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":r?"surface":void 0,children:t.map(m=>{let f=m.id===n;return le("li",{className:"cui-tabs-item",children:le("a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{fe(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};import{Children as ea,Fragment as ta,isValidElement as na}from"react";import{jsx as V,jsxs as Rn}from"react/jsx-runtime";var ra={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},oa=e=>{g();let{label:t,sublabel:n,tone:o,testId:a,dataAttributes:r}=e;if((e.text===void 0?e.value===null:e.text===null)&&o!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${o}`);let d=`${a}-value`;return Rn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),children:[V("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),V("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),V("p",{className:"cui-tile-value","data-cui-fg":ra[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?V(ve,{value:e.value,unit:e.unit,testId:d}):V(ve,{text:e.text,keep:"wrap",testId:d})})]})},hn=e=>ea.toArray(e).flatMap(t=>{if(!na(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===ta?hn(t.props.children):[t]}),aa=({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=ht(e,t,M.space["space-2"]),r=hn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return Rn("div",{className:"cui-container","data-testid":n,children:[V(X,{ruleKey:a.key,css:a.css}),V("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:o})]})};import{useLayoutEffect as ia,useRef as Tn}from"react";import{jsx as da}from"react/jsx-runtime";var Ce=e=>[...e.querySelectorAll("button")],sa=({label:e,testId:t,children:n})=>{g();let o=Tn(null),a=Tn(null);ia(()=>{let s=Ce(o.current),u=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let r=s=>{for(let u of Ce(o.current))u.tabIndex=u===s?0:-1;a.current=s};return da("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:o,onFocus:s=>{let u=Ce(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&r(u)},onKeyDown:s=>{let u=Ce(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let l=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=l==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[l]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(m===void 0)return;s.preventDefault();let f=u[m];r(f),f.focus()},children:n})};import{useCallback as ee,useEffect as ca,useLayoutEffect as xn,useRef as lt}from"react";import{useCallback as ke,useEffect as la,useLayoutEffect as ua,useRef as st,useState as dt}from"react";var En=e=>e===null?Me:Ie,Le=(e,t,n,o,a)=>{let[r,i]=dt(()=>({key:e,state:En(e)})),[d,s]=dt(0),[u,p]=dt(0),l=st(t),c=st(null),b=st(d);ua(()=>{l.current=t}),la(()=>{if(e===null){i({key:null,state:Me});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,i(x=>Object.is(x.key,e)?{key:e,state:o(x.state,T)}:{key:e,state:Ie}),l.current(R.signal).then(x=>{R.signal.aborted||(c.current=null,i(k=>({key:e,state:a(k.state,x)})))},x=>{R.signal.aborted||i(()=>{throw x})}),()=>{R.abort(),c.current=null}},[e,n,d,u]);let m=ke(()=>s(R=>R+1),[]),f=ke(()=>p(R=>R+1),[]),h=ke((R,T)=>{i(x=>Object.is(x.key,R)?{key:R,state:T(x.state)}:x)},[]),y=ke((R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:En(e),reload:m,refresh:f,update:h,write:y}};var pa=(e,t,n)=>{let o=lt(t);xn(()=>{o.current=t});let a=ee(y=>o.current.first(y),[]),{state:r,reload:i,refresh:d,update:s,write:u}=Le(e,a,n,Tt,Et),p=lt({key:e,state:r});xn(()=>{p.current={key:e,state:r}});let l=lt(null),c=ee(()=>{l.current?.controller.abort(),l.current=null},[]);ca(()=>c,[e,n,c]);let b=ee(()=>{c(),i()},[c,i]),m=ee(()=>{c(),d()},[c,d]),f=ee(()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};l.current=T,s(y,xt),o.current.next(R,T.controller.signal).then(x=>{l.current===T&&(l.current=null,s(y,k=>T.maps.reduce((K,vn)=>$e(K,vn),vt(k,R,x))))},x=>{l.current===T&&s(y,()=>{throw x})})},[s]),h=ee((y,E)=>{let R=l.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),u(y,T=>$e(T,E))},[u]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};import{useCallback as ya,useRef as fa,useState as ma}from"react";var ga=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",ba=()=>{let[e,t]=ma(null),n=fa(null),o=ya((a,r)=>{let i=r();if(!ga(i))return;let d=Symbol(a);n.current=d,t(a);let s=()=>{n.current===d&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:o}};import{useCallback as ha}from"react";var Ra=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:i}=Le(e,t,n,Rt,Fe),d=ha((s,u)=>i(s,p=>Fe(p,{ok:!0,value:u})),[i]);return{state:o,reload:a,refresh:r,put:d}};import{jsx as Ea}from"react/jsx-runtime";var Ta=({testId:e,children:t})=>(g(),Ea("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,Zn as AccessFailureNotice,ie as AlertMessage,Qn as Breadcrumb,I as Button,pt as COMPACT_ROW_PX,Ma as CONSOLE_UI_LABEL_CATALOGS,ei as CONTRAST_MINIMUM,wt as CONTRAST_PAIRS,_e as Card,ar as CardSection,Gr as CheckboxGroup,Ue as Cluster,sr as CodeBlock,ur as ComparisonGrid,In as ConsoleUiRoot,wr as DataTable,Pr as DescriptionList,Sr as Dialog,Fr as Disclosure,z as FIGURE_RING_REACH_PX,Ua as FLEXIBLE_COLUMN_MIN_PX,je as FailureMessage,Or as Field,Qr as Figure,no as FigureEdge,to as FigureNode,Vn as FragmentLink,Xa as HTTP_FORBIDDEN,oo as Heading,so as InlineChange,mo as JobCard,Se as LATTICE_PX,qn as Link,Ro as List,To as ListItem,wo as LoadMore,No as MasterDetail,ve as Measured,Co as Meter,oa as MetricTile,$r as Notice,Io as PanelTabs,Ur as PasswordInput,Qe as Pill,et as ProgressBar,Fa as ROW_WITH_CONTROL_PX,qr as RadioGroup,Ao as ResourceFailed,cn as RowButton,Ho as SegmentedControl,_r as Select,Bo as SelectableList,qo as Slider,zn as Stack,Vo as Stepper,Jo as Switch,W as TARGET_PX,M as TOKENS,ai as TONES,ri as TONE_HUES,oi as TONE_ROLES,Qo as Tabs,P as Text,Br as TextArea,Kr as TextInput,aa as TileGrid,sa as Toolbar,Ta as VisuallyHidden,Pa as ZonedTimeError,xt as beginPage,Tt as beginPagedReload,Rt as beginReload,Ha as ceil8,Ia as ceilToLattice,Oa as cellContentInlinePx,Ba as comparisonAttributePx,Qa as contrastRatio,qa as countSampleText,$a as cssVar,yt as figureBoxPlan,mt as figureDiscLabelPlan,La as fillLabel,Ka as fixedColumnPx,Ya as flatMapOutcome,xa as formatByteSize,ue as formatCount,ka as formatInstant,Wa as goldenSectionPx,Za as hexToSrgb,_a as instantSampleText,D as isReadableText,Fe as keepLastGood,ti as lightDark,ja as mapOutcome,$e as mapPagedList,za as masterDetailPlan,Da as monoTextWidthEm,ni as placeholderRule,F as pxToRem,va as readDecimalText,wa as readIntegerText,Sa as reasonAside,ct as resolveConsoleUiLabels,Et as settleFirstPage,vt as settlePage,Va as spacedTextWidthEm,Ja as tableFrameMinInlinePx,bt as tableMinInlinePx,Aa as textWidthEm,ht as tileGridPlan,Ga as tileMinInlinePx,Na as toOffsetIso,Ca as toWallTime,Fn as useAccessFailure,He as useAnnounce,C as useConsoleUi,rr as useEscapeToClose,oe as useFocusRescue,pa as usePagedResource,ba as usePendingPress,Ra as useResource};
1
+ import{$ as vt,A as qa,B as Ga,C as Va,D as Wa,E as za,F as Ja,G as yt,H as ft,I as mt,J,K as U,L as Xa,M as $,N as ja,O as gt,P as bt,Q as Ya,R as ht,S as Za,T as Qa,U as ei,V as Ie,W as $e,X as Rt,Y as Fe,Z as Tt,_ as Et,a as ce,aa as xt,b as Pa,ba as Ae,c as ut,ca as oi,d as Na,da as ai,e as Ca,ea as ii,f as D,fa as si,g as ka,ga as di,h as La,i as Sa,j as Ma,k as Ia,l as $a,m as Fa,n as ct,o as Me,p as Aa,q as z,r as Da,s as pt,t as M,u as Ha,v as Oa,w as Ka,x as Ua,y as Ba,z as _a}from"./chunk-H4DAGEIG.js";import{a as ti,b as ni,c as ri,d as wt}from"./chunk-FXEGLGL7.js";import{useEffect as Xn,useRef as jn}from"react";import{useId as Bn,useRef as _n}from"react";import{createContext as Pn,useCallback as Nn,useContext as St,useLayoutEffect as Cn,useMemo as Pt,useRef as Nt}from"react";import{jsx as Lt,jsxs as An}from"react/jsx-runtime";var De=Pn(null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",He="data-cui-dialog-announcer",kn=`:scope > [${He}]`,Ln=e=>{if(e.closest(Ct)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(It)],o=t.activeElement,a=n.filter(i=>i.contains(o)),r=a.length>0?a:n;if(r.every(i=>i.contains(e)))return{region:e};let s=r.find(i=>r.every(l=>l.contains(i)));if(s===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=s.querySelector(kn);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(Ct)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Sn=e=>{try{e.querySelectorAll(It)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe=150,Mn=1e3,kt=new WeakMap,In=(e,t)=>{let n=kt.get(e)??new Set,o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},$n=({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(St(De)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof o!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");let d=ct(e),[i]=Intl.getCanonicalLocales(t),l=Pt(()=>new Intl.DateTimeFormat(i,{timeZone:n}).resolvedOptions().timeZone,[i,n]),p=Nt(null),u=Nt(null);Cn(()=>{Sn(p.current.ownerDocument)},[]);let c=Nn(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=u.current;u.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let v=y.join(Mt),k=Ln(T);if("hidden"in k)throw new Error(`announce: the live region is hidden from assistive technology (${k.hidden}), so this announcement would be lost: ${v}`);In(k.region,v)},h=u.current;if(h===null){u.current={texts:[m],settle:setTimeout(f,pe),deadline:setTimeout(f,Mn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,pe)},[]),b=Pt(()=>({locale:e,formatLocale:i,timeZone:l,labels:d,announce:c,accessFailure:o}),[e,i,l,d,c,o]);return Lt(De.Provider,{value:b,children:An("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,Lt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C=()=>{let e=St(De);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Oe=()=>C().announce,Fn=()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as Dn}from"react";var Hn=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"]),On=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Hn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{Dn(()=>{let a=On(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${o} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as Kn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:s,tabIndex:d,ref:i,children:l})=>(g(),Kn(o,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":o==="p"?"reading":void 0,"data-testid":r,id:s,tabIndex:d,ref:i,children:l}));var Un=/\s/,Ke=(e,t)=>{if(e===""||Un.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ke(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as O,jsxs as zn}from"react/jsx-runtime";var qn={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"}},Ue=({subject:e,children:t})=>{let n=_n(null);return H(n,e),O("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:o="button",onClick:a,unavailable:r,describedBy:s,expanded:d,controls:i,ref:l,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=Bn(),m=X(r,b),f=u===!0||r!==void 0,h=qn[e],y=E=>{if(ye(E),f){E.preventDefault();return}a?.(E)};return zn("span",{className:"cui-button-group",children:[O("button",{className:"cui-button",type:o==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":d,"aria-controls":i,onClick:y,ref:l,...w(p),children:O(Ue,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),r?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},Gn=({onNavigate:e,children:t,testId:n,ref:o})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:O(Ue,{subject:{testId:n,part:"label",host:"button"},children:t})})),Vn=/^[^\s#]+$/,Wn=({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Vn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:o,...w(a),children:O(Ue,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as $t}from"react/jsx-runtime";var Jn=({gap:e,testId:t,children:n})=>(g(),$t("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Be=({gap:e,as:t="div",testId:n,children:o})=>(g(),$t(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));import{jsx as fe,jsxs as Ft}from"react/jsx-runtime";var Yn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Zn=" ",Qn=({view:e,handlers:t,testId:n})=>{let o=Oe(),a=e.actions.map(({action:d,label:i})=>{let l=t[d];if(l===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:i,handler:l}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Zn):null,s=jn(null);return Xn(()=>{r===null||s.current===r||(s.current=r,o(r))},[o,r]),Ft("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ft("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[fe("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(d=>fe("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:fe(Be,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:i,handler:l})=>fe(I,{variant:Yn.has(d)?"primary":"secondary",onClick:l,testId:`${n}-${d}`,children:i},d))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ne,jsxs as At}from"react/jsx-runtime";var er=({items:e,current:t,onNavigate:n,testId:o})=>{let{labels:a}=C();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return ne("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:At("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>At("li",{className:"cui-breadcrumb-item",children:[ne("a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:s=>me(s,r.href,n),children:r.label}),ne("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),ne("li",{className:"cui-breadcrumb-item",children:ne("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${o}-current`,children:t})})]})})};import{useId as Dt}from"react";import{useCallback as tr}from"react";var nr=229,rr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&rr.has(e.type)&&(e.value!==""||e.validity.badInput),_e=e=>e.nativeEvent.isComposing||e.keyCode===nr,_=(e,t)=>{e.key!=="Escape"||_e(e)||ge(e.target)||(e.stopPropagation(),t())},or=e=>tr(t=>_(t,e),[e]);import{Fragment as sr,jsx as q,jsxs as re}from"react/jsx-runtime";var Ht=e=>e===void 0?void 0:t=>_(t,e),qe=({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:s,ref:d,dataAttributes:i,children:l})=>{g();let p=Dt(),u=Ht(a);return re("section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onKeyDown:u,...w(i),children:[re("div",{className:"cui-card-header",children:[re("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${r}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),o===void 0?null:q("div",{className:"cui-card-actions",children:o})]}),l]})},ar={3:"h3",4:"h4"},ir=({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:s,headingRef:d,ref:i,dataAttributes:l,children:p})=>{g();let u=Dt(),c=Ht(r),b=ar[o],m=re(sr,{children:[re("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(l),children:m}):q("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(l),children:m})};import{jsx as Ot}from"react/jsx-runtime";var dr=({label:e,code:t,testId:n})=>(g(),Ot("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:Ot("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 ur}from"react";import{jsx as lr}from"react/jsx-runtime";var j=({ruleKey:e,css:t})=>lr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as G}from"react/jsx-runtime";var cr=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let s=ur();for(let u of[o,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 d=o+n.length*a,i=`cui-comparison-a${o}-c${a}-n${n.length}`,l=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${l("table")}{display:none}@container (min-width:${$(d)}){${l("table")}{display:block}${l("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[L(j,{ruleKey:i,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[L("col",{style:{width:$(o)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:G("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>G("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(m=>G("div",{children:[L("dt",{children:m.label}),L("dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};import{Fragment as gr,useCallback as br,useId as hr,useLayoutEffect as Bt,useRef as ze}from"react";var oe="[data-cui-row-focus]",Ge="[data-cui-row-detail]",pr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Kt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let o=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(o+=1,n.set(a,o)):o>=0&&a.matches(Ge)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=pr(t);if(a.length===0)return n;let r=o.get(e);if(r===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(r,a.length-1)]};import{useCallback as yr,useLayoutEffect as Ve,useReducer as fr,useRef as We}from"react";var mr=e=>e+1,ae=e=>{let t=We(e),n=We(null),o=We(!1),[,a]=fr(mr,0),r=yr((s=>()=>{o.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return Ve(()=>(o.current=!0,()=>{o.current=!1,n.current=null}),[]),Ve(()=>{t.current=e}),Ve(()=>{let s=n.current;if(s===null)return;n.current=null;let d=[null,document.body].includes(document.activeElement);s.isConnected||!d||t.current(s)?.focus()}),r};import{jsx as S,jsxs as be}from"react/jsx-runtime";var Rr=new Map,Tr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Er=(e,t,n)=>{Bt(()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Tr)].find(r=>r.parentElement!==o);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 ${pt} px; use row-control), not <${a.localName}>`)})},vr=(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 o=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(o!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${o.key}`)},xr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),wr=(e,t,n,o,a)=>{let r=e.open(t);return S("tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},Pr=({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:s,rowSize:d,rowDetail:i,empty:l,testId:p,ref:u})=>{g();let c=hr(),b=ze(null);Er(b,d,p);let m=ze(null),f=ze(Rr),h=ae(R=>Ut(R,b.current,m.current,f.current));Bt(()=>{f.current=Kt(b.current,m.current)});let y=br(R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=bt(n);return vr(n,p),S("div",{className:"cui-container","data-testid":p,ref:u,children:o.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:l}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:be("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":$(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(R=>S("col",{style:R.width.fixedPx===void 0?void 0:{width:$(R.width.fixedPx)}},R.key))}),S("thead",{children:S("tr",{children:n.map(R=>be("th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:S("div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),S("tbody",{ref:b,children:o.map(R=>be(gr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...w(s?.(R)),children:n.map(T=>T.rowHeader===!0?be("th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:wr(i,R,n.length,r,h)]},a(R)))})]})})})};import{jsx as Je,jsxs as Cr}from"react/jsx-runtime";var Nr=({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 Je("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Cr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Je("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Je("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as _t,useLayoutEffect as qt,useRef as Xe}from"react";import{jsx as ie,jsxs as Vt}from"react/jsx-runtime";var Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},kr=(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},Lr=(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")},Sr=e=>e instanceof HTMLInputElement&&e.type==="search",Mr=({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:s})=>{let{labels:d}=C(),i=_t(),l=_t(),p=Xe(null),u=Xe(null),c=Xe(!1);return qt(()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:kr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Lr(y,E)}else!n&&y.open&&y.close()},[n,a]),qt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(u.current),u.current=null)}},[]),Vt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:l,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:p,onClose:y=>{y.currentTarget.open||(Gt(u.current),u.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=_e(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Sr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[Vt("div",{className:"cui-dialog-header",children:[ie("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ie("div",{className:"cui-dialog-actions",children:ie(I,{variant:"secondary",testId:`${r}-close`,onClick:()=>p.current?.close(),children:d.close})})]}),t===void 0?null:ie("div",{id:l,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),s,ie("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[He]:"","data-testid":`${r}-announcer`})]})};import{useId as Ir,useRef as $r}from"react";import{jsx as je,jsxs as Wt}from"react/jsx-runtime";var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=Ir(),s=$r(null);return H(s,{testId:o,part:"summary",host:"button"}),Wt("div",{className:"cui-disclosure","data-testid":o,children:[Wt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${o}-button`,onClick:()=>n(!t),children:[je("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),je("span",{ref:s,children:e})]}),je("div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};import{accessFailureKindOfStatus as Dr}from"@aiquants/auth-core";import{Fragment as Hr}from"react";import{jsx as zt}from"react/jsx-runtime";var Ar=({tone:e,testId:t,children:n})=>(g(),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})),se=({occurrence:e,testId:t,children:n})=>(g(),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 Jt}from"react/jsx-runtime";var Ye=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:s,accessFailure:d}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Dr(e.status);return i===null?Jt(se,{occurrence:e.occurrence,testId:r,children:s.failureSentence(e,o)}):Jt(Hr,{children:d({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as Y}from"react";import{Fragment as Wr,jsx as x,jsxs as F}from"react/jsx-runtime";var Or=/\s/,Ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Or.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Xt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let o=Y(),a=Y(),r=Y(),s=n===void 0?r:Ke(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:s].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:o,testId:a})=>F(Wr,{children:[e===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:x(P,{as:"p",fg:"danger-fg",type:"body",id:o,testId:`${a}-error`,children:t})]}),he=({htmlFor:e,hidden:t,children:n})=>x("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Kr=({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:s,descriptionId:d,errorId:i}=Z({label:e,description:t,error:n,errorId:o});return F("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[x(he,{htmlFor:s.id,hidden:void 0,children:e}),r(s),x(Q,{description:t,error:n,descriptionId:d,errorId:i,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:s,name:d,maxLength:i,list:l,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:o}),T=Y();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=x("input",{className:"cui-input",type:s,name:Ze(d),maxLength:Xt(i),value:a,list:l,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:K=>r(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return F("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[x(he,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:F("div",{className:"cui-input-group",children:[x("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),x(Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Ur=e=>x(jt,{...e}),Br=e=>x(jt,{...e,type:"password"}),_r=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:s,maxLength:d,required:i,testId:l,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:o});return F("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${l}-field`,children:[x(he,{htmlFor:u.id,hidden:void 0,children:e}),x("textarea",{className:"cui-input cui-textarea",name:Ze(s),maxLength:Xt(d),value:a,required:i,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":l,ref:p,...u}),x(Q,{description:t,error:n,descriptionId:c,errorId:b,testId:l})]})},qr=({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,name:d,labelHidden:i,unavailable:l,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:o}),f=Y(),h=X(l,f);return F("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[x(he,{htmlFor:c.id,hidden:i,children:e}),x("select",{className:"cui-input",name:Ze(d),value:a,onChange:y=>{l===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":l===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>x("option",{value:y.value,children:y.label},y.value))}),x(Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),l?.reason===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:l.reason})]})},Gr=({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,testId:d,ref:i})=>{let l=Y(),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:o});return F("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[x("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>F("label",{className:"cui-radio","data-cui-type":"body",children:[x("input",{type:"radio",name:l,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?i:void 0}),x("span",{children:b.label})]},b.value)),x(Q,{description:t,error:n,descriptionId:u,errorId:c,testId:d})]})},Vr=({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:s,testId:d,ref:i})=>{let{control:l,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:o}),c=r.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return F("fieldset",{className:"cui-checkbox-group","aria-describedby":l["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[x("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>F("label",{className:"cui-checkbox","data-cui-type":"body",children:[x("input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":l["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?i:void 0}),x("span",{children:f.label})]},f.value)),x(Q,{description:t,error:n,descriptionId:p,errorId:u,testId:d})]})};import{createContext as zr,useContext as Jr,useId as tn,useMemo as Xr}from"react";import{Fragment as an,jsx as N,jsxs as Re}from"react/jsx-runtime";var nn=zr(null),Yt="surface",Zt={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"}},Qt={face:"info-tint",line:"info-accent"},rn={normal:"border-control",high:"info-accent"},jr=["normal","high"],Yr=[1,2,3,4],A=M.space["space-2"],Zr="fg",Qr="fg-secondary",on=e=>{let t=Jr(nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Qe=(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}`)},eo=e=>{g();let t=tn(),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:s,children:d}=e;Qe(r,"widthPx",o),Qe(r,"heightPx",a);let i=Xr(()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),l=Re(an,{children:[N("defs",{children:jr.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),N(nn.Provider,{value:i,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!D(b))throw new RangeError(`${r}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${r}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${o} ${a}`,"data-cui-figure":"group","data-cui-surface":Yt,"data-cui-face":"sans",style:{"--cui-figure-inline":$(o),"--cui-figure-block":$(a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(s),children:l})})}let{viewBox:p,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${r}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${o} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Yt,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":$(o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(s),...u?.handlers,children:l})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},to=(e,t,n)=>{for(let o of t){let a=wt.light[o.fg],r=n.find(s=>a[s]===void 0);if(r!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(o.text)} in ${o.fg} is not in the contrast table on ${r}, a face the node takes`)}},no=e=>{g();let t=on("FigureNode"),n=tn(),{x:o,y:a,shape:r,tone:s,outline:d,selected:i,name:l,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(o)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${o}, ${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&&!D(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?Qt:Zt[s];to(c,m,[Zt[s].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(l===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=en(c,()=>yt({name:l,notes:m.map(k=>k.text)}));if(Qe(c,"a box's widthPx",r.widthPx),r.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${r.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:r.widthPx,height:T.heightPx,left:o,top:a};let v=ft(m.length);y=Re("g",{"data-cui-surface":f.face,children:[N("rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:M.type.body.size,"data-cui-fg":Zr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:l}),m.map((k,K)=>N("text",{x:v.insetPx,y:v.notesPx[K],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:r.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=en(c,()=>mt(l,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=Re(an,{children:[N("g",{"data-cui-surface":f.face,children:N("circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),l===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":Qr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:l})]}),E=N("circle",{className:"cui-figure-ring",r:r.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<z||h.height<z)throw new RangeError(`${c}: a pressable node must be at least the ${z} px target: ${h.width} \xD7 ${h.height}`);if(h.left<J||h.top<J||h.left+h.width+J>t.widthPx||h.top+h.height+J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${J} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Re("g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":s,"data-cui-outline":d,"data-selected":String(i),...R,"data-testid":c,...w(b),children:[p===void 0?null:N("title",{children:p}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ro=({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:s})=>{g();let d=on("FigureEdge");if(!Yr.includes(n))throw new RangeError(`${r}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:o?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":rn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":r,...w(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as io}from"react/jsx-runtime";var oo={1:"h1",2:"h2",3:"h3"},ao=({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=oo[e];return io(r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:o,tabIndex:o===void 0?void 0:-1,children:a})};import{jsx as uo}from"react/jsx-runtime";var so={removed:"danger-tint",added:"success-tint"},lo=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return uo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":so[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as yo}from"react/jsx-runtime";var co={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"}},po={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},et=({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?co[e]:{fg:"on-solid",surface:po[e]};return yo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":n,...w(o),children:a})};import{useId as fo}from"react";import{jsx as de,jsxs as mo}from"react/jsx-runtime";var tt=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=fo();if(o!==null){if(!(Number.isFinite(o)&&o>0))throw new RangeError(`Progress maximum must be positive: ${o}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=o===null?null:{max:o,now:Math.min(n,o)};return mo("div",{className:"cui-progress","data-testid":a,children:[de(P,{as:"p",fg:"fg",type:"body",id:r,children:e}),de("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:de("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),de("div",{"aria-hidden":"true",children:de(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as Te,jsxs as sn}from"react/jsx-runtime";var go=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>sn(qe,{title:e,actions:o===void 0?void 0:Te(I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.label}),testId:a,children:[sn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[Te("span",{className:"cui-visually-hidden",children:`${e} `}),Te(et,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:Te(tt,{...n,testId:`${a}-progress`}),r]});import{createContext as bo,useContext as ho}from"react";import{jsx as le}from"react/jsx-runtime";var nt=bo(null),Ro="space-2",To=e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:s}=e;if(n!==void 0&&!D(n))throw new RangeError(`${r}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let d=e.marker==="none"?void 0:e.type,i=d!==void 0,l=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return le(nt.Provider,{value:e.marker,children:le(l,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Ro:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:s})})},Eo=({testId:e,dataAttributes:t,children:n})=>{g();let o=ho(nt);if(o===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return le("li",{className:"cui-list-item","data-testid":e,...w(t),children:le("div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:le(nt.Provider,{value:null,children:n})})})};import{useCallback as dn,useLayoutEffect as vo,useRef as Ee}from"react";import{jsx as ve,jsxs as No}from"react/jsx-runtime";var ln=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ge);return n===null||!e.contains(n)}),xo=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=ln(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},wo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},Po=({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=C(),l=Ee(null),p=Ee(null),u=Ee(null),c=Ee(!1),b=()=>{let y=r.ref.current;l.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};vo(()=>{let y=c.current;c.current=!1;let E=l.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=wo(R,E.shown),v=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(l.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=dn((y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=dn((y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?ve("div",{className:"cui-load-more","data-testid":s,children:ve(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${s}-end`,children:i.endOfRecords})}):No("div",{className:"cui-load-more","data-testid":s,children:[ve(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:f,testId:`${s}-button`,children:i.loadMore(ce(a,d))}),o===null?null:ve(se,{occurrence:o.occurrence,testId:`${s}-failure`,children:i.loadFailed(o.reason)})]})};import{jsx as rt,jsxs as un}from"react/jsx-runtime";var Co=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=gt({masterMinPx:n,detailMinPx:o,gapPx:M.space["space-6"]});return un("div",{className:"cui-container","data-testid":a,children:[rt(j,{ruleKey:r.key,css:r.css}),un("div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[rt("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),rt("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as xe}from"react/jsx-runtime";var we=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:s,unit:d}=e;if(d!==void 0&&!D(d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(s===null)return xe("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let i=ce(s,t);return xe("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:ut(i,d)})}let{text:a,keep:r}=e;if(a===null)return xe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!D(a))throw new RangeError(`${o}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return xe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":r,"data-testid":o,children:a})};import{jsx as Pe,jsxs as Lo}from"react/jsx-runtime";var ko=({label:e,value:t,min:n,max:o,valueText:a,testId:r})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(o)&&n<o))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${o}`);if(!(Number.isFinite(t)&&t>=n&&t<=o))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${o}`);return Lo("span",{className:"cui-meter","data-testid":r,children:[Pe("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${r}-bar`,children:Pe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),Pe("span",{"aria-hidden":"true",children:Pe(P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};import{useId as So,useRef as Mo}from"react";import{jsx as ot,jsxs as Fo}from"react/jsx-runtime";var Io={ArrowLeft:-1,ArrowRight:1},$o=({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:s})=>{g();let d=So(),i=Mo(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let l=t.map(f=>f.id);if(new Set(l).size!==l.length)throw new RangeError(`Tab keys must be unique: ${l.join(", ")}`);let p=l.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${l.join(", ")}`);let u=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(h.id),i.current.get(h.id)?.focus()};return Fo("div",{className:"cui-panel-tabs","data-testid":a,children:[ot("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Io[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return ot("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),ot("div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ao}from"@aiquants/auth-core";import{jsx as at,jsxs as Ho}from"react/jsx-runtime";var Do=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:s}=C(),d=at(Ye,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?s.loadFailed:o,retry:t,testId:`${r}-alert`});return e.status!==null&&Ao(e.status)!==null?at("div",{className:"cui-resource-failed",ref:a,"data-testid":r,children:d},e.occurrence):Ho("div",{className:"cui-resource-failed","data-testid":r,children:[d,at(I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${r}-reload`,children:s.reload})]})};import{useId as Oo}from"react";import{jsx as V,jsxs as cn}from"react/jsx-runtime";var Ko=({label:e,options:t,value:n,onValueChange:o,testId:a,density:r="regular"})=>{g();let s=Oo(),d=new Set(t.map(i=>i.value));if(t.length<2||d.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!d.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...d].join(", ")}`);if(r!=="regular"&&r!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(r)}`);return r==="compact"?cn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[V("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":l,"data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:V("span",{className:"cui-segment-face","data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):cn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[V("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":l,"data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:i.label},i.value)})})]})};import{useCallback as Uo,useRef as Bo}from"react";import{jsx as ee}from"react/jsx-runtime";var pn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:s})=>{g();let d=Bo(null);H(d,{testId:o,part:"row",host:"button"});let i=Uo(p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return ee("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":o,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},_o=({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:s,rowTestId:d,rowData:i,empty:l,testId:p,ref:u})=>(g(),ee("div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?ee(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:l}):ee("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return ee("li",{children:ee(pn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as qo}from"react";import{jsx as Ne,jsxs as yn}from"react/jsx-runtime";var Go=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:s,testId:d})=>{g();let i=qo();if(!([t,n,o,a].every(Number.isFinite)&&n<o&&a>0&&n<=t&&t<=o))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${o}, step ${a}`);let l=r(t);return yn("div",{className:"cui-field","data-testid":`${d}-field`,children:[Ne("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),yn("div",{className:"cui-slider",children:[Ne("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:o,step:a,value:t,"aria-valuetext":l,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),Ne("span",{className:"cui-slider-value","aria-hidden":"true",children:Ne(P,{fg:"fg",type:"body",testId:`${d}-value`,children:l})})]})]})};import{jsx as it,jsxs as mn}from"react/jsx-runtime";var fn={done:0,current:1,pending:2},Vo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Wo=({label:e,steps:t,testId:n})=>{let{labels:o}=C();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,s)=>s>0&&fn[r.state]<fn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let a={done:o.stepDone,current:null,pending:o.stepPending};return it("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((r,s)=>{let d=Vo[r.state],i=a[r.state];return mn("li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[it("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":s+1}),mn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:it("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};import{useId as zo,useRef as Jo}from"react";import{jsx as Ce,jsxs as gn}from"react/jsx-runtime";var Xo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:s,dataAttributes:d})=>{g();let i=zo(),l=Jo(null);H(l,{testId:r,part:"label",host:"button"});let p=X(a,i),u=a!==void 0,c=gn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:s,onClick:()=>{u||o(!n)},...w(d),children:[Ce("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:Ce("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ce("span",{className:t===!0?"cui-visually-hidden":void 0,ref:l,children:e})]});return a?.reason===void 0?c:gn("span",{className:"cui-button-group",children:[c,Ce(P,{fg:"fg-muted",type:"body",id:i,testId:`${r}-reason`,children:a.reason})]})};import{useCallback as jo,useEffect as Yo,useId as Zo,useRef as bn,useState as Qo}from"react";import{jsx as ue,jsxs as hn}from"react/jsx-runtime";var ea=({label:e,items:t,currentId:n,onNavigate:o,testId:a,collapsible:r=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let d=t.find(m=>m.id===n);if(d===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,l]=Qo(!1),p=bn(null),u=bn(null),c=Zo(),b=jo(m=>{l(!1),m&&p.current?.contains(document.activeElement)&&u.current?.focus()},[]);return Yo(()=>{if(!(r&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[r,i,b]),hn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&i?"":void 0,onKeyDown:r&&i?m=>_(m,()=>b(!0)):void 0,children:[r?hn("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:()=>l(m=>!m),children:[ue("span",{className:"cui-tabs-summary-label",children:d.label}),ue("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,ue("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":r?"surface":void 0,children:t.map(m=>{let f=m.id===n;return ue("li",{className:"cui-tabs-item",children:ue("a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};import{Children as ta,Fragment as na,isValidElement as ra}from"react";import{jsx as W,jsxs as Tn}from"react/jsx-runtime";var oa={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},aa=e=>{g();let{label:t,sublabel:n,tone:o,testId:a,dataAttributes:r}=e;if((e.text===void 0?e.value===null:e.text===null)&&o!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${o}`);let d=`${a}-value`;return Tn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),children:[W("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),W("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),W("p",{className:"cui-tile-value","data-cui-fg":oa[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?W(we,{value:e.value,unit:e.unit,testId:d}):W(we,{text:e.text,keep:"wrap",testId:d})})]})},Rn=e=>ta.toArray(e).flatMap(t=>{if(!ra(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===na?Rn(t.props.children):[t]}),ia=({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=ht(e,t,M.space["space-2"]),r=Rn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return Tn("div",{className:"cui-container","data-testid":n,children:[W(j,{ruleKey:a.key,css:a.css}),W("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:o})]})};import{useLayoutEffect as sa,useRef as En}from"react";import{jsx as la}from"react/jsx-runtime";var ke=e=>[...e.querySelectorAll("button")],da=({label:e,testId:t,children:n})=>{g();let o=En(null),a=En(null);sa(()=>{let i=ke(o.current),l=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=l;for(let p of i)p.tabIndex=p===l?0:-1});let r=i=>{for(let l of ke(o.current))l.tabIndex=l===i?0:-1;a.current=i};return la("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:o,onFocus:i=>{let l=ke(i.currentTarget).find(p=>p.contains(i.target));l!==void 0&&r(l)},onKeyDown:i=>{let l=ke(i.currentTarget),p=l.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%l.length,[c]:(p-1+l.length)%l.length,Home:0,End:l.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=l[m];r(f),f.focus()},children:n})};import{useState as ua}from"react";var ca=e=>{let[t,n]=ua({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as te,useEffect as fa,useLayoutEffect as xn,useRef as lt}from"react";import{useCallback as Le,useEffect as pa,useLayoutEffect as ya,useRef as st,useState as dt}from"react";var vn=e=>e===null?Ie:$e,Se=(e,t,n,o,a)=>{let[r,s]=dt(()=>({key:e,state:vn(e)})),[d,i]=dt(0),[l,p]=dt(0),u=st(t),c=st(null),b=st(d);ya(()=>{u.current=t}),pa(()=>{if(e===null){s({key:null,state:Ie});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,s(v=>Object.is(v.key,e)?{key:e,state:o(v.state,T)}:{key:e,state:$e}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,d,l]);let m=Le(()=>i(R=>R+1),[]),f=Le(()=>p(R=>R+1),[]),h=Le((R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=Le((R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:vn(e),reload:m,refresh:f,update:h,write:y}};var ma=(e,t,n)=>{let o=lt(t);xn(()=>{o.current=t});let a=te(y=>o.current.first(y),[]),{state:r,reload:s,refresh:d,update:i,write:l}=Se(e,a,n,Tt,Et),p=lt({key:e,state:r});xn(()=>{p.current={key:e,state:r}});let u=lt(null),c=te(()=>{u.current?.controller.abort(),u.current=null},[]);fa(()=>c,[e,n,c]);let b=te(()=>{c(),s()},[c,s]),m=te(()=>{c(),d()},[c,d]),f=te(()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,vt),o.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((K,wn)=>Ae(K,wn),xt(k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=te((y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),l(y,T=>Ae(T,E))},[l]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};import{useCallback as ga,useRef as ba,useState as ha}from"react";var Ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ta=()=>{let[e,t]=ha(null),n=ba(null),o=ga((a,r)=>{let s=r();if(!Ra(s))return;let d=Symbol(a);n.current=d,t(a);let i=()=>{n.current===d&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:o}};import{useCallback as Ea}from"react";var va=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:s}=Se(e,t,n,Rt,Fe),d=Ea((i,l)=>s(i,p=>Fe(p,{ok:!0,value:l})),[s]);return{state:o,reload:a,refresh:r,put:d}};import{jsx as wa}from"react/jsx-runtime";var xa=({testId:e,children:t})=>(g(),wa("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{pe as ANNOUNCE_SETTLE_MS,Qn as AccessFailureNotice,se as AlertMessage,er as Breadcrumb,I as Button,pt as COMPACT_ROW_PX,Fa as CONSOLE_UI_LABEL_CATALOGS,ri as CONTRAST_MINIMUM,wt as CONTRAST_PAIRS,qe as Card,ir as CardSection,Vr as CheckboxGroup,Be as Cluster,dr as CodeBlock,cr as ComparisonGrid,$n as ConsoleUiRoot,Pr as DataTable,Nr as DescriptionList,Mr as Dialog,Fr as Disclosure,J as FIGURE_RING_REACH_PX,qa as FLEXIBLE_COLUMN_MIN_PX,Ye as FailureMessage,Kr as Field,eo as Figure,ro as FigureEdge,no as FigureNode,Wn as FragmentLink,Za as HTTP_FORBIDDEN,ao as Heading,lo as InlineChange,go as JobCard,Me as LATTICE_PX,Gn as Link,To as List,Eo as ListItem,Po as LoadMore,Co as MasterDetail,we as Measured,ko as Meter,aa as MetricTile,Ar as Notice,$o as PanelTabs,Br as PasswordInput,et as Pill,tt as ProgressBar,Da as ROW_WITH_CONTROL_PX,Gr as RadioGroup,Do as ResourceFailed,pn as RowButton,Ko as SegmentedControl,qr as Select,_o as SelectableList,Go as Slider,Jn as Stack,Wo as Stepper,Xo as Switch,z as TARGET_PX,M as TOKENS,di as TONES,ii as TONE_HUES,si as TONE_ROLES,ea as Tabs,P as Text,_r as TextArea,Ur as TextInput,ia as TileGrid,da as Toolbar,xa as VisuallyHidden,ka as ZonedTimeError,vt as beginPage,Tt as beginPagedReload,Rt as beginReload,Ua as ceil8,Aa as ceilToLattice,Ba as cellContentInlinePx,Ga as comparisonAttributePx,ni as contrastRatio,Wa as countSampleText,Ha as cssVar,yt as figureBoxPlan,mt as figureDiscLabelPlan,Ia as fillLabel,_a as fixedColumnPx,ei as flatMapOutcome,Pa as formatByteSize,ce as formatCount,Ma as formatInstant,Xa as goldenSectionPx,ti as hexToSrgb,Va as instantSampleText,D as isReadableText,Fe as keepLastGood,oi as lightDark,Qa as mapOutcome,Ae as mapPagedList,ja as masterDetailPlan,Ka as monoTextWidthEm,ai as placeholderRule,$ as pxToRem,Na as readDecimalText,Ca as readIntegerText,$a as reasonAside,ct as resolveConsoleUiLabels,Et as settleFirstPage,xt as settlePage,Ja as spacedTextWidthEm,Ya as tableFrameMinInlinePx,bt as tableMinInlinePx,Oa as textWidthEm,ht as tileGridPlan,za as tileMinInlinePx,La as toOffsetIso,Sa as toWallTime,Fn as useAccessFailure,Oe as useAnnounce,C as useConsoleUi,or as useEscapeToClose,ca as useFailureOccurrence,ae as useFocusRescue,ma as usePagedResource,Ta as usePendingPress,va as useResource};
@@ -1515,6 +1515,57 @@
1515
1515
  border-color: var(--cui-info-solid);
1516
1516
  }
1517
1517
 
1518
+ /* 詰めた組 (補足の操作の帯の 1 行): 名札と的の行は 44 の 1 行に中心で並び、名札の行 20 は上下に 12 ずつ空く。入らなければ的の行が
1519
+ 名札の行の下に付く (行の間 0 で、名札から面までの見える間は横と同じ 8)。描いた legend でなく flex の項目の名札にするのは、WebKit が
1520
+ flex の親の子の float を none と算え、浮かせた legend を行へ入れられないから */
1521
+ .cui-segmented-group[data-cui-density="compact"] {
1522
+ flex-direction: row;
1523
+ flex-wrap: wrap;
1524
+ align-items: center;
1525
+ column-gap: var(--cui-space-2);
1526
+ row-gap: 0;
1527
+ }
1528
+
1529
+ .cui-segmented-label {
1530
+ font-weight: var(--cui-font-weight-regular);
1531
+ overflow-wrap: anywhere;
1532
+ }
1533
+
1534
+ /* 詰めた的は 44 × 44 以上の押せる範囲で、何も描かない (面の役割を持たないので、押していない選択肢の規則がどちらの状態でも透明にする)。
1535
+ 見える面は子の .cui-segment-face */
1536
+ .cui-segmented-group[data-cui-density="compact"] .cui-segment {
1537
+ display: inline-flex;
1538
+ align-items: center;
1539
+ justify-content: center;
1540
+ min-block-size: var(--cui-size-target);
1541
+ padding: 0;
1542
+ border: 0;
1543
+ }
1544
+
1545
+ /* 面は札と同じ外形 (caption の行 20 + 上下 4 = 28、左右 8) で、枠の幅を隣の余白から引く。44 の的の中で上下に 8 ずつ空く */
1546
+ .cui-segment-face {
1547
+ box-sizing: border-box;
1548
+ padding-block: calc(var(--cui-space-1) - var(--cui-border-width));
1549
+ padding-inline: calc(var(--cui-space-2) - var(--cui-border-width));
1550
+ border: var(--cui-border-width) solid var(--cui-border-control);
1551
+ border-radius: var(--cui-radius-control);
1552
+ }
1553
+
1554
+ .cui-segment[aria-pressed="true"] > .cui-segment-face {
1555
+ border-color: var(--cui-info-solid);
1556
+ }
1557
+
1558
+ /* 詰めた組の焦点の輪は面に描く。的の輪郭は共通の輪の規則 (0,4,0) に (0,5,0) で勝って消す (ホストの層の button:focus-visible の輪も、
1559
+ cui の層がその層より上なので消える) */
1560
+ [data-cui-root] .cui-segmented-group[data-cui-density="compact"] .cui-segment:focus-visible {
1561
+ outline: none;
1562
+ }
1563
+
1564
+ .cui-segment:focus-visible > .cui-segment-face {
1565
+ outline: var(--cui-focus-width) solid var(--cui-focus);
1566
+ outline-offset: var(--cui-focus-offset);
1567
+ }
1568
+
1518
1569
  /* 開閉: ボタンは列の全ての幅の 44 の的 (上下 12 + body 20)、区画はその 8 下 (閉じた区画は flex の項目にならず間も出ない) */
1519
1570
  .cui-disclosure {
1520
1571
  display: flex;
@@ -1887,6 +1938,20 @@
1887
1938
  forced-color-adjust: none;
1888
1939
  }
1889
1940
 
1941
+ /* 詰めた組は面が塗りと枠を持つので、上の規則が塗った押した的を透明へ戻す (強制配色でも透明の背景は透明のまま)。forced-color-adjust は
1942
+ 継ぐので auto へ戻し、面だけが自分の塗りを強制から外す */
1943
+ .cui-segmented-group[data-cui-density="compact"] .cui-segment[aria-pressed="true"] {
1944
+ background-color: transparent;
1945
+ forced-color-adjust: auto;
1946
+ }
1947
+
1948
+ .cui-segment[aria-pressed="true"] > .cui-segment-face {
1949
+ border-color: Highlight;
1950
+ background-color: Highlight;
1951
+ color: HighlightText;
1952
+ forced-color-adjust: none;
1953
+ }
1954
+
1890
1955
  .cui-step[aria-current="step"] .cui-step-marker {
1891
1956
  border-color: Highlight;
1892
1957
  background-color: Highlight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
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"