@aiquants/console-ui 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$ as wt,A as za,B as Ja,C as Xa,D as ja,E as Ya,F as Za,G as Qa,H as ei,I as bt,J as ht,K as Rt,L as J,M as U,N as ti,O as F,P as ni,Q as Tt,R as Et,S as ri,T as vt,U as oi,V as ai,W as ii,X as $e,Y as Fe,Z as xt,_ as Ae,a as ct,aa as Pt,b as pt,ba as Nt,c as ce,ca as Ct,d as Ca,da as De,e as yt,ea as si,f as ka,fa as di,g as La,ga as li,h as H,ha as ui,i as Sa,ia as ci,j as Ma,k as Ia,l as $a,m as Fa,n as Aa,o as Da,p as ft,q as Ie,r as Ba,s as z,t as _a,u as gt,v as M,w as qa,x as Ga,y as Va,z as Wa}from"./chunk-K46FVHUL.js";import{a as Ha,e as Oa,f as Ka,g as Ua,h as Me,i as mt}from"./chunk-RA33TN5N.js";import{useEffect as Yn,useRef as Zn}from"react";import{useId as qn,useRef as Gn}from"react";import{createContext as Cn,useCallback as kn,useContext as $t,useLayoutEffect as Ln,useMemo as kt,useRef as Lt}from"react";import{jsx as It,jsxs as Hn}from"react/jsx-runtime";var He=Cn(null),Ft=" ",St='[inert], [aria-hidden="true" i]',Oe="data-cui-dialog-announcer",Sn=`:scope > [${Oe}]`,Mn=e=>{if(e.closest(St)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=pt(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(Sn);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(St)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},In=e=>{try{e.querySelectorAll(ct)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe=150,$n=1e3,Mt=new WeakMap,Fn=(e,t)=>{let n=Mt.get(e)??new Set,r={text:t};Mt.set(e,n.add(r)),setTimeout(()=>n.delete(r),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ft),e.replaceChildren(a)},An=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",testId:o,children:s})=>{if($t(He)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!Me.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${Me.join(", ")}: ${String(a)}`);let i=ft(e),[d]=Intl.getCanonicalLocales(t),p=kt(()=>new Intl.DateTimeFormat(d,{timeZone:n}).resolvedOptions().timeZone,[d,n]),u=Lt(null),c=Lt(null);Ln(()=>{In(u.current.ownerDocument)},[]);let b=kn(f=>{if(f.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let h=()=>{let{texts:E,settle:R,deadline:T}=c.current;c.current=null,clearTimeout(R),clearTimeout(T);let v=u.current;if(v===null)return;let k=E.join(Ft),I=Mn(v);if("hidden"in I)throw new Error(`announce: the live region is hidden from assistive technology (${I.hidden}), so this announcement would be lost: ${k}`);Fn(I.region,k)},y=c.current;if(y===null){c.current={texts:[f],settle:setTimeout(h,pe),deadline:setTimeout(h,$n)};return}y.texts.push(f),clearTimeout(y.settle),y.settle=setTimeout(h,pe)},[]),m=kt(()=>({locale:e,formatLocale:d,timeZone:p,labels:i,announce:b,accessFailure:r}),[e,d,p,i,b,r]);return It(He.Provider,{value:m,children:Hn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":o,children:[s,It("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${o}-announcer`,ref:u})]})})},C=()=>{let e=$t(He);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Ke=()=>C().announce,Dn=()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as On}from"react";var Kn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Un=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Kn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},O=(e,{testId:t,part:n,host:r})=>{On(()=>{let a=Un(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as Bn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),Bn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var _n=/\s/,Ue=(e,t)=>{if(e===""||_n.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ue(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Xn}from"react/jsx-runtime";var Vn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Be=({subject:e,children:t})=>{let n=Gn(null);return O(n,e),K("span",{ref:n,children:t})},$=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=qn(),m=X(o,b),f=u===!0||o!==void 0,h=Vn[e],y=E=>{if(ye(E),f){E.preventDefault();return}a?.(E)};return Xn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":l,"aria-controls":i,onClick:y,ref:d,...w(p),children:K(Be,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Wn=({onNavigate:e,children:t,testId:n,ref:r})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:K(Be,{subject:{testId:n,part:"label",host:"button"},children:t})})),zn=/^[^\s#]+$/,Jn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!zn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:K(Be,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as At}from"react/jsx-runtime";var jn=({gap:e,testId:t,children:n})=>(g(),At("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),_e=({gap:e,as:t="div",testId:n,children:r})=>(g(),At(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as fe,jsxs as Dt}from"react/jsx-runtime";var Qn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),er=" ",tr=({view:e,handlers:t,testId:n})=>{let r=Ke(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(er):null,s=Zn(null);return Yn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Dt("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Dt("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[fe("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>fe("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:fe(_e,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>fe($,{variant:Qn.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ne,jsxs as Ht}from"react/jsx-runtime";var nr=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ne("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Ht("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Ht("li",{className:"cui-breadcrumb-item",children:[ne("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>me(s,o.href,n),children:o.label}),ne("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ne("li",{className:"cui-breadcrumb-item",children:ne("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ot}from"react";import{useCallback as rr}from"react";var or=229,ar=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&ar.has(e.type)&&(e.value!==""||e.validity.badInput),qe=e=>e.nativeEvent.isComposing||e.keyCode===or,_=(e,t)=>{e.key!=="Escape"||qe(e)||ge(e.target)||(e.stopPropagation(),t())},ir=e=>rr(t=>_(t,e),[e]);import{Fragment as lr,jsx as q,jsxs as re}from"react/jsx-runtime";var Kt=e=>e===void 0?void 0:t=>_(t,e),Ge=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let p=Ot(),u=Kt(a);return re("section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[re("div",{className:"cui-card-header",children:[re("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:q("div",{className:"cui-card-actions",children:r})]}),d]})},sr={3:"h3",4:"h4"},dr=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:p})=>{g();let u=Ot(),c=Kt(o),b=sr[r],m=re(lr,{children:[re("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:m}):q("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:m})};import{jsx as Ut}from"react/jsx-runtime";var ur=({label:e,code:t,testId:n})=>(g(),Ut("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:Ut("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as pr}from"react";import{jsx as cr}from"react/jsx-runtime";var j=({ruleKey:e,css:t})=>cr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as G}from"react/jsx-runtime";var yr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=pr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(j,{ruleKey:i,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:G("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>G("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(m=>G("div",{children:[L("dt",{children:m.label}),L("dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};import{Fragment as hr,useCallback as Rr,useId as Tr,useLayoutEffect as qt,useRef as Je}from"react";var oe="[data-cui-row-focus]",Ve="[data-cui-row-detail]",fr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Bt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ve)&&n.set(a,r);return n},_t=(e,t,n,r)=>{let a=fr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as mr,useLayoutEffect as We,useReducer as gr,useRef as ze}from"react";var br=e=>e+1,ae=e=>{let t=ze(e),n=ze(null),r=ze(!1),[,a]=gr(br,0),o=mr((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return We(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),We(()=>{t.current=e}),We(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as be}from"react/jsx-runtime";var Er=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',xr=(e,t,n)=>{qt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${z} px target does not fit its ${gt} px; use row-control), not <${a.localName}>`)})},wr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Pr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),Nr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Cr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:p,ref:u})=>{g();let c=Tr(),b=Je(null);xr(b,l,p);let m=Je(null),f=Je(Er),h=ae(R=>_t(R,b.current,m.current,f.current));qt(()=>{f.current=Bt(b.current,m.current)});let y=Rr(R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=Et(n);return wr(n,p),S("div",{className:"cui-container","data-testid":p,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:d}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:be("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(R=>S("col",{style:R.width.fixedPx===void 0?void 0:{width:F(R.width.fixedPx)}},R.key))}),S("thead",{children:S("tr",{children:n.map(R=>be("th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:S("div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),S("tbody",{ref:b,children:r.map(R=>be(hr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(s?.(R)),children:n.map(T=>T.rowHeader===!0?be("th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:Pr(T.rowHeaderNote(R))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:Nr(i,R,n.length,o,h)]},a(R)))})]})})})};import{jsx as Xe,jsxs as Lr}from"react/jsx-runtime";var kr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Xe("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Lr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Xe("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Xe("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Gt,useLayoutEffect as Vt,useRef as je}from"react";import{jsx as ie,jsxs as zt}from"react/jsx-runtime";var Wt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Sr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},Mr=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Ir=e=>e instanceof HTMLInputElement&&e.type==="search",$r=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Gt(),d=Gt(),p=je(null),u=je(null),c=je(!1);return Vt(()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Sr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Mr(y,E)}else!n&&y.open&&y.close()},[n,a]),Vt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Wt(u.current),u.current=null)}},[]),zt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:y=>{y.currentTarget.open||(Wt(u.current),u.current=null,n&&r())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=qe(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Ir(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[zt("div",{className:"cui-dialog-header",children:[ie("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ie("div",{className:"cui-dialog-actions",children:ie($,{variant:"secondary",testId:`${o}-close`,onClick:()=>p.current?.close(),children:l.close})})]}),t===void 0?null:ie("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ie("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Oe]:"","data-testid":`${o}-announcer`})]})};import{useId as Fr,useRef as Ar}from"react";import{jsx as Ye,jsxs as Jt}from"react/jsx-runtime";var Dr=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Fr(),s=Ar(null);return O(s,{testId:r,part:"summary",host:"button"}),Jt("div",{className:"cui-disclosure","data-testid":r,children:[Jt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Ye("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Ye("span",{ref:s,children:e})]}),Ye("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Or}from"@aiquants/auth-core";import{Fragment as Kr}from"react";import{jsx as Xt}from"react/jsx-runtime";var Hr=({tone:e,testId:t,children:n})=>(g(),Xt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),se=({occurrence:e,testId:t,children:n})=>(g(),Xt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as jt}from"react/jsx-runtime";var Ze=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Or(e.status);return i===null?jt(se,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):jt(Kr,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as Y}from"react";import{Fragment as Jr,jsx as x,jsxs as A}from"react/jsx-runtime";var Ur=/\s/,Qe=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Ur.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Yt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let r=Y(),a=Y(),o=Y(),s=n===void 0?o:Ue(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Jr,{children:[e===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:x(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),he=({htmlFor:e,hidden:t,children:n})=>x("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Br=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=Z({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[x(he,{htmlFor:s.id,hidden:void 0,children:e}),o(s),x(Q,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},Zt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:r}),T=Y();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=x("input",{className:"cui-input",type:s,name:Qe(l),maxLength:Yt(i),value:a,list:d,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:I=>o(I.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[x(he,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[x("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),x(Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},_r=e=>x(Zt,{...e}),qr=e=>x(Zt,{...e,type:"password"}),Gr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[x(he,{htmlFor:u.id,hidden:void 0,children:e}),x("textarea",{className:"cui-input cui-textarea",name:Qe(s),maxLength:Yt(l),value:a,required:i,onChange:m=>o(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:p,...u}),x(Q,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},Vr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:r}),f=Y(),h=X(d,f);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[x(he,{htmlFor:c.id,hidden:i,children:e}),x("select",{className:"cui-input",name:Qe(l),value:a,onChange:y=>{d===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:o.map(y=>x("option",{value:y.value,children:y.label},y.value))}),x(Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),d?.reason===void 0?null:x(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:d.reason})]})},Wr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=Y(),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,m)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[x("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:m===0?i:void 0}),x("span",{children:b.label})]},b.value)),x(Q,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},zr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:r}),c=o.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[x("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((f,h)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[x("input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${f.value}`,ref:h===0?i:void 0}),x("span",{children:f.label})]},f.value)),x(Q,{description:t,error:n,descriptionId:p,errorId:u,testId:l})]})};import{createContext as Xr,useContext as jr,useId as rn,useMemo as Yr}from"react";import{Fragment as dn,jsx as N,jsxs as Re}from"react/jsx-runtime";var on=Xr(null),Qt="surface",en={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},tn={face:"info-tint",line:"info-accent"},an={normal:"border-control",high:"info-accent"},Zr=["normal","high"],Qr=[1,2,3,4],D=M.space["space-2"],eo="fg",to="fg-secondary",sn=e=>{let t=jr(on);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},et=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},no=e=>{g();let t=rn(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;et(o,"widthPx",r),et(o,"heightPx",a);let i=Yr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Re(dn,{children:[N("defs",{children:Zr.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${D} ${D}`,refX:D,refY:D/2,markerWidth:D,markerHeight:D,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${D} ${D/2} L 0 ${D} z`,"data-cui-stroke":an[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(on.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!H(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":Qt,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":o,...w(s),children:d})})}let{viewBox:p,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Qt,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),...u?.handlers,children:d})})},nn=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ro=(e,t,n)=>{for(let r of t){let a=mt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},oo=e=>{g();let t=sn("FigureNode"),n=rn(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!H(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?tn:en[s];ro(c,m,[en[s].face,tn.face]);let h,y,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=nn(c,()=>bt({name:d,notes:m.map(k=>k.text)}));if(et(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=ht(m.length);y=Re("g",{"data-cui-surface":f.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:M.type.body.size,"data-cui-fg":eo,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),m.map((k,I)=>N("text",{x:v.insetPx,y:v.notesPx[I],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${I}`,children:k.text},I))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=nn(c,()=>Rt(d,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},y=Re(dn,{children:[N("g",{"data-cui-surface":f.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":to,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<z||h.height<z)throw new RangeError(`${c}: a pressable node must be at least the ${z} px target: ${h.width} \xD7 ${h.height}`);if(h.left<J||h.top<J||h.left+h.width+J>t.widthPx||h.top+h.height+J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${J} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Re("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...R,"data-testid":c,...w(b),children:[p===void 0?null:N("title",{children:p}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ao=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=sn("FigureEdge");if(!Qr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":an[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as lo}from"react/jsx-runtime";var io={1:"h1",2:"h2",3:"h3"},so=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=io[e];return lo(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as po}from"react/jsx-runtime";var uo={removed:"danger-tint",added:"success-tint"},co=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return po(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":uo[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as mo}from"react/jsx-runtime";var yo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},fo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},tt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?yo[e]:{fg:"on-solid",surface:fo[e]};return mo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};import{useId as go}from"react";import{jsx as de,jsxs as bo}from"react/jsx-runtime";var nt=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=go();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return bo("div",{className:"cui-progress","data-testid":a,children:[de(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),de("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:de("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),de("div",{"aria-hidden":"true",children:de(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as Te,jsxs as ln}from"react/jsx-runtime";var ho=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>ln(Ge,{title:e,actions:r===void 0?void 0:Te($,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[ln("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[Te("span",{className:"cui-visually-hidden",children:`${e} `}),Te(tt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:Te(nt,{...n,testId:`${a}-progress`}),o]});import{createContext as Ro,useContext as To}from"react";import{jsx as le}from"react/jsx-runtime";var rt=Ro(null),Eo="space-2",vo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!H(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return le(rt.Provider,{value:e.marker,children:le(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Eo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},xo=({testId:e,dataAttributes:t,children:n})=>{g();let r=To(rt);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return le("li",{className:"cui-list-item","data-testid":e,...w(t),children:le("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:le(rt.Provider,{value:null,children:n})})})};import{useCallback as un,useLayoutEffect as wo,useRef as Ee}from"react";import{jsx as ve,jsxs as ko}from"react/jsx-runtime";var cn=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ve);return n===null||!e.contains(n)}),Po=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=cn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},No=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Co=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=Ee(null),p=Ee(null),u=Ee(null),c=Ee(!1),b=()=>{let y=o.ref.current;d.current={shown:new Set(y===null?[]:cn(y)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};wo(()=>{let y=c.current;c.current=!1;let E=d.current;if(E===null)return;let R=Po(o);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=No(R,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=un((y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=un((y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?ve("div",{className:"cui-load-more","data-testid":s,children:ve(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${s}-end`,children:i.endOfRecords})}):ko("div",{className:"cui-load-more","data-testid":s,children:[ve($,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:f,testId:`${s}-button`,children:i.loadMore(ce(a,l))}),r===null?null:ve(se,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as ot,jsxs as pn}from"react/jsx-runtime";var Lo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=Tt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return pn("div",{className:"cui-container","data-testid":a,children:[ot(j,{ruleKey:o.key,css:o.css}),pn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[ot("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),ot("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as xe}from"react/jsx-runtime";var we=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!H(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return xe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=ce(s,t);return xe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:yt(i,l)})}let{text:a,keep:o}=e;if(a===null)return xe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!H(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return xe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Pe,jsxs as Mo}from"react/jsx-runtime";var So=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return Mo("span",{className:"cui-meter","data-testid":o,children:[Pe("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Pe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Pe("span",{"aria-hidden":"true",children:Pe(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Io,useRef as $o}from"react";import{jsx as at,jsxs as Do}from"react/jsx-runtime";var Fo={ArrowLeft:-1,ArrowRight:1},Ao=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Io(),i=$o(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(f=>f.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let p=d.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=f=>`${l}-tab-${f}`,c=`${l}-panel`,b=f=>{let h=t[f];h.id!==n&&r(h.id),i.current.get(h.id)?.focus()};return Do("div",{className:"cui-panel-tabs","data-testid":a,children:[at("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Fo[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return at("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),at("div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ho}from"@aiquants/auth-core";import{jsx as it,jsxs as Ko}from"react/jsx-runtime";var Oo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=it(Ze,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ho(e.status)!==null?it("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Ko("div",{className:"cui-resource-failed","data-testid":o,children:[l,it($,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as Uo}from"react";import{jsx as V,jsxs as yn}from"react/jsx-runtime";var Bo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=Uo(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?yn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[V("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:V("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):yn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[V("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),V("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return V("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as _o,useRef as qo}from"react";import{jsx as ee}from"react/jsx-runtime";var fn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:s})=>{g();let l=qo(null);O(l,{testId:r,part:"row",host:"button"});let i=_o(p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return ee("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},Go=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:p,ref:u})=>(g(),ee("div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?ee(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:d}):ee("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return ee("li",{children:ee(fn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Vo}from"react";import{jsx as Ne,jsxs as mn}from"react/jsx-runtime";var Wo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Vo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return mn("div",{className:"cui-field","data-testid":`${l}-field`,children:[Ne("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),mn("div",{className:"cui-slider",children:[Ne("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:p=>s(p.currentTarget.valueAsNumber)}),Ne("span",{className:"cui-slider-value","aria-hidden":"true",children:Ne(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as st,jsxs as bn}from"react/jsx-runtime";var gn={done:0,current:1,pending:2},zo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Jo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&gn[o.state]<gn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return st("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=zo[o.state],i=a[o.state];return bn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[st("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),bn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:st("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Xo,useRef as jo}from"react";import{jsx as Ce,jsxs as hn}from"react/jsx-runtime";var Yo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Xo(),d=jo(null);O(d,{testId:o,part:"label",host:"button"});let p=X(a,i),u=a!==void 0,c=hn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[Ce("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Ce("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Ce("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:hn("span",{className:"cui-button-group",children:[c,Ce(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as Zo,useEffect as Qo,useId as ea,useRef as Rn,useState as ta}from"react";import{jsx as ue,jsxs as Tn}from"react/jsx-runtime";var na=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let l=t.find(m=>m.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=ta(!1),p=Rn(null),u=Rn(null),c=ea(),b=Zo(m=>{d(!1),m&&p.current?.contains(document.activeElement)&&u.current?.focus()},[]);return Qo(()=>{if(!(o&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[o,i,b]),Tn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?m=>_(m,()=>b(!0)):void 0,children:[o?Tn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(m=>!m),children:[ue("span",{className:"cui-tabs-summary-label",children:l.label}),ue("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,ue("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(m=>{let f=m.id===n;return ue("li",{className:"cui-tabs-item",children:ue("a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,r),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};import{Children as ra,Fragment as oa,isValidElement as aa}from"react";import{jsx as W,jsxs as vn}from"react/jsx-runtime";var ia={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},sa=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return vn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[W("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),W("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),W("p",{className:"cui-tile-value","data-cui-fg":ia[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?W(we,{value:e.value,unit:e.unit,testId:l}):W(we,{text:e.text,keep:"wrap",testId:l})})]})},En=e=>ra.toArray(e).flatMap(t=>{if(!aa(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===oa?En(t.props.children):[t]}),da=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=vt(e,t,M.space["space-2"]),o=En(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return vn("div",{className:"cui-container","data-testid":n,children:[W(j,{ruleKey:a.key,css:a.css}),W("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as la,useRef as xn}from"react";import{jsx as ca}from"react/jsx-runtime";var ke=e=>[...e.querySelectorAll("button")],ua=({label:e,testId:t,children:n})=>{g();let r=xn(null),a=xn(null);la(()=>{let i=ke(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let p of i)p.tabIndex=p===d?0:-1});let o=i=>{for(let d of ke(r.current))d.tabIndex=d===i?0:-1;a.current=i};return ca("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=ke(i.currentTarget).find(p=>p.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=ke(i.currentTarget),p=d.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%d.length,[c]:(p-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=d[m];o(f),f.focus()},children:n})};import{useState as pa}from"react";var ya=e=>{let[t,n]=pa({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as te,useEffect as ga,useLayoutEffect as Pn,useRef as ut}from"react";import{useCallback as Le,useEffect as fa,useLayoutEffect as ma,useRef as dt,useState as lt}from"react";var wn=e=>e===null?$e:Fe,Se=(e,t,n,r,a)=>{let[o,s]=lt(()=>({key:e,state:wn(e)})),[l,i]=lt(0),[d,p]=lt(0),u=dt(t),c=dt(null),b=dt(l);ma(()=>{u.current=t}),fa(()=>{if(e===null){s({key:null,state:$e});return}let R=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:Fe}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,l,d]);let m=Le(()=>i(R=>R+1),[]),f=Le(()=>p(R=>R+1),[]),h=Le((R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=Le((R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(o.key,e)?o.state:wn(e),reload:m,refresh:f,update:h,write:y}};var ba=(e,t,n)=>{let r=ut(t);Pn(()=>{r.current=t});let a=te(y=>r.current.first(y),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Se(e,a,n,wt,Pt),p=ut({key:e,state:o});Pn(()=>{p.current={key:e,state:o}});let u=ut(null),c=te(()=>{u.current?.controller.abort(),u.current=null},[]);ga(()=>c,[e,n,c]);let b=te(()=>{c(),s()},[c,s]),m=te(()=>{c(),l()},[c,l]),f=te(()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,Nt),r.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((I,Nn)=>De(I,Nn),Ct(k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=te((y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),d(y,T=>De(T,E))},[d]);return{state:o,reload:b,refresh:m,loadMore:f,updateList:h}};import{useCallback as ha,useRef as Ra,useState as Ta}from"react";var Ea=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",va=()=>{let[e,t]=Ta(null),n=Ra(null),r=ha((a,o)=>{let s=o();if(!Ea(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as xa}from"react";var wa=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Se(e,t,n,xt,Ae),l=xa((i,d)=>s(i,p=>Ae(p,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as Na}from"react/jsx-runtime";var Pa=({testId:e,children:t})=>(g(),Na("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{pe as ANNOUNCE_SETTLE_MS,tr as AccessFailureNotice,se as AlertMessage,nr as Breadcrumb,$ as Button,gt as COMPACT_ROW_PX,Da as CONSOLE_UI_LABEL_CATALOGS,Ka as CONTRAST_MINIMUM,mt as CONTRAST_PAIRS,Ge as Card,dr as CardSection,zr as CheckboxGroup,_e as Cluster,ur as CodeBlock,yr as ComparisonGrid,An as ConsoleUiRoot,Cr as DataTable,kr as DescriptionList,$r as Dialog,Dr as Disclosure,J as FIGURE_RING_REACH_PX,Xa as FLEXIBLE_COLUMN_MIN_PX,Ze as FailureMessage,Br as Field,no as Figure,ao as FigureEdge,oo as FigureNode,Jn as FragmentLink,oi as HTTP_FORBIDDEN,so as Heading,co as InlineChange,ho as JobCard,Ie as LATTICE_PX,Wn as Link,vo as List,xo as ListItem,Co as LoadMore,Ua as MORE_CONTRAST_MINIMUM,Lo as MasterDetail,we as Measured,So as Meter,sa as MetricTile,Hr as Notice,Ao as PanelTabs,qr as PasswordInput,tt as Pill,nt as ProgressBar,_a as ROW_WITH_CONTROL_PX,Wr as RadioGroup,Oo as ResourceFailed,fn as RowButton,Bo as SegmentedControl,Vr as Select,Go as SelectableList,Wo as Slider,jn as Stack,Jo as Stepper,Yo as Switch,z as TARGET_PX,M as TOKENS,ci as TONES,li as TONE_HUES,ui as TONE_ROLES,na as Tabs,P as Text,Gr as TextArea,_r as TextInput,da as TileGrid,ua as Toolbar,Pa as VisuallyHidden,Sa as ZonedTimeError,Nt as beginPage,wt as beginPagedReload,xt as beginReload,Wa as ceil8,Ba as ceilToLattice,za as cellContentInlinePx,ja as comparisonAttributePx,Oa as contrastRatio,Za as countSampleText,qa as cssVar,bt as figureBoxPlan,Rt as figureDiscLabelPlan,Fa as fillLabel,Ja as fixedColumnPx,ii as flatMapOutcome,Ca as formatByteSize,ce as formatCount,$a as formatInstant,ti as goldenSectionPx,Ha as hexToSrgb,Ya as instantSampleText,H as isReadableText,Ae as keepLastGood,si as lightDark,ai as mapOutcome,De as mapPagedList,ni as masterDetailPlan,Va as monoTextWidthEm,di as placeholderRule,F as pxToRem,ka as readDecimalText,La as readIntegerText,Aa as reasonAside,ft as resolveConsoleUiLabels,Pt as settleFirstPage,Ct as settlePage,ei as spacedTextWidthEm,ri as tableFrameMinInlinePx,Et as tableMinInlinePx,Ga as textWidthEm,vt as tileGridPlan,Qa as tileMinInlinePx,Ma as toOffsetIso,Ia as toWallTime,pt as topmostModalOf,Dn as useAccessFailure,Ke as useAnnounce,C as useConsoleUi,ir as useEscapeToClose,ya as useFailureOccurrence,ae as useFocusRescue,ba as usePagedResource,va as usePendingPress,wa as useResource};
1
+ import{$ as Nt,A as Xa,B as Ya,C as Za,D as Qa,E as ei,F as ti,G as ni,H as ri,I as Rt,J as Tt,K as Et,L as X,M as U,N as oi,O as F,P as ai,Q as xt,R as wt,S as ii,T as vt,U as si,V as di,W as li,X as Ae,Y as De,Z as Pt,_ as He,a as yt,aa as Ct,b as ft,ba as kt,c as me,ca as Lt,d as Sa,da as Oe,e as mt,ea as ui,f as Ma,fa as ci,g as Ia,ga as pi,h as O,ha as yi,i as $a,ia as fi,j as Fa,k as Aa,l as Da,m as Ha,n as Oa,o as Ka,p as gt,q as Fe,r as Ga,s as j,t as Va,u as ht,v as M,w as Wa,x as za,y as Ja,z as ja}from"./chunk-HROMRBBM.js";import{a as Ua,e as Ba,f as _a,g as qa,h as $e,i as bt}from"./chunk-RA33TN5N.js";import{useEffect as Qn,useRef as er}from"react";import{useId as Vn,useRef as Wn}from"react";import{createContext as Ln,useCallback as Sn,useContext as At,useLayoutEffect as Mn,useMemo as St,useRef as Mt}from"react";import{jsx as Ft,jsxs as Kn}from"react/jsx-runtime";var Ke=Ln(null),Dt=" ",It='[inert], [aria-hidden="true" i]',Ue="data-cui-dialog-announcer",In=`:scope > [${Ue}]`,$n=e=>{if(e.closest(It)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=ft(e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(In);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(It)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},Fn=e=>{try{e.querySelectorAll(yt)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ge=150,An=1e3,$t=new WeakMap,Dn=(e,t)=>{let n=$t.get(e)??new Set,r={text:t};$t.set(e,n.add(r)),setTimeout(()=>n.delete(r),ge);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Dt),e.replaceChildren(a)},Hn=({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",reducedMotion:o=!1,testId:s,children:l})=>{if(At(Ke)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!$e.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${$e.join(", ")}: ${String(a)}`);if(typeof o!="boolean")throw new TypeError(`ConsoleUiRoot: reducedMotion must be a boolean: ${String(o)}`);let d=gt(e),[y]=Intl.getCanonicalLocales(t),u=St(()=>new Intl.DateTimeFormat(y,{timeZone:n}).resolvedOptions().timeZone,[y,n]),c=Mt(null),b=Mt(null);Mn(()=>{Fn(c.current.ownerDocument)},[]);let f=Sn(R=>{if(R.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let p=()=>{let{texts:h,settle:T,deadline:x}=b.current;b.current=null,clearTimeout(T),clearTimeout(x);let k=c.current;if(k===null)return;let $=h.join(Dt),oe=$n(k);if("hidden"in oe)throw new Error(`announce: the live region is hidden from assistive technology (${oe.hidden}), so this announcement would be lost: ${$}`);Dn(oe.region,$)},E=b.current;if(E===null){b.current={texts:[R],settle:setTimeout(p,ge),deadline:setTimeout(p,An)};return}E.texts.push(R),clearTimeout(E.settle),E.settle=setTimeout(p,ge)},[]),m=St(()=>({locale:e,formatLocale:y,timeZone:u,labels:d,announce:f,accessFailure:r}),[e,y,u,d,f,r]);return Ft(Ke.Provider,{value:m,children:Kn("div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-reduced-motion":o?"":void 0,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":s,children:[l,Ft("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${s}-announcer`,ref:c})]})})},C=()=>{let e=At(Ke);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Be=()=>C().announce,On=()=>C().accessFailure;var v=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ae=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var B=(e,t)=>{if(e!==void 0&&e.trim()==="")throw new RangeError(`${t}: the key shortcuts must name at least one shortcut, not a blank text: "${e}"`);return e};import{useLayoutEffect as Un}from"react";var Bn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),_n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Bn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},D=(e,{testId:t,part:n,host:r})=>{Un(()=>{let a=_n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as qn}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),qn(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var Gn=/\s/,_e=(e,t)=>{if(e===""||Gn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},Y=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return _e(e.reasonId,"an unavailable control's reason")}},_=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as K,jsxs as Yn}from"react/jsx-runtime";var zn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},qe=({subject:e,children:t})=>{let n=Wn(null);return D(n,e),K("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:y,keyShortcuts:u,busy:c,busyLabel:b})=>{g();let f=Vn(),m=Y(o,f),R=c===!0||o!==void 0,p=zn[e],E=h=>{if(ae(h),R){h.preventDefault();return}a?.(h)};return Yn("span",{className:"cui-button-group",children:[K("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":p.fg,"data-cui-surface":p.surface,"data-cui-type":p.type,"data-testid":n,"aria-disabled":R?!0:void 0,"aria-busy":c===!0?!0:void 0,"aria-describedby":_(s,m),"aria-expanded":l,"aria-controls":i,"aria-keyshortcuts":B(u,n),onClick:E,ref:d,...v(y),children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:c===!0?b:t})}),o?.reason===void 0?null:K(P,{fg:"fg-muted",type:"body",id:f,testId:`${n}-reason`,children:o.reason})]})},Jn=({onNavigate:e,children:t,testId:n,ref:r,keyShortcuts:a})=>(g(),K("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(a,n),onClick:e,ref:r,children:K(qe,{subject:{testId:n,part:"label",host:"button"},children:t})})),jn=/^[^\s#]+$/,Xn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a,keyShortcuts:o})=>{if(g(),!jn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return K("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,"aria-keyshortcuts":B(o,n),onClick:r,...v(a),children:K(qe,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ht}from"react/jsx-runtime";var Zn=({gap:e,testId:t,children:n})=>(g(),Ht("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ge=({gap:e,as:t="div",testId:n,children:r})=>(g(),Ht(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as be,jsxs as Ot}from"react/jsx-runtime";var tr=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),nr=" ",rr=({view:e,handlers:t,testId:n})=>{let r=Be(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(nr):null,s=er(null);return Qn(()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),Ot("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[Ot("div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[be("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>be("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:be(Ge,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>be(I,{variant:tr.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var Z=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as ie,jsxs as Kt}from"react/jsx-runtime";var or=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return ie("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:Kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>Kt("li",{className:"cui-breadcrumb-item",children:[ie("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>Z(s,o.href,n),children:o.label}),ie("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),ie("li",{className:"cui-breadcrumb-item",children:ie("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Ut}from"react";import{useCallback as ar}from"react";var ir=229,sr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),he=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&sr.has(e.type)&&(e.value!==""||e.validity.badInput),Ve=e=>e.nativeEvent.isComposing||e.keyCode===ir,q=(e,t)=>{e.key!=="Escape"||Ve(e)||he(e.target)||(e.stopPropagation(),t())},dr=e=>ar(t=>q(t,e),[e]);import{Fragment as cr,jsx as G,jsxs as se}from"react/jsx-runtime";var Bt=e=>e===void 0?void 0:t=>q(t,e),We=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let y=Ut(),u=Bt(a);return se("section",{className:"cui-card",id:e,"aria-labelledby":y,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...v(i),children:[se("div",{className:"cui-card-header",children:[se("div",{className:"cui-card-heading",children:[G("h2",{className:"cui-card-title",id:y,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:G("div",{className:"cui-card-actions",children:r})]}),d]})},lr={3:"h3",4:"h4"},ur=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:y})=>{g();let u=Ut(),c=Bt(o),b=lr[r],f=se(cr,{children:[se("div",{className:"cui-card-section-heading",children:[G(b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:G("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),y]});return a?G("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...v(d),children:f}):G("div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...v(d),children:f})};import{jsx as _t}from"react/jsx-runtime";var pr=({label:e,code:t,testId:n})=>(g(),_t("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_t("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as fr}from"react";import{jsx as yr}from"react/jsx-runtime";var Q=({ruleKey:e,css:t})=>yr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as V}from"react/jsx-runtime";var mr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=fr();for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,y=`${d("table")}{display:none}@container (min-width:${F(l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return V("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[L(Q,{ruleKey:i,css:y}),L("div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:V("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),V("colgroup",{children:[L("col",{style:{width:F(r)}}),n.map(u=>L("col",{},u.key))]}),L("thead",{children:V("tr",{children:[L("td",{}),n.map(u=>L("th",{scope:"col",children:u.heading},u.key))]})}),L("tbody",{children:t.map(u=>V("tr",{children:[L("th",{scope:"row",children:u.label}),n.map(c=>L("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return V("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:u.heading}),L("dl",{className:"cui-comparison-list",children:t.map(f=>V("div",{children:[L("dt",{children:f.label}),L("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as Tr,useCallback as Er,useId as xr,useLayoutEffect as Vt,useRef as Xe}from"react";var de="[data-cui-row-focus]",ze="[data-cui-row-detail]",gr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${de}`)],qt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(de)?(r+=1,n.set(a,r)):r>=0&&a.matches(ze)&&n.set(a,r);return n},Gt=(e,t,n,r)=>{let a=gr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as br,useLayoutEffect as Je,useReducer as hr,useRef as je}from"react";var Rr=e=>e+1,le=e=>{let t=je(e),n=je(null),r=je(!1),[,a]=hr(Rr,0),o=br((s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return Je(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Je(()=>{t.current=e}),Je(()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||t.current(s)?.focus()}),o};import{jsx as S,jsxs as Re}from"react/jsx-runtime";var wr=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Pr=(e,t,n)=>{Vt(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${j} px target does not fit its ${ht} px; use row-control), not <${a.localName}>`)})},Nr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Cr=e=>e==null?null:S("div",{className:"cui-table-header-note",children:e}),kr=(e,t,n,r,a)=>{let o=e.open(t);return S("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Lr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:y,ref:u})=>{g();let c=xr(),b=Xe(null);Pr(b,l,y);let f=Xe(null),m=Xe(wr),R=le(h=>Gt(h,b.current,f.current,m.current));Vt(()=>{m.current=qt(b.current,f.current)});let p=Er(h=>{f.current=h;let T=R(h);return()=>{f.current=null,T()}},[R]),E=wt(n);return Nr(n,y),S("div",{className:"cui-container","data-testid":y,ref:u,children:r.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:p,testId:`${y}-empty`,children:d}):S("section",{ref:R,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${y}-frame`,children:Re("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(h=>S("col",{style:h.width.fixedPx===void 0?void 0:{width:F(h.width.fixedPx)}},h.key))}),S("thead",{children:S("tr",{children:n.map(h=>Re("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:S("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),S("tbody",{ref:b,children:r.map(h=>Re(Tr,{children:[S("tr",{ref:R,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...v(s?.(h)),children:n.map(T=>T.rowHeader===!0?Re("th",{scope:"row","data-cui-align":T.align,children:[T.cell(h),T.rowHeaderNote===void 0?null:Cr(T.rowHeaderNote(h))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(h)},T.key))}),i===void 0?null:kr(i,h,n.length,o,R)]},a(h)))})]})})})};import{jsx as Ye,jsxs as Mr}from"react/jsx-runtime";var Sr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Ye("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ye("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ye("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Wt,useLayoutEffect as zt,useRef as Ze}from"react";import{jsx as ue,jsxs as jt}from"react/jsx-runtime";var Jt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Ir=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},$r=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Fr=e=>e instanceof HTMLInputElement&&e.type==="search",Ar=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=Wt(),d=Wt(),y=Ze(null),u=Ze(null),c=Ze(!1);return zt(()=>{let p=y.current;if(n&&!p.open){let E=a===void 0?null:Ir(p,a.current);u.current=p.ownerDocument.activeElement,p.showModal(),E!==null&&$r(p,E)}else!n&&p.open&&p.close()},[n,a]),zt(()=>{let p=y.current;return()=>{p.open&&(p.close(),Jt(u.current),u.current=null)}},[]),jt("dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:y,onClose:p=>{p.currentTarget.open||(Jt(u.current),u.current=null,n&&r())},onCancel:p=>{let E=c.current;c.current=!1,(E||he(p.currentTarget.ownerDocument.activeElement))&&p.preventDefault()},onKeyDownCapture:p=>{let E=Ve(p);c.current=E,p.key==="Escape"&&!E&&he(p.target)&&!Fr(p.target)&&p.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[jt("div",{className:"cui-dialog-header",children:[ue("h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),ue("div",{className:"cui-dialog-actions",children:ue(I,{variant:"secondary",testId:`${o}-close`,onClick:()=>y.current?.close(),children:l.close})})]}),t===void 0?null:ue("div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,ue("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ue]:"","data-testid":`${o}-announcer`})]})};import{useId as Dr,useRef as Hr}from"react";import{jsx as Qe,jsxs as Xt}from"react/jsx-runtime";var Or=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Dr(),s=Hr(null);return D(s,{testId:r,part:"summary",host:"button"}),Xt("div",{className:"cui-disclosure","data-testid":r,children:[Xt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[Qe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Qe("span",{ref:s,children:e})]}),Qe("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ur}from"@aiquants/auth-core";import{Fragment as Br}from"react";import{jsx as Yt}from"react/jsx-runtime";var Kr=({tone:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),ce=({occurrence:e,testId:t,children:n})=>(g(),Yt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as Zt}from"react/jsx-runtime";var et=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:Ur(e.status);return i===null?Zt(ce,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):Zt(Br,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as ee}from"react";import{Fragment as Xr,jsx as w,jsxs as A}from"react/jsx-runtime";var _r=/\s/,tt=e=>{if(e!==void 0&&(typeof e!="string"||e===""||_r.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Qt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},te=({description:e,error:t,errorId:n})=>{g();let r=ee(),a=ee(),o=ee(),s=n===void 0?o:_e(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},ne=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>A(Xr,{children:[e===void 0?null:w(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:w(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),Te=({htmlFor:e,hidden:t,children:n})=>w("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),qr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[w(Te,{htmlFor:s.id,hidden:void 0,children:e}),o(s),w(ne,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},en=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:y,inputMode:u,prefix:c,labelHidden:b,required:f,testId:m,ref:R})=>{let{control:p,descriptionId:E,errorId:h}=te({label:e,description:t,error:n,errorId:r}),T=ee();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let x=s==="password",k=w("input",{className:"cui-input",type:s,name:tt(l),maxLength:Qt(i),value:a,list:d,autoComplete:y,inputMode:u,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:$=>o($.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":m,ref:R,...p,"aria-describedby":_(c===void 0?void 0:T,p["aria-describedby"])});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${m}-field`,children:[w(Te,{htmlFor:p.id,hidden:b,children:e}),c===void 0?k:A("div",{className:"cui-input-group",children:[w("span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${m}-prefix`,children:c}),k]}),w(ne,{description:t,error:n,descriptionId:E,errorId:h,testId:m})]})},Gr=e=>w(en,{...e}),Vr=e=>w(en,{...e,type:"password"}),Wr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:y})=>{let{control:u,descriptionId:c,errorId:b}=te({label:e,description:t,error:n,errorId:r});return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[w(Te,{htmlFor:u.id,hidden:void 0,children:e}),w("textarea",{className:"cui-input cui-textarea",name:tt(s),maxLength:Qt(l),value:a,required:i,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:y,...u}),w(ne,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},zr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:y,ref:u})=>{let{control:c,descriptionId:b,errorId:f}=te({label:e,description:t,error:n,errorId:r}),m=ee(),R=Y(d,m);return A("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[w(Te,{htmlFor:c.id,hidden:i,children:e}),w("select",{className:"cui-input",name:tt(l),value:a,onChange:p=>{d===void 0&&s(p.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":_(c["aria-describedby"],R),children:o.map(p=>w("option",{value:p.value,children:p.label},p.value))}),w(ne,{description:t,error:n,descriptionId:b,errorId:f,testId:y}),d?.reason===void 0?null:w(P,{as:"p",fg:"fg-muted",type:"body",id:m,testId:`${y}-reason`,children:d.reason})]})},Jr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=ee(),{control:y,descriptionId:u,errorId:c}=te({label:e,description:t,error:n,errorId:r});return A("fieldset",{className:"cui-radio-group","aria-describedby":y["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[w("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>A("label",{className:"cui-radio","data-cui-type":"body",children:[w("input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":y["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?i:void 0}),w("span",{children:b.label})]},b.value)),w(ne,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},jr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:y,errorId:u}=te({label:e,description:t,error:n,errorId:r}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(m=>!c.includes(m));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return A("fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[w("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,R)=>A("label",{className:"cui-checkbox","data-cui-type":"body",children:[w("input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>s(c.filter(p=>p===m.value?!f.has(p):f.has(p))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${m.value}`,ref:R===0?i:void 0}),w("span",{children:m.label})]},m.value)),w(ne,{description:t,error:n,descriptionId:y,errorId:u,testId:l})]})};import{createContext as Yr,useContext as Zr,useId as an,useMemo as Qr}from"react";import{Fragment as un,jsx as N,jsxs as Ee}from"react/jsx-runtime";var sn=Yr(null),tn="surface",nn={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},rn={face:"info-tint",line:"info-accent"},dn={normal:"border-control",high:"info-accent"},eo=["normal","high"],to=[1,2,3,4],H=M.space["space-2"],no="fg",ro="fg-secondary",ln=e=>{let t=Zr(sn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},nt=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},oo=e=>{g();let t=an(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;nt(o,"widthPx",r),nt(o,"heightPx",a);let i=Qr(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=Ee(un,{children:[N("defs",{children:eo.map(b=>N("marker",{id:i.arrowIds[b],viewBox:`0 0 ${H} ${H}`,refX:H,refY:H/2,markerWidth:H,markerHeight:H,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:N("path",{d:`M 0 0 L ${H} ${H/2} L 0 ${H} z`,"data-cui-stroke":dn[b],"data-testid":`${o}-arrow-${b}`})},b))}),N(sn.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!O(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:N("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":tn,"data-cui-face":"sans",style:{"--cui-figure-inline":F(r),"--cui-figure-block":F(a)},onKeyDown:f===void 0?void 0:m=>q(m,f),"data-testid":o,...v(s),children:d})})}let{viewBox:y,pointer:u,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${o}-frame`,children:N("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:y===void 0?`0 0 ${r} ${a}`:y,"data-cui-figure":"decorative","data-cui-surface":tn,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":F(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...v(s),...u?.handlers,children:d})})},on=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ao=(e,t,n)=>{for(let r of t){let a=bt.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},io=e=>{g();let t=ln("FigureNode"),n=an(),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:y,press:u,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!O(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=i?rn:nn[s];ao(c,f,[nn[s].face,rn.face]);let R,p,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=on(c,()=>Rt({name:d,notes:f.map(k=>k.text)}));if(nt(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);R={width:o.widthPx,height:T.heightPx,left:r,top:a};let x=Tt(f.length);p=Ee("g",{"data-cui-surface":m.face,children:[N("rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:M.type.body.size,"data-cui-fg":no,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),f.map((k,$)=>N("text",{x:x.insetPx,y:x.notesPx[$],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${$}`,children:k.text},$))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=on(c,()=>Et(d,o.radiusPx));R={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},p=Ee(un,{children:[N("g",{"data-cui-surface":m.face,children:N("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),d===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":ro,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=N("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(R.width<j||R.height<j)throw new RangeError(`${c}: a pressable node must be at least the ${j} px target: ${R.width} \xD7 ${R.height}`);if(R.left<X||R.top<X||R.left+R.width+X>t.widthPx||R.top+R.height+X>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${X} px to the figure's edge for its focus ring`)}let h=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return Ee("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...h,"data-testid":c,...v(b),children:[y===void 0?null:N("title",{children:y}),u?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,p]})},so=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=ln("FigureEdge");if(!to.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":dn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...v(s),children:a===void 0?null:N("title",{children:a})})};import{jsx as co}from"react/jsx-runtime";var lo={1:"h1",2:"h2",3:"h3"},uo=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=lo[e];return co(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as fo}from"react/jsx-runtime";var po={removed:"danger-tint",added:"success-tint"},yo=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return fo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":po[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as bo}from"react/jsx-runtime";var mo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},go={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},rt=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?mo[e]:{fg:"on-solid",surface:go[e]};return bo("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...v(r),children:a})};import{useId as ho}from"react";import{jsx as pe,jsxs as Ro}from"react/jsx-runtime";var ot=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=ho();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return Ro("div",{className:"cui-progress","data-testid":a,children:[pe(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),pe("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":s?.max,"aria-valuenow":s?.now,"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:pe("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),pe("div",{"aria-hidden":"true",children:pe(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as xe,jsxs as cn}from"react/jsx-runtime";var To=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>cn(We,{title:e,actions:r===void 0?void 0:xe(I,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[cn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[xe("span",{className:"cui-visually-hidden",children:`${e} `}),xe(rt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:xe(ot,{...n,testId:`${a}-progress`}),o]});import{createContext as Eo,useContext as xo}from"react";import{jsx as ye}from"react/jsx-runtime";var at=Eo(null),wo="space-2",vo=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!O(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return ye(at.Provider,{value:e.marker,children:ye(d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?wo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},Po=({testId:e,dataAttributes:t,children:n})=>{g();let r=xo(at);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return ye("li",{className:"cui-list-item","data-testid":e,...v(t),children:ye("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:ye(at.Provider,{value:null,children:n})})})};import{useCallback as pn,useLayoutEffect as No,useRef as we}from"react";import{jsx as ve,jsxs as So}from"react/jsx-runtime";var yn=e=>[...e.querySelectorAll(de)].filter(t=>{let n=t.closest(ze);return n===null||!e.contains(n)}),Co=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=yn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${de} elements for ${e.count} rows`);return n},ko=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Lo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=we(null),y=we(null),u=we(null),c=we(!1),b=()=>{let p=o.ref.current;d.current={shown:new Set(p===null?[]:yn(p)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};No(()=>{let p=c.current;c.current=!1;let E=d.current;if(E===null)return;let h=Co(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let T=ko(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(d.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||p&&k)&&T.focus()});let f=le(()=>n?y.current:u.current),m=pn((p=>{u.current=p;let E=f(p);return()=>{u.current=null,c.current=p===document.activeElement,E()}}),[f]),R=pn((p=>{y.current=p;let E=f(p);return()=>{y.current=null,E()}}),[f]);return n?ve("div",{className:"cui-load-more","data-testid":s,children:ve(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:R,testId:`${s}-end`,children:i.endOfRecords})}):So("div",{className:"cui-load-more","data-testid":s,children:[ve(I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:m,testId:`${s}-button`,children:i.loadMore(me(a,l))}),r===null?null:ve(ce,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var Mo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=xt({masterMinPx:n,detailMinPx:r,gapPx:M.space["space-6"]});return fn("div",{className:"cui-container","data-testid":a,children:[it(Q,{ruleKey:o.key,css:o.css}),fn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[it("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),it("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Pe}from"react/jsx-runtime";var Ne=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!O(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=me(s,t);return Pe("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:mt(i,l)})}let{text:a,keep:o}=e;if(a===null)return Pe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!O(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Pe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as Ce,jsxs as $o}from"react/jsx-runtime";var Io=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return $o("span",{className:"cui-meter","data-testid":o,children:[Ce("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:Ce("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),Ce("span",{"aria-hidden":"true",children:Ce(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as Fo,useRef as Ao}from"react";import{jsx as st,jsxs as Oo}from"react/jsx-runtime";var Do={ArrowLeft:-1,ArrowRight:1},Ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=Fo(),i=Ao(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(m=>m.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let y=d.indexOf(n);if(y<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=m=>`${l}-tab-${m}`,c=`${l}-panel`,b=m=>{let R=t[m];R.id!==n&&r(R.id),i.current.get(R.id)?.focus()};return Oo("div",{className:"cui-panel-tabs","data-testid":a,children:[st("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let R=t.findIndex(T=>i.current.get(T.id)===m.target),p=R<0?y:R,E=Do[m.key],h;if(E!==void 0){let T=getComputedStyle(m.currentTarget).direction==="rtl"?-E:E;h=(p+T+t.length)%t.length}else if(m.key==="Home")h=0;else if(m.key==="End")h=t.length-1;else return;m.preventDefault(),b(h)},children:t.map((m,R)=>{let p=R===y;return st("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(R),"aria-selected":p,"aria-controls":c,tabIndex:p?0:-1,"data-cui-fg":p?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:E=>{E===null?i.current.delete(m.id):i.current.set(m.id,E)},onClick:()=>b(R),children:m.label},m.id)})}),st("div",{role:"tabpanel",id:c,"aria-labelledby":u(y),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};import{accessFailureKindOfStatus as Ko}from"@aiquants/auth-core";import{jsx as dt,jsxs as Bo}from"react/jsx-runtime";var Uo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=dt(et,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&Ko(e.status)!==null?dt("div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):Bo("div",{className:"cui-resource-failed","data-testid":o,children:[l,dt(I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};import{useId as _o}from"react";import{jsx as W,jsxs as mn}from"react/jsx-runtime";var qo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_o(),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?mn("fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[W("span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:W("span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):mn("fieldset",{className:"cui-segmented-group","data-testid":a,children:[W("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),W("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return W("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as Go,useRef as Vo}from"react";import{jsx as z}from"react/jsx-runtime";var gn=e=>{let t=Vo(null),n=Go(r=>{if(t.current=r,typeof e=="function")return e(r);e!=null&&(e.current=r)},[e]);return{row:t,bindRow:n}},bn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"button"});let y=u=>{ae(u),n()};return z("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},Wo=({href:e,current:t,onNavigate:n,testId:r,dataAttributes:a,ref:o,keyShortcuts:s,children:l})=>{g();let{row:i,bindRow:d}=gn(o);D(i,{testId:r,part:"row",host:"link"});let y=u=>{ae(u),Z(u,e,n)};return z("a",{className:"cui-row-link",href:e,"aria-current":t?"page":void 0,"aria-keyshortcuts":B(s,r),"data-cui-row-focus":"","data-cui-surface":t?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:y,ref:d,...v(a),children:l})},zo=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:y,ref:u})=>(g(),z("div",{className:"cui-selectable","data-testid":y,ref:u,children:t.length===0?z(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${y}-empty`,children:d}):z("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return z("li",{children:z(bn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:i?.(c),children:s(c)})},b)})})}));import{useId as Jo}from"react";import{jsx as ke,jsxs as hn}from"react/jsx-runtime";var jo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=Jo();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return hn("div",{className:"cui-field","data-testid":`${l}-field`,children:[ke("label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),hn("div",{className:"cui-slider",children:[ke("input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:y=>s(y.currentTarget.valueAsNumber)}),ke("span",{className:"cui-slider-value","aria-hidden":"true",children:ke(P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};import{jsx as lt,jsxs as Tn}from"react/jsx-runtime";var Rn={done:0,current:1,pending:2},Xo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Yo=({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&Rn[o.state]<Rn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return lt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=Xo[o.state],i=a[o.state];return Tn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[lt("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),Tn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:lt("span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};import{useId as Zo,useRef as Qo}from"react";import{jsx as Le,jsxs as En}from"react/jsx-runtime";var ea=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=Zo(),d=Qo(null);D(d,{testId:o,part:"label",host:"button"});let y=Y(a,i),u=a!==void 0,c=En("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":_(y),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...v(l),children:[Le("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:Le("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Le("span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return a?.reason===void 0?c:En("span",{className:"cui-button-group",children:[c,Le(P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as ta,useEffect as na,useId as ra,useRef as xn,useState as oa}from"react";import{jsx as fe,jsxs as wn}from"react/jsx-runtime";var aa=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(f=>f.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=oa(!1),y=xn(null),u=xn(null),c=ra(),b=ta(f=>{d(!1),f&&y.current?.contains(document.activeElement)&&u.current?.focus()},[]);return na(()=>{if(!(o&&i))return;let f=p=>y.current!==null&&!y.current.contains(p),m=p=>{f(p.target)&&b(!0)},R=p=>{f(p.target)&&b(!1)};return document.addEventListener("pointerdown",m,!0),document.addEventListener("focusin",R,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("focusin",R,!0)}},[o,i,b]),wn("nav",{ref:y,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?f=>q(f,()=>b(!0)):void 0,children:[o?wn("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(f=>!f),children:[fe("span",{className:"cui-tabs-summary-label",children:l.label}),fe("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,fe("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===n;return fe("li",{className:"cui-tabs-item",children:fe("a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:R=>{Z(R,f.href,r),R.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as ia,Fragment as sa,isValidElement as da}from"react";import{jsx as J,jsxs as Pn}from"react/jsx-runtime";var la={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},ua=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return Pn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...v(o),children:[J("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),J("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),J("p",{className:"cui-tile-value","data-cui-fg":la[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?J(Ne,{value:e.value,unit:e.unit,testId:l}):J(Ne,{text:e.text,keep:"wrap",testId:l})})]})},vn=e=>ia.toArray(e).flatMap(t=>{if(!da(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===sa?vn(t.props.children):[t]}),ca=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=vt(e,t,M.space["space-2"]),o=vn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return Pn("div",{className:"cui-container","data-testid":n,children:[J(Q,{ruleKey:a.key,css:a.css}),J("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as pa,useRef as Nn}from"react";import{jsx as fa}from"react/jsx-runtime";var Se=e=>[...e.querySelectorAll("button")],ya=({label:e,testId:t,children:n})=>{g();let r=Nn(null),a=Nn(null);pa(()=>{let i=Se(r.current),d=a.current!==null&&i.includes(a.current)?a.current:i[0]??null;a.current=d;for(let y of i)y.tabIndex=y===d?0:-1});let o=i=>{for(let d of Se(r.current))d.tabIndex=d===i?0:-1;a.current=i};return fa("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=Se(i.currentTarget).find(y=>y.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=Se(i.currentTarget),y=d.indexOf(i.target);if(y===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(y+1)%d.length,[c]:(y-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(f===void 0)return;i.preventDefault();let m=d[f];o(m),m.focus()},children:n})};import{useState as ma}from"react";var ga=e=>{let[t,n]=ma({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as re,useEffect as Ra,useLayoutEffect as kn,useRef as pt}from"react";import{useCallback as Me,useEffect as ba,useLayoutEffect as ha,useRef as ut,useState as ct}from"react";var Cn=e=>e===null?Ae:De,Ie=(e,t,n,r,a)=>{let[o,s]=ct(()=>({key:e,state:Cn(e)})),[l,i]=ct(0),[d,y]=ct(0),u=ut(t),c=ut(null),b=ut(l);ha(()=>{u.current=t}),ba(()=>{if(e===null){s({key:null,state:Ae});return}let h=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(x=>Object.is(x.key,e)?{key:e,state:r(x.state,T)}:{key:e,state:De}),u.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,x)})))},x=>{h.signal.aborted||s(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,d]);let f=Me(()=>i(h=>h+1),[]),m=Me(()=>y(h=>h+1),[]),R=Me((h,T)=>{s(x=>Object.is(x.key,h)?{key:h,state:T(x.state)}:x)},[]),p=Me((h,T)=>{R(h,T),Object.is(c.current,h)&&m()},[R,m]);return{state:Object.is(o.key,e)?o.state:Cn(e),reload:f,refresh:m,update:R,write:p}};var Ta=(e,t,n)=>{let r=pt(t);kn(()=>{r.current=t});let a=re(p=>r.current.first(p),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Ie(e,a,n,Nt,Ct),y=pt({key:e,state:o});kn(()=>{y.current={key:e,state:o}});let u=pt(null),c=re(()=>{u.current?.controller.abort(),u.current=null},[]);Ra(()=>c,[e,n,c]);let b=re(()=>{c(),s()},[c,s]),f=re(()=>{c(),l()},[c,l]),m=re(()=>{let{key:p,state:E}=y.current;if(p===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let h=E.value.next,T={key:p,controller:new AbortController,maps:[]};u.current=T,i(p,kt),r.current.next(h,T.controller.signal).then(x=>{u.current===T&&(u.current=null,i(p,k=>T.maps.reduce(($,oe)=>Oe($,oe),Lt(k,h,x))))},x=>{u.current===T&&i(p,()=>{throw x})})},[i]),R=re((p,E)=>{let h=u.current;h!==null&&Object.is(h.key,p)&&h.maps.push(E),d(p,T=>Oe(T,E))},[d]);return{state:o,reload:b,refresh:f,loadMore:m,updateList:R}};import{useCallback as Ea,useRef as xa,useState as wa}from"react";var va=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Pa=()=>{let[e,t]=wa(null),n=xa(null),r=Ea((a,o)=>{let s=o();if(!va(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};import{useCallback as Na}from"react";var Ca=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Ie(e,t,n,Pt,He),l=Na((i,d)=>s(i,y=>He(y,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as La}from"react/jsx-runtime";var ka=({testId:e,children:t})=>(g(),La("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ge as ANNOUNCE_SETTLE_MS,rr as AccessFailureNotice,ce as AlertMessage,or as Breadcrumb,I as Button,ht as COMPACT_ROW_PX,Ka as CONSOLE_UI_LABEL_CATALOGS,_a as CONTRAST_MINIMUM,bt as CONTRAST_PAIRS,We as Card,ur as CardSection,jr as CheckboxGroup,Ge as Cluster,pr as CodeBlock,mr as ComparisonGrid,Hn as ConsoleUiRoot,Lr as DataTable,Sr as DescriptionList,Ar as Dialog,Or as Disclosure,X as FIGURE_RING_REACH_PX,Za as FLEXIBLE_COLUMN_MIN_PX,et as FailureMessage,qr as Field,oo as Figure,so as FigureEdge,io as FigureNode,Xn as FragmentLink,si as HTTP_FORBIDDEN,uo as Heading,yo as InlineChange,To as JobCard,Fe as LATTICE_PX,Jn as Link,vo as List,Po as ListItem,Lo as LoadMore,qa as MORE_CONTRAST_MINIMUM,Mo as MasterDetail,Ne as Measured,Io as Meter,ua as MetricTile,Kr as Notice,Ho as PanelTabs,Vr as PasswordInput,rt as Pill,ot as ProgressBar,Va as ROW_WITH_CONTROL_PX,Jr as RadioGroup,Uo as ResourceFailed,bn as RowButton,Wo as RowLink,qo as SegmentedControl,zr as Select,zo as SelectableList,jo as Slider,Zn as Stack,Yo as Stepper,ea as Switch,j as TARGET_PX,M as TOKENS,fi as TONES,pi as TONE_HUES,yi as TONE_ROLES,aa as Tabs,P as Text,Wr as TextArea,Gr as TextInput,ca as TileGrid,ya as Toolbar,ka as VisuallyHidden,$a as ZonedTimeError,kt as beginPage,Nt as beginPagedReload,Pt as beginReload,ja as ceil8,Ga as ceilToLattice,Xa as cellContentInlinePx,Qa as comparisonAttributePx,Ba as contrastRatio,ti as countSampleText,Wa as cssVar,Rt as figureBoxPlan,Et as figureDiscLabelPlan,Ha as fillLabel,Ya as fixedColumnPx,li as flatMapOutcome,Sa as formatByteSize,me as formatCount,Da as formatInstant,oi as goldenSectionPx,Ua as hexToSrgb,ei as instantSampleText,O as isReadableText,He as keepLastGood,ui as lightDark,di as mapOutcome,Oe as mapPagedList,ai as masterDetailPlan,Ja as monoTextWidthEm,ci as placeholderRule,F as pxToRem,Ma as readDecimalText,Ia as readIntegerText,Oa as reasonAside,gt as resolveConsoleUiLabels,Ct as settleFirstPage,Lt as settlePage,ri as spacedTextWidthEm,ii as tableFrameMinInlinePx,wt as tableMinInlinePx,za as textWidthEm,vt as tileGridPlan,ni as tileMinInlinePx,Fa as toOffsetIso,Aa as toWallTime,ft as topmostModalOf,On as useAccessFailure,Be as useAnnounce,C as useConsoleUi,dr as useEscapeToClose,ga as useFailureOccurrence,le as useFocusRescue,Ta as usePagedResource,Pa as usePendingPress,Ca as useResource};
@@ -102,6 +102,11 @@
102
102
  --cui-border-control: light-dark(#384353, #c2ccd9);
103
103
  --cui-border-subtle: light-dark(#6b6e73, #86909f);
104
104
  }
105
+ [data-cui-root][data-cui-reduced-motion] {
106
+ --cui-motion-1: 0ms;
107
+ --cui-motion-2: 0ms;
108
+ --cui-motion-3: 0ms;
109
+ }
105
110
  @media (prefers-reduced-motion: reduce) {
106
111
  [data-cui-root] {
107
112
  --cui-motion-1: 0ms;
@@ -126,7 +131,9 @@
126
131
  * in a control. Borders are drawn with `border` only (a `box-shadow` rule disappears in forced colours), and their width is
127
132
  * subtracted from the padding next to them. The one length off the lattice is the reading measure, 40ic (WCAG 1.4.8): every
128
133
  * paragraph the package draws, and the dialog, is at most 40 ideographs wide plus its own padding. Durations are read only from
129
- * the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion.
134
+ * the `--cui-motion-*` variables, which are `0ms` while the reader prefers reduced motion and in a root the host asks to
135
+ * reduce motion (`data-cui-reduced-motion`), and the one animation runs only outside every root that has asked it, for a
136
+ * reader who allows motion.
130
137
  * Text and surface colours are applied only through role attributes: `data-cui-fg` paints text,
131
138
  * `data-cui-surface` paints the surface text sits on, `data-cui-accent` paints non-text graphics
132
139
  * (the progress fill) and `data-cui-fill` paints the surface of a figure's shape; a figure's text takes its text role's colour
@@ -154,7 +161,8 @@
154
161
  * 全ての長さは 4 px の格子に乗る (箱の枠・余白・行の和は格子の倍数で、全ての操作は 44 px の的以上で、操作の中で中央に置く行は 44 との差が
155
162
  * 8 の倍数のもの (body と caption の 20、title の 28) だけ)。枠は `border` だけで描き (`box-shadow` の罫は強制配色で消える)、その幅は隣の
156
163
  * 余白から引く。格子に乗らない唯一の長さは読む段落の幅 40ic (WCAG 1.4.8) で、パッケージが描く全ての段落と対話は全角 40 字と自分の余白の
157
- * 和の幅まで。時間は `--cui-motion-*` の変数だけから読み、読み手が動きを減らすことを好む間はそれが `0ms`。
164
+ * 和の幅まで。時間は `--cui-motion-*` の変数だけから読み、読み手が動きを減らすことを好む間と、ホストが動きを減らす根 (`data-cui-reduced-motion`)
165
+ * の中ではそれが `0ms` で、唯一のアニメーションは、動きを許す読み手のそれを求めた根の外だけで走る。
158
166
  * 文字と面の色は役割の属性でだけ当てる (`data-cui-fg` は文字、`data-cui-surface` は文字が載る面、
159
167
  * `data-cui-accent` は文字以外の図形 (進行の塗り)、`data-cui-fill` は図の図形の面を塗る。図の文字は文字の役割の色を塗りに取り
160
168
  * (`currentColor`。その 1 つの宣言だけ)、図の線は `data-cui-stroke` から塗る)。それ以外の色は固定の文字以外の線で、描く面と共に列挙し、
@@ -175,6 +183,7 @@
175
183
  .cui-button,
176
184
  .cui-link,
177
185
  .cui-row-button,
186
+ .cui-row-link,
178
187
  .cui-input,
179
188
  .cui-radio input,
180
189
  .cui-checkbox input,
@@ -934,8 +943,11 @@
934
943
  同じ詳細度で名札の inline-block を上書きして行の全幅の帯にするので、行の分け方は親の flex で決める。
935
944
  行の間の 4 は名札の張り出し (箱 28 は body の行 20 の上下へ 4 ずつ出る) で、名札の行の隣の行の文字に名札を
936
945
  触れさせない。k 行の高さは 24 + 行の和 + 4(k − 1) で、どの段の行も 4 の倍数なので格子に乗る。
937
- UA の button の font の一括指定が戻す書体と数字の形は周りの文から継ぐ */
938
- .cui-row-button {
946
+ UA の button の font の一括指定が戻す書体と数字の形は周りの文から継ぐ。リンクの行 (RowLink) も同じ形で、UA のリンクの下線を
947
+ 持たない (行の全体が的で、行の字は文の中のリンクでない)。UA が button にだけ当てる字の戻し (太さ・斜体・字と語の間・大文字化・
948
+ 字下げ・影) を 2 つの行に書く (リンクは周りの文から継ぐので、書かなければ同じ所の 2 つの行が違う字を描く) */
949
+ .cui-row-button,
950
+ .cui-row-link {
939
951
  display: flex;
940
952
  box-sizing: border-box;
941
953
  flex-direction: column;
@@ -949,15 +961,27 @@
949
961
  border-radius: var(--cui-radius-item);
950
962
  font-family: inherit;
951
963
  font-variant-numeric: inherit;
964
+ font-weight: var(--cui-font-weight-regular);
965
+ font-style: normal;
966
+ letter-spacing: normal;
967
+ word-spacing: normal;
968
+ text-transform: none;
969
+ text-indent: 0;
970
+ text-shadow: none;
952
971
  text-align: start;
953
972
  overflow-wrap: anywhere;
954
973
  cursor: pointer;
955
974
  }
956
975
 
976
+ .cui-row-link {
977
+ text-decoration: none;
978
+ }
979
+
957
980
  /* 選んだ行は面の色に加えて始端の帯でも示す (色だけに頼らない)。帯は行自身の始端の枠で、その幅を始端の余白から
958
981
  引くので箱の寸法も文字の位置も選んでいない行と同じ。影で描くと強制配色が消し、焦点の輪と同じ outline で描くと
959
982
  焦点の規則 (詳細度が高い) が上書きして、選んだ直後の焦点の在る行で手掛かりが消える。枠なら右から左の根でも始端に在る */
960
- .cui-row-button[data-selected="true"] {
983
+ .cui-row-button[data-selected="true"],
984
+ .cui-row-link[aria-current="page"] {
961
985
  padding-inline-start: calc(var(--cui-space-3) - var(--cui-space-1));
962
986
  border-inline-start: var(--cui-space-1) solid var(--cui-info-accent);
963
987
  }
@@ -1052,9 +1076,11 @@
1052
1076
  margin-inline: auto;
1053
1077
  }
1054
1078
 
1055
- /* 動きを許す読み手には始端から終端 (100% − 25%) まで往復させる。区間はその長さを motion-3 ごとに 1 つ進む (75% は 3 つ) */
1079
+ /* 動きを許す読み手には始端から終端 (100% − 25%) まで往復させる。区間はその長さを motion-3 ごとに 1 つ進む (75% は 3 つ)。
1080
+ ホストが動きを減らす根 (data-cui-reduced-motion) の中は、媒体の問いが reduce の時と同じに中央に留める (印を持つどの祖先の下でも
1081
+ 往復させない。印の根の中の動きの時間は 0ms なので、往復させれば区間は中央でなく始端に留まる) */
1056
1082
  @media (prefers-reduced-motion: no-preference) {
1057
- .cui-progress-track[data-cui-indeterminate="true"] > .cui-progress-fill {
1083
+ .cui-progress-track[data-cui-indeterminate="true"]:not([data-cui-reduced-motion] *) > .cui-progress-fill {
1058
1084
  margin-inline: 0;
1059
1085
  animation-name: cui-progress-sweep;
1060
1086
  animation-duration: calc(3 * var(--cui-motion-3));
@@ -1902,7 +1928,8 @@
1902
1928
  @media (forced-colors: active) {
1903
1929
  /* 選んだ行の手掛かりは始端の枠の帯だけになるので Highlight で描く。焦点の規則は outline だけを持つので、焦点の
1904
1930
  在る選んだ行でも帯は残る */
1905
- .cui-row-button[data-selected="true"] {
1931
+ .cui-row-button[data-selected="true"],
1932
+ .cui-row-link[aria-current="page"] {
1906
1933
  border-inline-start-color: Highlight;
1907
1934
  }
1908
1935
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -65,7 +65,7 @@
65
65
  "react-dom": ">=19"
66
66
  },
67
67
  "devDependencies": {
68
- "@aiquants/auth-core": "0.9.1",
68
+ "@aiquants/auth-core": "0.9.2",
69
69
  "@testing-library/jest-dom": "^6.9.1",
70
70
  "@testing-library/react": "^16.3.2",
71
71
  "@testing-library/user-event": "^14.6.1",
@@ -1 +0,0 @@
1
- import{a as P,b as te,c as ne,d as F,i as A}from"./chunk-RA33TN5N.js";var Be="dialog:modal",He=e=>{let t=[...e.querySelectorAll(Be)];if(t.length===0)return{kind:"none"};let n=e.activeElement,r=t.filter(l=>l.contains(n)),o=r.length>0?r:t,a=o.find(l=>o.every(s=>s.contains(l)));return a===void 0?{kind:"undecidable"}:{kind:"topmost",dialog:a}};var ze=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],re=new Map,ae=e=>Number.isSafeInteger(e)&&e>=0,ie=(e,t,n)=>{let r=`${n} ${t}`,o=re.get(r);return o===void 0&&(o=new Intl.NumberFormat(t,{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!0}),re.set(r,o)),o.format(e===0?0:e)},$=(e,t)=>{if(!ae(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return ie(e,t,0)},oe=(e,t)=>Number((e/1024**t.power).toFixed(t.fractionDigits)),We=(e,t)=>{if(!ae(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[n,...r]=ze,o=n,a=oe(e,o);for(let l of r){if(a<1024)break;o=l,a=oe(e,o)}return`${ie(a,t,o.fractionDigits)} ${o.name}`},se=(e,t)=>t===void 0?e:`${e} ${t}`;var je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Ge=/[!-~]/g;var Xe=/^[^eE]*[1-9]/,le=e=>{let t=e.replace(Ge,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!je.test(t))return null;let n=Number(t);return Number.isFinite(n)?n===0?Xe.test(t)?null:0:n:null},Ye=e=>{let t=le(e);return t!==null&&Number.isSafeInteger(t)?t:null};var Ke=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,T=e=>Ke.test(e);var c=class extends RangeError{reason;constructor(t,n){super(n),this.name="ZonedTimeError",this.reason=t}},Ve=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,qe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,Je=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,de=864e5,v=6e4,O={min:1,max:9999},ce=new Map,ue=new Map,Ze=e=>{let t=ce.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),ce.set(e,t)),t},me=e=>{let t=new Date(0);return t.setUTCFullYear(e.year,e.month-1,e.day),t.setUTCHours(e.hour,e.minute,e.second,0),t.getUTCFullYear()===e.year&&t.getUTCMonth()===e.month-1&&t.getUTCDate()===e.day&&t.getUTCHours()===e.hour&&t.getUTCMinutes()===e.minute&&t.getUTCSeconds()===e.second?t.getTime():null},U=(e,t)=>{let[n,r,o,a,l,s,f]=t;if(f!==void 0&&/[1-9]/.test(f))throw new c("subsecond",`Fractions of a second cannot be kept: ${e}`);let u={year:Number(n),month:Number(r),day:Number(o),hour:Number(a),minute:Number(l),second:s===void 0?0:Number(s)},E=u.year>=O.min?me(u):null;if(E===null)throw new c("malformed",`Not a calendar date and time: ${e}`);return{fields:u,millis:E}},B=(e,t)=>{let n=new Map(Ze(t).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(n.get("year")),month:Number(n.get("month")),day:Number(n.get("day")),hour:Number(n.get("hour")),minute:Number(n.get("minute")),second:Number(n.get("second"))};if(n.get("era")!=="AD"||r.year>O.max)throw new c("malformed",`The wall clock falls outside years ${O.min}-${O.max}: ${new Date(e).toISOString()}`);return r},D=(e,t)=>me(B(e,t))-e,b=e=>String(e).padStart(2,"0"),fe=(e,t)=>{let n=`${String(e.year).padStart(4,"0")}-${b(e.month)}-${b(e.day)}T${b(e.hour)}:${b(e.minute)}`;return t||e.second!==0?`${n}:${b(e.second)}`:n},Qe=e=>{if(e%v!==0)throw new c("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let t=Math.abs(e)/v;return`${e<0?"-":"+"}${b(Math.floor(t/60))}:${b(t%60)}`},et=(e,t)=>{let n=Ve.exec(e);if(n===null)throw new c("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=U(e,n.slice(1)),l=[...new Set([D(o-de,t),D(o+de,t)])].filter(s=>D(o-s,t)===s);if(l.length===0)throw new c("nonexistent",`${e} does not exist in ${t}`);if(l.length>1)throw new c("ambiguous",`${e} occurs twice in ${t}`);return`${fe(r,!0)}${Qe(l[0])}`},ge=(e,t)=>{let[n,r,o,a]=t;if(n!==void 0)return 0;if(Number(o)>23||Number(a)>59)throw new c("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(a))*v},tt=(e,t)=>{let n=qe.exec(e);if(n===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=U(e,n.slice(1,8));return fe(B(r-ge(e,n.slice(8)),t),!1)},nt=(e,t)=>{let n=JSON.stringify([e,t]),r=ue.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ue.set(n,r)),r},H=(e,t,n)=>{let r=Je.exec(e);if(r===null)throw new c("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=U(e,[...r.slice(1,7),void 0]),a=o-ge(e,r.slice(7));return B(a,n),nt(t,n).format(a)};function rt(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?String(t[r]):n)}import{accessFailureKindOfStatus as ot}from"@aiquants/auth-core";var x=e=>e===""?"":` (${e})`,pe=(e,t)=>{if(e.status!==null&&ot(e.status)!==null)throw new RangeError(`failureSentence: a ${e.status} is an access failure, which the root's presenter states (draw it with FailureMessage or ResourceFailed)`);return t(e.reason)},at=(e,t)=>t===""?e:`${e} Reason: ${t}.`,it=(e,t)=>t===""?e:`${e}${t}\u3002`,w={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${x(e)}.`,refreshFailed:e=>`Could not refresh${x(e)}.`,forbiddenBecause:at,failureSentence:pe,loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${x(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${x(e)}\u3002`,forbiddenBecause:it,failureSentence:pe,loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},st=e=>{if(!Object.hasOwn(w,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(w).join(", ")}`);return w[e]};var dt=64,ct=255,ye=([e,t,n])=>{let r=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*n),o=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*n),a=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*n);return[.2104542553*r+.793617785*o-.0040720468*a,1.9779984951*r-2.428592205*o+.4505937099*a,.0259040371*r+.7827717662*o-.808675766*a]},ut=([e,t,n])=>{let r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3,l=s=>Math.min(1,Math.max(0,s));return[l(4.0767416621*r-3.3077115913*o+.2309699292*a),l(-1.2684380046*r+2.6097574011*o-.3413193965*a),l(-.0041960863*r-.7034186147*o+1.707614701*a)]},mt=e=>`#${e.map(t=>Math.round(ne(t)*ct).toString(16).padStart(2,"0")).join("")}`,Te=(e,t)=>{let n=P(e);if(t.length===0)throw new RangeError(`A more-contrast colour needs the surfaces it is drawn on: ${e}`);let r=F(n),o=t.map(d=>F(P(d))),a=o.every(d=>d>r);if(!(a||o.every(d=>d<r)))throw new RangeError(`The surfaces of a more-contrast colour must all be lighter or all be darker than it: ${e} on ${t.join(", ")}`);let l=a?Math.min(...o):Math.max(...o),s=a?0:1,f=d=>(Math.max(d,l)+.05)/(Math.min(d,l)+.05),u=Math.sqrt(f(r)*f(s));if(r===s)return e.toLowerCase();let E=ye(n.map(te)),ve=ye([s,s,s]),Q=d=>ut(E.map((p,L)=>p+d*(ve[L]-p))),Ue=([d,p,L])=>.2126*d+.7152*p+.0722*L,ee=0,N=1;for(let d=0;d<dt;d+=1){let p=(ee+N)/2;f(Ue(Q(p)))>=u?N=p:ee=p}return mt(Q(N))},be=(e,t)=>{let n=o=>{if(!Object.hasOwn(e,o))throw new RangeError(`Not a role of the palette: ${o}`);return e[o]};for(let o of Object.keys(t))n(o);let r=Object.fromEntries(Object.keys(e).map(o=>{let a=t[o];if(a===void 0)return[o,e[o]];let l=a.map(n),{light:s,dark:f}=e[o];return[o,Object.freeze({light:Te(s,l.map(u=>u.light)),dark:Te(f,l.map(u=>u.dark))})]}));return Object.freeze(r)};var ft=4,gt=[1,2,3,4,6,8,12,16,24],pt=16,yt=5/4,W={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Tt=11,he=3/2,bt=7/4,ht=7/4,xt=120,kt=3/2,Rt=[1,2,3],Ct=40,St="space-6",xe=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},j=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Tt,Math.round(pt*yt**e))},G=(e,t)=>xe(e*t),ke=G(j(W.body),he),k=ke+24,Re=k+8,Ce=ke+8,z={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},Et=()=>Object.fromEntries(gt.map(e=>[`space-${e}`,e*4])),Pt=()=>{let e=Object.fromEntries(Object.entries(W).map(([n,r])=>{let o=j(r);return[n,{size:o,lineHeight:G(o,n==="title"?ht:he)}]})),t=j(W.body);return{...e,prose:{size:t,lineHeight:G(t,bt)}}},Ot=()=>Object.fromEntries(Rt.map(e=>[`motion-${e}`,xt*kt**(e-1)])),Se=(e,t)=>{let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||!n.every(o=>Object.hasOwn(t,o)))throw new RangeError(`The more-contrast palette must hold the roles of the standard one: ${n.join(", ")} / ${r.join(", ")}`);return Object.freeze({space:Object.freeze(Et()),type:Object.freeze(Pt()),weight:z.weight,radius:z.radius,size:Object.freeze({"size-target":k,"size-control":k,"size-row":k,"size-row-control":Re,"size-row-compact":Ce}),stroke:z.stroke,motion:Object.freeze(Ot()),measure:Object.freeze({"measure-dialog":Object.freeze({ic:Ct,inset:St})}),color:Object.freeze({...e}),moreContrastColor:Object.freeze({...t})})};var Ee={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},wt=Object.freeze({...Object.fromEntries(Object.entries(A.light).map(([e,t])=>[e,Object.freeze(Object.keys(t))])),"border-subtle":Object.freeze(["surface","subtle","sunken"])}),i=Se(Ee,be(Ee,wt)),_t="--cui-",Mt=e=>`var(${_t}${e})`;var It=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,Pe=(e,t)=>{let n=0,r=0;for(let o of e)It(o.codePointAt(0))?r+=1:n+=1;return n*1+r*t},R=e=>Pe(e,.55),C=e=>Pe(e,.6),g=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var Oe="caption",K="body",V=2*i.space["space-3"],we={type:"caption",paddingInlinePx:2*i.space["space-2"]},X={type:"body",paddingInlinePx:2*i.space["space-3"]+2*i.stroke["border-width"],minInlinePx:i.size["size-control"]},_e={type:"body",minInlinePx:i.size["size-target"]},_={trackInlinePx:2*i.type.body.lineHeight+3*i.space["space-1"],labelGapPx:i.space["space-2"],type:"body"},Y={captionType:"caption",valueType:"heading",paddingInlinePx:2*i.space["space-3"]},Nt=10,Lt="2000-01-01T00:00:00Z",Ft=9999999,Me=(e,t,n)=>(t==="mono"?C(e):R(e))*i.type[n].size,At=(e,t)=>{if(e.length===0)throw new RangeError(`A ${t} needs at least one text to be measured with`);for(let n of e)if(!T(n))throw new RangeError(`A ${t} sample must hold a readable character: ${JSON.stringify(n)}`);return e},m=(e,t,n,r)=>Math.max(...At(e,t).map(o=>Me(o,n,r))),q=e=>{switch(e.kind){case"text":return m(e.texts,"text",e.face,e.type);case"measured":return m(e.texts,"measured value","sans",K);case"pill":return m(e.labels,"pill","sans",we.type)+we.paddingInlinePx;case"button":return Math.max(X.minInlinePx,m(e.labels,"button","sans",X.type)+X.paddingInlinePx);case"link":return Math.max(_e.minInlinePx,m(e.labels,"link","sans",_e.type));case"switch":return e.labelHidden?_.trackInlinePx:_.trackInlinePx+_.labelGapPx+m(e.labels,"switch","sans",_.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((t,n)=>t+q(n),0)+(e.items.length-1)*i.space[e.gap]}}},$t=(e,t)=>{let n=m([e.header],"column header","sans",Oe),r=e.note===void 0?0:m(e.note,"column header note","sans",Oe);return g(Math.max(n,r,...t.map(q))+V)},Dt=g(Me("\u3042".repeat(Nt),"sans",K)+V),vt=e=>g(m(e,"comparison attribute","sans",K)+V),Ut=(e,t)=>H(Lt,e,t),Bt=(e,t)=>{if(t!==void 0&&!T(t))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(t)}`);return se($(Ft,e),t)},Ht=(e,t)=>g(Math.max(m(e,"tile caption","sans",Y.captionType),m(t,"tile value","sans",Y.valueType))+Y.paddingInlinePx);var zt=.12,Wt=.16,jt=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,S=i.space["space-3"],M=(e,t)=>{let n=0,r=0;for(let a of e)n+=1,jt.test(a)&&(r+=1);return(t==="mono"?C(e):R(e))+zt*n+Wt*r},Gt=e=>{for(let n of[e.name,...e.notes])if(!T(n))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(n)}`);let t=Math.max(M(e.name,"sans")*i.type.body.size,...e.notes.map(n=>M(n,"sans")*i.type.caption.size));return{minWidthPx:g(t)+2*S,heightPx:2*S+i.type.body.lineHeight+e.notes.length*i.type.caption.lineHeight}},Hn=e=>{let t=S+i.type.body.lineHeight;return{insetPx:S,namePx:S+i.type.body.lineHeight/2,notesPx:Array.from({length:e},(n,r)=>t+r*i.type.caption.lineHeight+i.type.caption.lineHeight/2)}},Xt=(e,t)=>{if(e!==null&&!T(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${t}`);return e===null?{widthPx:0,extentBelowPx:t+Ie}:{widthPx:g(M(e,"sans")*i.type.caption.size),extentBelowPx:t+i.space["space-1"]+i.type.caption.lineHeight}},Ie=i.stroke["focus-offset"]+i.stroke["focus-width"],zn=i.stroke["focus-offset"]+i.stroke["focus-width"]/2;var I=(1+Math.sqrt(5))/2,Yt=(e,t)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(t)&&t>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${t}`);return e/I**t};var Kt=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},y=e=>`${Kt(e)/16}rem`;var Ne=({masterMinPx:e,detailMinPx:t,gapPx:n})=>{for(let r of[e,t])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Gap must be a px value >= 0: ${n}`);return e+n+t},Vt=(e,t)=>{let n=Ne(t);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<n)return{sideBySide:!1,sideBySideFromPx:n,masterInlinePx:e,detailInlinePx:e};let r=(e-t.gapPx)/(1+I),o=Math.min(Math.max(t.masterMinPx,r),e-t.gapPx-t.detailMinPx);return{sideBySide:!0,sideBySideFromPx:n,masterInlinePx:o,detailInlinePx:e-t.gapPx-o}},Kn=e=>{let t=Ne(e),n=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${n}"]`,o=y(e.gapPx),a=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,l=`clamp(${y(e.masterMinPx)},calc((100% - ${o}) / ${1+I}),calc(100% - ${o} - ${y(e.detailMinPx)}))`,s=`@container (min-width:${y(t)}){${r}{grid-template-columns:${l} minmax(0,1fr)}}`;return{key:n,css:a+s}};var qt=2*i.space["space-1"],Le=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Fe=e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let t=0,n=null;for(let{width:r}of e){if(r.fixedPx!==void 0){t+=Le(r.fixedPx);continue}let o=Le(r.minPx);if(n!==null&&n!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${n} and ${o}`);n=o,t+=o}return t},Jt=e=>Fe(e)+qt;var Zt=(e,t,n)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(t)&&t>0))throw new RangeError(`Tile minimum width must be a positive px value: ${t}`);if(!(Number.isFinite(n)&&n>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${n}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*t+(s-1)*n});let o=`cui-tiles-n${e}-m${t}-g${n}`,a=`[data-cui-tile-grid="${o}"]`,l=r.map(({columns:s,minContainerPx:f})=>{let u=`${a}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?u:`@container (min-width:${y(f)}){${u}}`});return{key:o,steps:r,css:l.join("")}};var Qt=403,en=(e,t)=>e.ok?{ok:!0,value:t(e.value)}:e,tn=(e,t)=>e.ok?t(e.value):e,er={kind:"idle"},nn={kind:"loading"},J=(e,t)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?t==="reload"?{...e,retrying:!0}:e:nn,Z=(e,t)=>t.ok?{kind:"ready",value:t.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&t.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:t.status,reason:t.reason}}:{kind:"failed",status:t.status,reason:t.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var rn=(e,t)=>{let n=J(e,t);return n.kind==="ready"?{...n,value:{...n.value,loadingMore:!1}}:n},on=(e,t)=>Z(e,t.ok?{ok:!0,value:{rows:t.value.rows,next:t.value.next,meta:t.value.meta,loadingMore:!1,moreFailure:null}}:t),an=e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,sn=(e,t,n)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,t)))return e;if(n.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...n.value.rows],next:n.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:n.reason,occurrence:r}}}},ln=(e,t)=>{if(e.kind!=="ready")return e;let{rows:n,meta:r}=t({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:n,meta:r}}};var dn=/^#[0-9a-f]{6}$/i,cn=/^[a-z][a-z0-9-]*$/,Ae=e=>{if(!dn.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},$e=({light:e,dark:t})=>`light-dark(${Ae(e)}, ${Ae(t)})`,un=e=>{if(!cn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${$e(i.color["fg-muted"])}; opacity: 1; }`};var De=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],mn=["fg","tint","accent","line","solid","solid-hover"],fn={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},h=({light:e,dark:t})=>Object.freeze({light:e,dark:t}),gn=({fg:e,tint:t,accent:n})=>Object.freeze({fg:h(e),tint:h(t),accent:h(n),line:h({light:e.dark,dark:e.light}),solid:h(e),"solid-hover":h({light:t.dark,dark:t.light})}),pn=Object.freeze(Object.fromEntries(De.map(e=>[e,gn(fn[e])])));export{Be as a,He as b,$ as c,We as d,se as e,le as f,Ye as g,T as h,c as i,et as j,tt as k,H as l,rt as m,x as n,w as o,st as p,ft as q,xe as r,k as s,Re as t,Ce as u,i as v,Mt as w,R as x,C as y,g as z,q as A,$t as B,Dt as C,vt as D,Ut as E,Bt as F,Ht as G,M as H,Gt as I,Hn as J,Xt as K,Ie as L,zn as M,Yt as N,y as O,Vt as P,Kn as Q,Fe as R,Jt as S,Zt as T,Qt as U,en as V,tn as W,er as X,nn as Y,J as Z,Z as _,rn as $,on as aa,an as ba,sn as ca,ln as da,$e as ea,un as fa,De as ga,mn as ha,pn as ia};