efficient-shell 7.38.0 → 7.43.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.
Files changed (78) hide show
  1. package/README.md +12 -0
  2. package/dist/{Browser-B2FN5CW3.js → Browser-XNIEIZS2.js} +14 -14
  3. package/dist/{Calculator-ABEYFTWE.js → Calculator-Q3TNKTCG.js} +20 -20
  4. package/dist/ConfirmDialog-QT4KJAP7.js +1 -0
  5. package/dist/{CurrencyConverter-CZKVL73H.js → CurrencyConverter-QIH4GI3K.js} +5 -5
  6. package/dist/{Documents-BXSLON5K.js → Documents-7AYPEXL2.js} +25 -25
  7. package/dist/Files-GKEGMDUL.js +87 -0
  8. package/dist/{Notepad-ULQRZ6ZR.js → Notepad-W4FJYXO4.js} +9 -9
  9. package/dist/PdfViewer-LGD633HY.js +1 -0
  10. package/dist/{PomodoroTimer-LJVH3GLO.js → PomodoroTimer-LMLEPMFD.js} +63 -63
  11. package/dist/{Preview-OH32MRJQ.js → Preview-DI7VDRQR.js} +25 -25
  12. package/dist/Sidebar-HT7BIMTD.js +44 -0
  13. package/dist/{Spreadsheet-7B27ZGVM.js → Spreadsheet-NTLSJ37V.js} +11 -11
  14. package/dist/{Stock-7BEWCZCA.js → Stock-VUGVYNNI.js} +3 -3
  15. package/dist/{Weather-O4XOPB7T.js → Weather-TAJQCYIV.js} +18 -18
  16. package/dist/{WorldClock-B3YYXJF7.js → WorldClock-ZQ2VI2NB.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/{chunk-PMUU2VHD.js → chunk-22EP5XS2.js} +1 -1
  21. package/dist/{chunk-6OXNDFJE.js → chunk-3G5TA3IF.js} +35 -8
  22. package/dist/{chunk-JLAK6FVZ.js → chunk-4TOFAEAW.js} +28 -28
  23. package/dist/{chunk-6IMYNQCU.js → chunk-6K5EFHDQ.js} +14 -14
  24. package/dist/{chunk-SBVD2F3P.js → chunk-7D6TZW44.js} +6 -6
  25. package/dist/{chunk-RMEUWIEO.js → chunk-7RI5F5VX.js} +1 -1
  26. package/dist/chunk-7TD4XKYF.js +1 -0
  27. package/dist/{chunk-K3LAW5NH.js → chunk-BY3KWWWU.js} +19 -19
  28. package/dist/{chunk-ZLG2NT3S.js → chunk-COUELSZF.js} +4 -4
  29. package/dist/{chunk-MWAPICLX.js → chunk-DENNF2LM.js} +2 -2
  30. package/dist/{chunk-YIEGC2CL.js → chunk-FBXOKW33.js} +2 -2
  31. package/dist/chunk-FWEGDHFT.js +1 -0
  32. package/dist/{chunk-YVECLMNT.js → chunk-FY3H52BM.js} +1 -1
  33. package/dist/{chunk-J7JAYQSK.js → chunk-JK4PTQFV.js} +1 -1
  34. package/dist/chunk-LVCRH3K6.js +1 -0
  35. package/dist/{chunk-ENOIIZYT.js → chunk-NT4SZH5L.js} +1 -1
  36. package/dist/{chunk-CQ4YXW4Y.js → chunk-OMOQC57R.js} +34 -34
  37. package/dist/{chunk-XUHJRDNO.js → chunk-PBZ2VHS3.js} +1 -1
  38. package/dist/{chunk-UPVVIK3X.js → chunk-PMDHTWBR.js} +494 -485
  39. package/dist/{chunk-WCGEABUZ.js → chunk-QDCMVFK5.js} +6 -6
  40. package/dist/{chunk-I5JYRYAY.js → chunk-TFYZB4NY.js} +2 -2
  41. package/dist/{chunk-GKI4SVYL.js → chunk-UAG5IEAY.js} +1 -1
  42. package/dist/{chunk-OGB77LUT.js → chunk-UNA3BQJI.js} +9 -9
  43. package/dist/{chunk-PYNMOS2E.js → chunk-WSRZRWN7.js} +1 -1
  44. package/dist/{chunk-K6VLDHTD.js → chunk-YD4DPX4H.js} +1 -1
  45. package/dist/{chunk-P6WZ24CB.js → chunk-YRLOXHKG.js} +1 -1
  46. package/dist/{chunk-CMUDEROF.js → chunk-ZELMENOO.js} +8 -8
  47. package/dist/{chunk-EH46USL7.js → chunk-ZN6W2KOC.js} +11 -11
  48. package/dist/file-intake/index.js +1 -1
  49. package/dist/i18n/index.d.ts +1 -1
  50. package/dist/icons/efficient-looks.js +126 -96
  51. package/dist/icons/efficient.d.ts +39 -9
  52. package/dist/icons/efficient.js +346 -317
  53. package/dist/icons/index.d.ts +1 -1
  54. package/dist/icons/index.js +1 -1
  55. package/dist/icons/lucide.js +7 -7
  56. package/dist/icons/phosphor.js +1 -1
  57. package/dist/icons/tabler.js +34 -17
  58. package/dist/{index-DkrMePmf.d.ts → index-p7sSFfAC.d.ts} +337 -190
  59. package/dist/index.d.ts +3 -3
  60. package/dist/index.js +682 -682
  61. package/dist/locales/zh-Hans.d.ts +1 -1
  62. package/dist/locales/zh-Hans.js +1 -1
  63. package/dist/map/index.js +2 -2
  64. package/dist/markdown/index.js +1 -1
  65. package/dist/page-tabs/index.js +5 -5
  66. package/dist/pdf/index.js +1 -1
  67. package/dist/{strings-Cn5SsfWm.d.ts → strings-BOGLdj8k.d.ts} +4 -0
  68. package/dist/telemetry/index.js +1 -1
  69. package/dist/ui/index.d.ts +2 -2
  70. package/dist/ui/index.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/ConfirmDialog-DHHLXNMV.js +0 -1
  73. package/dist/Files-BJGOJJZI.js +0 -87
  74. package/dist/PdfViewer-KA4YIRIO.js +0 -1
  75. package/dist/Sidebar-U34BBJFZ.js +0 -44
  76. package/dist/chunk-DJ3Z66LK.js +0 -1
  77. package/dist/chunk-G25GLRSP.js +0 -1
  78. package/dist/chunk-I7YEIAJ5.js +0 -1
@@ -1,72 +1,75 @@
1
- import{Breadcrumbs as e}from"./chunk-PMUU2VHD.js";import{OneLineLabel as t,TH_ONE_LINE as r}from"./chunk-AHN2BTZR.js";import{inputClasses as n,PLACEHOLDER_INK as a,FILTER_ON as l,FILTER_ON_INK as i,FILTER_OFF as o,INPUT_BASE_ON as s,INPUT_BASE as c,INPUT_SIZES as d}from"./chunk-HJQAE6SP.js";import{SidebarLayout as u}from"./chunk-YIEGC2CL.js";import{useShellLanguage as h}from"./chunk-XUHJRDNO.js";import{IconButton_default as m,BrandMark as p}from"./chunk-SBVD2F3P.js";import{loadIconSet as g,iconSetFor as f}from"./chunk-G25GLRSP.js";import{isSafeLinkHref as b}from"./chunk-PJPK2ADX.js";import{toast_default as x}from"./chunk-PYNMOS2E.js";import{useIsMobile as y,useShortcutLabel as v,useShellPrefs as w}from"./chunk-WCGEABUZ.js";import{reportBoundaryError as N}from"./chunk-KNUR2UEG.js";import{useTabLayer as k,focusableIn as $,useFocusTrap as M,useScrollLock as C,dialogA11y as L,stopAfter as D}from"./chunk-K3LAW5NH.js";import{PopupMenu as S,PopupMenuDivider as A,PopupMenuLabel as P,menuTextRowStyle as j,itemLook as z,MenuCheckMark as F,MenuSemanticsContext as E,leavesContextMenuAlone as B}from"./chunk-OGB77LUT.js";import{useDismissPopupsOnOpen as I}from"./chunk-UVBK6YSR.js";import{Button_default as T}from"./chunk-G5GERM76.js";import{Tooltip as O,useDropdownPosition as R,MENU_MAX_HEIGHT as W,placeMenu as K,popupBounds as _,followAnchor as q,VIEWPORT_MARGIN as H,swallowPress as U,describedByWith as V,OffWithReason as Y,POPUP_MAX_WIDTH as G,followRect as X,placeAtPoint as J}from"./chunk-3E27HV76.js";import{glassStyle as Z,GLASS_DIVIDER as Q,solidSurfaceStyle as ee}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as te,onOverlayOpen as re,Z_LAYERS as ne}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as ae,buttonClasses as le}from"./chunk-K7PQXJO7.js";import{useBrowserLayoutEffect as ie,useBrowserValue as oe,useHydrated as se,useBrowserValueOnce as ce,useBrowserState as de}from"./chunk-D65T4H6J.js";import{Icon as ue,setIconSet as he}from"./chunk-6OXNDFJE.js";import{useFileIntake as me,humanSize as pe,FileIntakeAlert as ge}from"./chunk-GKI4SVYL.js";import{useShellLocale as fe,useShellStrings as be,DEFAULT_SHELL_STRINGS as xe,currentShellStrings as ye,splitAround as ve}from"./chunk-DJ3Z66LK.js";import{formatPlain as we,formatFixed as Ne,formatPercent as ke}from"./chunk-C3QOHMR6.js";import{parseFocal as $e,formatFocal as Me,nudgeFocal as Ce,focalFromRect as Le}from"./chunk-AP2QEJXQ.js";import{calendarNames as De,firstDayOfWeek as Se,formatDate as Ae,EMPTY_VALUE as Pe,toInstant as je,timeAgo as ze,formatDateTime as Fe}from"./chunk-W32SKK3D.js";import{SpinnerRing as Ee,LoadingSpinner as Be}from"./chunk-2J6F4EE7.js";import{forwardRef as Ie,useCallback as Te,useState as Oe,useRef as Re,useId as We,useMemo as Ke,useEffect as _e,createContext as qe,Children as He,isValidElement as Ue,cloneElement as Ve,useContext as Ye,Fragment as Ge,Component as Xe,useSyncExternalStore as Je,useLayoutEffect as Ze}from"react";import{jsxs as Qe,jsx as et,Fragment as tt}from"react/jsx-runtime";import{createPortal as rt}from"react-dom";var nt=/(^|[\s:])!?z-/,at=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled;function lt({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Oe(!1),[g,f]=Oe(-1),b=Re(null),x=Re(null),y=Re(null),v=Re({text:"",at:0}),w=We(),N=We(),k=u??N,$=Te(e=>{p(!1),e&&x.current?.focus()},[]),M=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(at(t[l]))return l}return-1},C=()=>y.current?.closest("[data-popup-menu-tree]")??null;_e(()=>{if(!m)return;const e=e=>{const t=e.target;b.current?.contains(t)||C()?.contains(t)||$(!1)};document.addEventListener("pointerdown",e,!0);const t=re(()=>$(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,$]);const L=Te(()=>{const e=C(),t=x.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=K({trigger:t.getBoundingClientRect(),menu:l,bounds:_(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);ie(()=>{m&&L()}),_e(()=>{if(m)return q(()=>x.current,L)},[m,L]),_e(()=>{if(!m)return;const e=y.current,r=at(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),_e(()=>{if(m)return te(e=>"Escape"===e.key&&($(!0),!0),()=>y.current)},[m,$]);const D=e=>{f(e),p(!0)},E=e=>{e.disabled||($(!0),e.onSelect())},B=c??"a",I=e=>`${w}-status-${e}`,T=t.flatMap((e,t)=>"status"===e.type?[I(t)]:[]).join(" ")||void 0,O=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),R=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-22EP5XS2.js";import{OneLineLabel as t,TH_ONE_LINE as r}from"./chunk-AHN2BTZR.js";import{inputClasses as n,PLACEHOLDER_INK as a,FILTER_ON as l,FILTER_ON_INK as i,FILTER_OFF as o,INPUT_BASE_ON as s,INPUT_BASE as c,INPUT_SIZES as d}from"./chunk-HJQAE6SP.js";import{SidebarLayout as u}from"./chunk-FBXOKW33.js";import{useShellLanguage as h}from"./chunk-PBZ2VHS3.js";import{IconButton_default as m,BrandMark as p}from"./chunk-7D6TZW44.js";import{loadIconSet as g,iconSetFor as f}from"./chunk-FWEGDHFT.js";import{isSafeLinkHref as b}from"./chunk-PJPK2ADX.js";import{toast_default as y}from"./chunk-WSRZRWN7.js";import{useIsMobile as x,useShortcutLabel as v,useShellPrefs as w}from"./chunk-QDCMVFK5.js";import{reportBoundaryError as N}from"./chunk-KNUR2UEG.js";import{useTabLayer as k,focusableIn as $,useFocusTrap as M,useScrollLock as C,dialogA11y as L,stopAfter as D}from"./chunk-BY3KWWWU.js";import{PopupMenu as S,PopupMenuDivider as A,PopupMenuLabel as P,menuTextRowStyle as j,itemLook as z,MenuCheckMark as F,MenuSemanticsContext as E,leavesContextMenuAlone as I}from"./chunk-UNA3BQJI.js";import{useDismissPopupsOnOpen as B}from"./chunk-UVBK6YSR.js";import{Button_default as T}from"./chunk-G5GERM76.js";import{Tooltip as O,useDropdownPosition as R,MENU_MAX_HEIGHT as W,placeMenu as K,popupBounds as _,followAnchor as q,VIEWPORT_MARGIN as H,swallowPress as U,describedByWith as V,OffWithReason as Y,POPUP_MAX_WIDTH as G,followRect as X,placeAtPoint as Z}from"./chunk-3E27HV76.js";import{glassStyle as J,GLASS_DIVIDER as Q,solidSurfaceStyle as ee}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as te,onOverlayOpen as re,Z_LAYERS as ne}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as ae,buttonClasses as le}from"./chunk-K7PQXJO7.js";import{useBrowserLayoutEffect as ie,useBrowserValue as oe,useHydrated as se,useBrowserValueOnce as ce,useBrowserState as de}from"./chunk-D65T4H6J.js";import{Icon as ue,setIconSet as he}from"./chunk-3G5TA3IF.js";import{useFileIntake as me,humanSize as pe,FileIntakeAlert as ge}from"./chunk-UAG5IEAY.js";import{useShellStrings as fe,useShellLocale as be,DEFAULT_SHELL_STRINGS as ye,currentShellStrings as xe,splitAround as ve}from"./chunk-LVCRH3K6.js";import{formatPlain as we,formatFixed as Ne,formatPercent as ke}from"./chunk-C3QOHMR6.js";import{parseFocal as $e,formatFocal as Me,nudgeFocal as Ce,focalFromRect as Le}from"./chunk-AP2QEJXQ.js";import{calendarNames as De,firstDayOfWeek as Se,formatDate as Ae,EMPTY_VALUE as Pe,toInstant as je,timeAgo as ze,formatDateTime as Fe}from"./chunk-W32SKK3D.js";import{SpinnerRing as Ee,LoadingSpinner as Ie}from"./chunk-2J6F4EE7.js";import{forwardRef as Be,useCallback as Te,useState as Oe,useRef as Re,useId as We,useMemo as Ke,useEffect as _e,createContext as qe,Children as He,isValidElement as Ue,cloneElement as Ve,useContext as Ye,Fragment as Ge,Component as Xe,useSyncExternalStore as Ze,useLayoutEffect as Je}from"react";import{jsxs as Qe,jsx as et,Fragment as tt}from"react/jsx-runtime";import{createPortal as rt}from"react-dom";var nt=/(^|[\s:])!?z-/,at=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled;function lt({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Oe(!1),[g,f]=Oe(-1),b=Re(null),y=Re(null),x=Re(null),v=Re({text:"",at:0}),w=We(),N=We(),k=u??N,$=Te(e=>{p(!1),e&&y.current?.focus()},[]),M=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(at(t[l]))return l}return-1},C=()=>x.current?.closest("[data-popup-menu-tree]")??null;_e(()=>{if(!m)return;const e=e=>{const t=e.target;b.current?.contains(t)||C()?.contains(t)||$(!1)};document.addEventListener("pointerdown",e,!0);const t=re(()=>$(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,$]);const L=Te(()=>{const e=C(),t=y.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=K({trigger:t.getBoundingClientRect(),menu:l,bounds:_(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);ie(()=>{m&&L()}),_e(()=>{if(m)return q(()=>y.current,L)},[m,L]),_e(()=>{if(!m)return;const e=x.current,r=at(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),_e(()=>{if(m)return te(e=>"Escape"===e.key&&($(!0),!0),()=>x.current)},[m,$]);const D=e=>{f(e),p(!0)},E=e=>{e.disabled||($(!0),e.onSelect())},I=c??"a",B=e=>`${w}-status-${e}`,T=t.flatMap((e,t)=>"status"===e.type?[B(t)]:[]).join(" ")||void 0,O=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),R=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
2
2
  return et("div",{role:"separator",children:/* @__PURE__ */et(A,{})},e.key);if("label"===e.type)/* @__PURE__ */
3
3
  return et("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */et(P,{children:e.label})},e.key);if("status"===e.type)/* @__PURE__ */
4
- return et("div",{id:I(t),className:"text-xs",style:j(),children:e.label},e.key);if("checkbox"===e.type){const r=z(!1,e.disabled,"");/* @__PURE__ */
4
+ return et("div",{id:B(t),className:"text-xs",style:j(),children:e.label},e.key);if("checkbox"===e.type){const r=z(!1,e.disabled,"");/* @__PURE__ */
5
5
  return Qe("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...O(t,e),children:[
6
6
  /* @__PURE__ */et(F,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=z(!1,e.disabled,"");/* @__PURE__ */
7
7
  return Qe("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>E(e),...O(t,e),children:[
8
- /* @__PURE__ */et(F,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=z(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Qe("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...O(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Qe(B,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>$(!0),...O(t,e),children:[e.icon,e.label]},e.key)}const r=z(e.danger,e.disabled,"");/* @__PURE__ */
8
+ /* @__PURE__ */et(F,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=z(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Qe("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...O(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Qe(I,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>$(!0),...O(t,e),children:[e.icon,e.label]},e.key)}const r=z(e.danger,e.disabled,"");/* @__PURE__ */
9
9
  return Qe("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>E(e),...O(t,e),children:[e.icon,e.label]},e.key)},W={...nt.test(o)?{}:{zIndex:ne.popup},minWidth:s};/* @__PURE__ */
10
10
  return Qe("div",{ref:b,className:`relative inline-flex ${l}`.trim(),children:[
11
- /* @__PURE__ */et("button",{ref:x,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?$(!1):D(M(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),D(M(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),D(M(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(a?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:e}),m&&
12
- /* @__PURE__ */et(S,{portal:!0,className:o,style:W,children:/* @__PURE__ */et("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,"aria-describedby":T,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(M(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(M(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(M(0,1));else if("End"===e.key)e.preventDefault(),f(M(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),$(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(at(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(R(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(R(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */et("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}var it="relative focus-visible:z-10",ot={secondary:"border-l-0",primary:"border-l border-white/30"},st=Ie(function({children:e,onClick:t,type:r="button",items:n,menuLabel:a,variant:l="primary",size:i="md",loading:o=!1,leftIcon:s,disabled:c=!1,disabledReason:d,tooltip:u,menuDisabled:h=!1,align:m="end",side:p="bottom",menuMinWidth:g,linkAs:f,block:b=!1,className:x=""},y){const v=c&&(null!=d&&""!==d&&!1!==d)&&!o,w=/* @__PURE__ */et(T,{ref:y,type:r,variant:l,size:i,loading:o,leftIcon:s,block:b,disabled:c&&!v,"aria-disabled":!!v||void 0,disabledReason:v?d:void 0,onClick:t,className:`rounded-r-none ${it}`,children:e}),N=b?"relative flex min-w-0 flex-1":"relative inline-flex",k=i.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
13
- return Qe("div",{className:[b?"flex w-full":"inline-flex","items-stretch",x].filter(Boolean).join(" "),children:[null==u||""===u||v?w:/* @__PURE__ */et(O,{content:u,className:N,children:w}),
14
- /* @__PURE__ */et(O,{content:a,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */et(lt,{"aria-label":a,items:n,align:m,side:p,minWidth:g,linkAs:f,disabled:h,triggerClassName:ae({variant:l,size:i,className:`rounded-l-none ${ot[l]} ${it}`}),trigger:/* @__PURE__ */et(ue,{name:"chevron-down",className:k,strokeWidth:2,"aria-hidden":"true"})})})]})}),ct=Ie(function({invalid:e,leftIcon:t,rightAdornment:r,size:l,className:i="",readOnly:o,...s},c){const d=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),u=
15
- /* @__PURE__ */et("input",{ref:c,"aria-invalid":e||void 0,readOnly:o,className:n({invalid:e,size:l,readOnly:o,className:[d,i].filter(Boolean).join(" ")}),...s});return t||r?/* @__PURE__ */Qe("div",{className:"relative",children:[t&&/* @__PURE__ */et("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${a}`,children:t}),u,r&&/* @__PURE__ */et("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):u}),dt=Ie(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:l=3,size:i,readOnly:o,...s},c){const d=Te(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
16
- return et("textarea",{ref:c,"aria-invalid":e||void 0,rows:l,onInput:d,readOnly:o,className:n({invalid:e,size:i,readOnly:o,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function ut(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function ht(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function mt(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?ut(e):ht(e)}function pt(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var gt=e=>Array.isArray(e.options);function ft(e){const t=[];for(const r of e)gt(r)?t.push(...r.options):t.push(r);return t}function bt(e,t){const r=[];for(const n of e){if(!gt(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function xt(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!gt(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
11
+ /* @__PURE__ */et("button",{ref:y,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?$(!1):D(M(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),D(M(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),D(M(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(a?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:e}),m&&
12
+ /* @__PURE__ */et(S,{portal:!0,className:o,style:W,children:/* @__PURE__ */et("div",{ref:x,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,"aria-describedby":T,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(M(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(M(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(M(0,1));else if("End"===e.key)e.preventDefault(),f(M(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),$(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=x.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(at(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(R(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(R(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */et("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}var it="relative focus-visible:z-10",ot={secondary:"border-l-0",primary:"border-l border-white/30"},st=Be(function({children:e,onClick:t,type:r="button",items:n,menuLabel:a,variant:l="primary",size:i="md",loading:o=!1,leftIcon:s,disabled:c=!1,disabledReason:d,tooltip:u,menuDisabled:h=!1,align:m="end",side:p="bottom",menuMinWidth:g,linkAs:f,block:b=!1,className:y=""},x){const v=c&&(null!=d&&""!==d&&!1!==d)&&!o,w=/* @__PURE__ */et(T,{ref:x,type:r,variant:l,size:i,loading:o,leftIcon:s,block:b,disabled:c&&!v,"aria-disabled":!!v||void 0,disabledReason:v?d:void 0,onClick:t,className:`rounded-r-none ${it}`,children:e}),N=b?"relative flex min-w-0 flex-1":"relative inline-flex",k=i.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
13
+ return Qe("div",{className:[b?"flex w-full":"inline-flex","items-stretch",y].filter(Boolean).join(" "),children:[null==u||""===u||v?w:/* @__PURE__ */et(O,{content:u,className:N,children:w}),
14
+ /* @__PURE__ */et(O,{content:a,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */et(lt,{"aria-label":a,items:n,align:m,side:p,minWidth:g,linkAs:f,disabled:h,triggerClassName:ae({variant:l,size:i,className:`rounded-l-none ${ot[l]} ${it}`}),trigger:/* @__PURE__ */et(ue,{name:"chevron-down",className:k,strokeWidth:2,"aria-hidden":"true"})})})]})}),ct=Be(function({invalid:e,leftIcon:t,rightAdornment:r,size:l,className:i="",readOnly:o,...s},c){const d=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),u=
15
+ /* @__PURE__ */et("input",{ref:c,"aria-invalid":e||void 0,readOnly:o,className:n({invalid:e,size:l,readOnly:o,className:[d,i].filter(Boolean).join(" ")}),...s});return t||r?/* @__PURE__ */Qe("div",{className:"relative",children:[t&&/* @__PURE__ */et("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${a}`,children:t}),u,r&&/* @__PURE__ */et("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):u}),dt=Be(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:l=3,size:i,readOnly:o,...s},c){const d=Te(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
16
+ return et("textarea",{ref:c,"aria-invalid":e||void 0,rows:l,onInput:d,readOnly:o,className:n({invalid:e,size:i,readOnly:o,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function ut(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function ht(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function mt(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?ut(e):ht(e)}function pt(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var gt=e=>Array.isArray(e.options);function ft(e){const t=[];for(const r of e)gt(r)?t.push(...r.options):t.push(r);return t}function bt(e,t){const r=[];for(const n of e){if(!gt(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function yt(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!gt(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
17
17
  /* @__PURE__ */Qe("div",{role:"group","aria-labelledby":o,children:[
18
- /* @__PURE__ */et("div",{id:o,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${n}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,s+r))]},o))}),a}function yt({selected:e}){/* @__PURE__ */
18
+ /* @__PURE__ */et("div",{id:o,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${n}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,s+r))]},o))}),a}function xt({selected:e}){/* @__PURE__ */
19
19
  return et(ue,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}function vt(e,t){return e.label.toLowerCase().includes(t)||(e.sublabel?.toLowerCase().includes(t)??!1)}function wt({children:e,grows:t=!1}){/* @__PURE__ */
20
- return et("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Nt=Ie(function({value:e,onChange:t,options:r,placeholder:a,invalid:l,className:i="",size:o,touchSize:s,renderOption:c,renderValue:d,valueText:u,readOnly:h,multiple:m,...p},g){const f=t;/* @__PURE__ */
21
- return Qe("select",{ref:g,value:e,multiple:m||void 0,onChange:e=>f(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":l||void 0,className:n({invalid:l,size:o,className:`pr-8 ${i}`.trim()}),...p,children:[void 0!==a&&!m&&/* @__PURE__ */et("option",{value:"",disabled:!0,children:a}),
20
+ return et("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Nt=Be(function({value:e,onChange:t,options:r,placeholder:a,invalid:l,className:i="",size:o,touchSize:s,renderOption:c,renderValue:d,valueText:u,readOnly:h,footer:m,changed:p,multiple:g,...f},b){const y=t;/* @__PURE__ */
21
+ return Qe("select",{ref:b,value:e,multiple:g||void 0,onChange:e=>y(g?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":l||void 0,className:n({invalid:l,size:o,className:`pr-8 ${i}`.trim()}),...f,children:[void 0!==a&&!g&&/* @__PURE__ */et("option",{value:"",disabled:!0,children:a}),
22
22
  /* @__PURE__ */et(kt,{items:r})]})});function kt({items:e}){const t=e=>/* @__PURE__ */et("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
23
- return et(tt,{children:e.map((e,r)=>(e=>gt(e))(e)?/* @__PURE__ */et("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var $t=Ie(function({value:e,onChange:t,options:r,placeholder:l,invalid:i,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,...w},N){const[k,$]=Oe(!1),[M,C]=Oe(-1),L=Re(null),D=Re(null),S=Re(null),A=Re(k);A.current=k;const P=Re({buffer:"",timer:null}),j=We(),z=`${j}-listbox`,F=s??`${j}-trigger`,E=e=>`${j}-opt-${e}`,B=Ke(()=>ft(r),[r]),I=m?e:[],T=t,O=R(D,k,{matchTriggerWidth:!0}),K=m?B.findIndex(e=>I.includes(e.value)):B.findIndex(t=>t.value===e),_=m?B.filter(e=>I.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?B[K].label:void 0,q=!m&&K>=0?B[K].lang:void 0,H=m?B.filter(e=>I.includes(e.value)):K>=0?[B[K]]:[],U=g&&H.length?g(H):void 0,V=void 0!==U&&f?f(H):void 0,Y=Te((e=!0)=>{$(!1),C(-1),e&&D.current?.focus()},[]),G=Te(()=>{c||b||(C(K>=0?K:ut(B)),$(!0))},[c,b,B,K]),X=Te(t=>{const r=B[t];if(r&&!r.disabled){if(m){const n=e;return T(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void C(t)}T(r.value),Y()}},[B,m,e,T,Y]);_e(()=>{if(!k)return;return te(e=>!("Escape"!==e.key||!A.current)&&(Y(),!0),()=>S.current)},[k,Y]),_e(()=>{if(!k)return;const e=e=>{const t=e.target;L.current?.contains(t)||S.current?.contains(t)||Y(!1)};document.addEventListener("pointerdown",e);const t=re(()=>Y(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[k,Y]),_e(()=>{!k||M<0||S.current?.querySelector(`#${CSS.escape(E(M))}`)?.scrollIntoView({block:"nearest"})});const J=Te(e=>{const t=P.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=k?M:K,n=pt(B,t.buffer,r);n<0||(k?C(n):m?(C(n),$(!0)):X(n))},[k,M,K,B,X,m]),Q=k?xt(r,(t,r)=>{const n=(a=t.value,m?I.includes(a):e===a);var a;const l=r===M;/* @__PURE__ */
24
- return Qe("div",{id:E(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||C(r)},onClick:()=>X(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${m?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[m&&/* @__PURE__ */et(yt,{selected:n}),p?/* @__PURE__ */et("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */Qe("span",{className:"block min-w-0 flex-1",children:[
23
+ return et(tt,{children:e.map((e,r)=>(e=>gt(e))(e)?/* @__PURE__ */et("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var $t=Be(function({value:e,onChange:t,options:r,placeholder:l,invalid:i,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,footer:y,changed:x=!1,"aria-describedby":v,"aria-label":w,"aria-labelledby":N,...k},$){const[M,C]=Oe(!1),[L,D]=Oe(-1),S=Re(null),A=Re(null),P=Re(null),j=Re(null),z=Re([]),F=()=>j.current??P.current,E=!!y?.length,I=fe(),B=Re(M);B.current=M;const T=Re({buffer:"",timer:null}),O=We(),K=`${O}-listbox`,_=s??`${O}-trigger`,q=e=>`${O}-opt-${e}`,H=`${O}-changed`,U=[v,x?H:void 0].filter(Boolean).join(" ")||void 0,V=Ke(()=>ft(r),[r]),Y=m?e:[],G=t,X=R(A,M,{matchTriggerWidth:!0,...y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Z=m?V.findIndex(e=>Y.includes(e.value)):V.findIndex(t=>t.value===e),ee=m?V.filter(e=>Y.includes(e.value)).map(e=>e.label).join(", ")||void 0:Z>=0?V[Z].label:void 0,ae=!m&&Z>=0?V[Z].lang:void 0,le=m?V.filter(e=>Y.includes(e.value)):Z>=0?[V[Z]]:[],ie=g&&le.length?g(le):void 0,oe=void 0!==ie&&f?f(le):void 0,se=Te((e=!0)=>{C(!1),D(-1),e&&A.current?.focus()},[]),ce=Te(()=>{c||b||(D(Z>=0?Z:ut(V)),C(!0))},[c,b,V,Z]),de=Te(t=>{const r=V[t];if(r&&!r.disabled){if(m){const n=e;return G(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void D(t)}G(r.value),se()}},[V,m,e,G,se]);_e(()=>{if(!M)return;return te(e=>!("Escape"!==e.key||!B.current)&&(se(),!0),F)},[M,se]),_e(()=>{if(!M)return;const e=e=>{const t=e.target;S.current?.contains(t)||F()?.contains(t)||se(!1)};document.addEventListener("pointerdown",e);const t=re(()=>se(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[M,se]),_e(()=>{!M||L<0||P.current?.querySelector(`#${CSS.escape(q(L))}`)?.scrollIntoView({block:"nearest"})});const he=Te(e=>{const t=T.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=M?L:Z,n=pt(V,t.buffer,r);n<0||(M?D(n):m?(D(n),C(!0)):de(n))},[M,L,Z,V,de,m]),me=M?yt(r,(t,r)=>{const n=(a=t.value,m?Y.includes(a):e===a);var a;const l=r===L;/* @__PURE__ */
24
+ return Qe("div",{id:q(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||D(r)},onClick:()=>de(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${m?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[m&&/* @__PURE__ */et(xt,{selected:n}),p?/* @__PURE__ */et("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */Qe("span",{className:"block min-w-0 flex-1",children:[
25
25
  /* @__PURE__ */et("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */et("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.description?
26
26
  /* @__PURE__ */Qe(tt,{children:[
27
27
  /* @__PURE__ */et("span",{lang:t.lang,className:"block truncate",children:t.label}),
28
- /* @__PURE__ */et("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},j,"mx-1"):null;/* @__PURE__ */
29
- return Qe("div",{ref:L,className:"relative",children:[
30
- /* @__PURE__ */et("button",{ref:D,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?z:void 0,"aria-activedescendant":k&&M>=0?E(M):void 0,"aria-invalid":i||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>k?Y():G(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?C(e=>mt(B,e,1)):G());case"ArrowUp":return e.preventDefault(),void(k?C(e=>mt(B,e,-1)):G());case"Home":return void(k&&(e.preventDefault(),C(ut(B))));case"End":return void(k&&(e.preventDefault(),C(ht(B))));case"Enter":return void(k&&(e.preventDefault(),X(M)));case" ":return e.preventDefault(),void(k?X(M):G());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),Y()));case"Tab":return void(k&&Y(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),J(e.key))}},className:n({invalid:i,size:d,readOnly:b,className:`${b?"":"pr-8 "}text-left ${o}`.trim()}),children:void 0!==U?
28
+ /* @__PURE__ */et("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},O,"mx-1"):null,pe=void 0!==ie?
31
29
  /* @__PURE__ */Qe("span",{className:"relative block min-w-0 truncate",children:[
32
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:U}),
33
- /* @__PURE__ */et("span",{lang:void 0===V?q:void 0,className:"sr-only",children:V??_})]}):/* @__PURE__ */et("span",{lang:q,className:"block truncate "+(void 0===_?"text-gray-400":""),children:_??l??" "})}),!b&&/* @__PURE__ */et(ue,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${a}`,strokeWidth:2}),
34
- /* @__PURE__ */Qe("select",{ref:N,value:e,multiple:m||void 0,onChange:e=>T(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...w,children:[void 0!==l&&!m&&/* @__PURE__ */et("option",{value:"",disabled:!0,children:l}),
35
- /* @__PURE__ */et(kt,{items:r})]}),k&&rt(
36
- /* @__PURE__ */et("div",{ref:S,id:z,role:"listbox","aria-labelledby":v??(y?void 0:F),"aria-label":v?void 0:y,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:ne.popup,left:O?.left,top:O?.top,bottom:O?.bottom,width:O?.width,maxHeight:O?.maxHeight??W,visibility:O?void 0:"hidden",...Z()},children:Q}),document.body)]})}),Mt=Ie(function({touchSize:e="touch",...t},r){return y()&&!t.readOnly?/* @__PURE__ */et(Nt,{ref:r,...t,size:e}):/* @__PURE__ */et($t,{ref:r,...t})});function Ct(e,t,r,n){const a=We(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var Lt=Ie(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=Re(null),h=Ct(n,a,o,s);_e(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Te(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */et("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */Qe("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
37
- /* @__PURE__ */Qe("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */et("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */et("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Dt="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",St=Ie(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=Ct(r,n,i,o);return r||n?/* @__PURE__ */Qe("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
30
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:ie}),
31
+ /* @__PURE__ */et("span",{lang:void 0===oe?ae:void 0,className:"sr-only",children:oe??ee})]}):/* @__PURE__ */et("span",{lang:ae,className:"block truncate "+(void 0===ee?"text-gray-400":""),children:ee??l??" "}),ge={zIndex:ne.popup,left:X?.left,top:X?.top,bottom:X?.bottom,width:X?.width,maxHeight:X?.maxHeight??W,visibility:X?void 0:"hidden",...J()},be=/* @__PURE__ */et("div",{ref:P,id:K,role:"listbox","aria-labelledby":N??(w?void 0:_),"aria-label":N?void 0:w,"aria-multiselectable":m||void 0,className:E?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:E?{maxHeight:W}:ge,children:me}),ye=E?/* @__PURE__ */Qe("div",{ref:j,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:ge,children:[be,
32
+ /* @__PURE__ */et("div",{className:`shrink-0 border-t ${Q} px-1 py-1`,children:y.map((e,t)=>/* @__PURE__ */Qe("button",{ref:e=>{z.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(se(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(y?.length??0)-1,n=t=>{e.preventDefault(),z.current[t]?.focus()},a=()=>{e.preventDefault(),A.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?a():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?a():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void se());case"Escape":return e.preventDefault(),e.stopPropagation(),void se()}})(e,t),className:"flex w-full items-center gap-2 rounded-lg min-h-(--row-height-menu) px-3 py-2 text-left text-sm leading-5 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"),children:[e.icon&&/* @__PURE__ */et(ue,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
33
+ /* @__PURE__ */et("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):be;/* @__PURE__ */
34
+ return Qe("div",{ref:S,className:"relative",children:[
35
+ /* @__PURE__ */et("button",{ref:A,id:_,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?K:void 0,"aria-activedescendant":M&&L>=0?q(L):void 0,"aria-invalid":i||void 0,"aria-describedby":U,"aria-label":w,"aria-labelledby":N,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>M?se():ce(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?D(e=>mt(V,e,1)):ce());case"ArrowUp":return e.preventDefault(),void(M?D(e=>mt(V,e,-1)):ce());case"Home":return void(M&&(e.preventDefault(),D(ut(V))));case"End":return void(M&&(e.preventDefault(),D(ht(V))));case"Enter":return void(M&&(e.preventDefault(),de(L)));case" ":return e.preventDefault(),void(M?de(L):ce());case"Escape":return void(M&&(e.preventDefault(),e.stopPropagation(),se()));case"Tab":return M&&E&&!e.shiftKey?(e.preventDefault(),void z.current[0]?.focus()):void(M&&se(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),he(e.key))}},className:n({invalid:i,size:d,readOnly:b,className:`${b?"":"pr-8 "}text-left ${o}`.trim()}),children:x?
36
+ /* @__PURE__ */Qe("span",{className:"flex min-w-0 items-center gap-1",children:[pe,
37
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):pe}),x&&/* @__PURE__ */et("span",{id:H,hidden:!0,children:I.select.changed}),!b&&/* @__PURE__ */et(ue,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${a}`,strokeWidth:2}),
38
+ /* @__PURE__ */Qe("select",{ref:$,value:e,multiple:m||void 0,onChange:e=>G(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...k,children:[void 0!==l&&!m&&/* @__PURE__ */et("option",{value:"",disabled:!0,children:l}),
39
+ /* @__PURE__ */et(kt,{items:r})]}),M&&rt(ye,document.body)]})}),Mt=Be(function({touchSize:e="touch",...t},r){const n=x();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */et(Nt,{ref:r,...t,size:e}):/* @__PURE__ */et($t,{ref:r,...t}):/* @__PURE__ */et($t,{ref:r,...t,size:e})});function Ct(e,t,r,n){const a=We(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var Lt=Be(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=Re(null),h=Ct(n,a,o,s);_e(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Te(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */et("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */Qe("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
40
+ /* @__PURE__ */Qe("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */et("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */et("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Dt="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",St=Be(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=Ct(r,n,i,o);return r||n?/* @__PURE__ */Qe("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
38
41
  /* @__PURE__ */et("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Dt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
39
42
  /* @__PURE__ */Qe("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */et("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */et("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */et("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Dt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function At({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:o}){const s=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===He.count(o)?He.only(o):null,d=Ue(c)?c:null,u={};if(d){if(s){const e=(d.props["aria-describedby"]??"").split(/\s+/);u["aria-describedby"]=Array.from(new Set([...e,s].filter(Boolean))).join(" ")}a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0)}const h=d&&Object.keys(u).length>0?Ve(d,u):o;/* @__PURE__ */
40
43
  return Qe("div",{className:i,children:[e&&/* @__PURE__ */Qe("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
41
44
  /* @__PURE__ */et("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-2xs text-red-600",children:a}):n?/* @__PURE__ */et("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-2xs text-gray-400",children:n}):null]})}var Pt={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function jt({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:o,orientation:s="vertical",disabled:c=!1,className:d=""}){const u=We(),h=e?`${u}-label`:void 0;/* @__PURE__ */
42
- return et(At,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */et("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Pt[s],children:o.map(e=>/* @__PURE__ */et(St,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function zt({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=be(),l=Re(null),i=Re(!1);if(_e(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
45
+ return et(At,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */et("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Pt[s],children:o.map(e=>/* @__PURE__ */et(St,{name:a,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function zt({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=fe(),l=Re(null),i=Re(!1);if(_e(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
43
46
  return Qe("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${n}`.trim(),children:[
44
47
  /* @__PURE__ */et("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
45
48
  /* @__PURE__ */et("ul",{className:"mt-2 space-y-1",children:e.map(({fieldId:e,message:t},r)=>/* @__PURE__ */et("li",{children:e?/* @__PURE__ */et("a",{href:`#${e}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e)},className:"text-sm text-red-700 underline hover:text-red-900",children:t}):
46
- /* @__PURE__ */et("span",{className:"text-sm text-red-700",children:t})},`${e??""}-${r}`))})]})}var Ft="text-xs font-medium text-gray-600";function Et({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ft,t].filter(Boolean).join(" ")}function Bt({required:e,children:t,className:r="",...n}){/* @__PURE__ */
47
- return Qe("label",{className:Et({className:r}),...n,children:[t,e&&/* @__PURE__ */et("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var It="inline-flex max-w-full items-center whitespace-nowrap rounded-full",Tt={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},Ot={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function Rt(e,t="subtle"){return"solid"===t?Ot[e]:Tt[e]}var Wt=qe({}),Kt=qe(void 0);function _t(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function qt({groups:e,labelFor:t,children:r}){/* @__PURE__ */
49
+ /* @__PURE__ */et("span",{className:"text-sm text-red-700",children:t})},`${e??""}-${r}`))})]})}var Ft="text-xs font-medium text-gray-600";function Et({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ft,t].filter(Boolean).join(" ")}function It({required:e,children:t,className:r="",...n}){/* @__PURE__ */
50
+ return Qe("label",{className:Et({className:r}),...n,children:[t,e&&/* @__PURE__ */et("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Bt="inline-flex max-w-full items-center whitespace-nowrap rounded-full",Tt={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},Ot={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function Rt(e,t="subtle"){return"solid"===t?Ot[e]:Tt[e]}var Wt=qe({}),Kt=qe(void 0);function _t(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function qt({groups:e,labelFor:t,children:r}){/* @__PURE__ */
48
51
  return et(Wt.Provider,{value:e,children:/* @__PURE__ */et(Kt.Provider,{value:t,children:r})})}function Ht(){const e=Ye(Kt);return Te(t=>e?.(t)??_t(t),[e])}function Ut({status:e,label:r,emphasis:n="subtle"}){const a=Rt(Ye(Wt)[e]??"neutral",n),l=Ye(Kt),i=r??l?.(e)??_t(e);/* @__PURE__ */
49
- return et("span",{className:`${It} px-3 py-0.5 text-xs font-medium ${a}`,children:/* @__PURE__ */et(t,{children:i})})}var Vt="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function Yt({label:e,glyph:t,onClick:r}){/* @__PURE__ */
50
- return et(O,{content:e,describe:!1,children:/* @__PURE__ */et("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */et("span",{"aria-hidden":"true",children:t})})})}function Gt({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=be().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */et("span",{className:`${Vt} ${Tt.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
52
+ return et("span",{className:`${Bt} px-3 py-0.5 text-xs font-medium ${a}`,children:/* @__PURE__ */et(t,{children:i})})}var Vt="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function Yt({label:e,glyph:t,onClick:r}){/* @__PURE__ */
53
+ return et(O,{content:e,describe:!1,children:/* @__PURE__ */et("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */et("span",{"aria-hidden":"true",children:t})})})}function Gt({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=fe().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */et("span",{className:`${Vt} ${Tt.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
51
54
  return Qe("span",{role:"status",className:`${Vt} ${Tt.danger} ${s}`.trim(),children:[
52
55
  /* @__PURE__ */et("span",{children:c.error}),i&&/* @__PURE__ */et(Yt,{label:c.retry,glyph:"↻",onClick:i}),o&&/* @__PURE__ */et(Yt,{label:c.dismiss,glyph:"×",onClick:o})]});const d=r??c.uploading,u=null==a||Number.isNaN(a)?null:Math.max(0,Math.min(100,Math.round(a))),h="string"==typeof d?c.cancelVerb(d.toLowerCase()):c.cancel,m=e=>[e,n,null==u?"":`${u}%`].filter(Boolean).join(" ");/* @__PURE__ */
53
56
  return Qe("span",{role:"status","aria-live":"polite",className:`${Vt} ${Tt.info} ${s}`.trim(),children:[null==u&&/* @__PURE__ */et(Ee,{ink:""}),
54
- /* @__PURE__ */et("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */Qe(tt,{children:[d,m("")&&` ${m("")}`]})}),l&&/* @__PURE__ */et(Yt,{label:h,glyph:"×",onClick:l})]})}var Xt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Jt(e){if(/^data:/i.test(e||""))return function(e){const t=Xt.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Zt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Qt(e,t=xe.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function er(e,t,r="",n="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",n,t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function tr(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function rr({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
57
+ /* @__PURE__ */et("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */Qe(tt,{children:[d,m("")&&` ${m("")}`]})}),l&&/* @__PURE__ */et(Yt,{label:h,glyph:"×",onClick:l})]})}var Xt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Zt(e){if(/^data:/i.test(e||""))return function(e){const t=Xt.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Jt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Qt(e,t=ye.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function er(e,t,r="",n="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",n,t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function tr(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function rr({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
55
58
  return et("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${r}`,children:/* @__PURE__ */et(Gt,{state:"busy",verb:e,pct:t})})}function nr({children:e}){/* @__PURE__ */
56
- return et("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function ar(e,t=""){if(!e)return!1;const r=Xt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Zt.test(e)||n&&!a}function lr({className:e="h-4 w-4"}){/* @__PURE__ */
59
+ return et("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function ar(e,t=""){if(!e)return!1;const r=Xt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Jt.test(e)||n&&!a}function lr({className:e="h-4 w-4"}){/* @__PURE__ */
57
60
  return et(ue,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function ir({className:e="h-6 w-6"}){/* @__PURE__ */
58
- return et(ue,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function or({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:f=!0,allowReplace:b=!0,allowRemove:x=!0,replaceLabel:y,removeLabel:v,busy:w=!1,busyLabel:N,progress:k,disabled:$=!1}){const M=be().media,C=p??M.cta,L=y??M.replace,D=v??M.remove,S=N??M.uploading,A=We(),P=Re(null),[j,z]=Oe(null);_e(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=$||w,E=!!e&&(ar(e,c)||e===j),B=m??Qt(c,M),I=e=>{r?r(e):n?n(e):(e=>{P.current&&URL.revokeObjectURL(P.current);const r=URL.createObjectURL(e);P.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},O=me({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:F,onAccept:([e])=>I(e)}),{dragOver:R}=O,W=()=>{F||(r?r():O.open())},K=e?Jt(e):"",_=/* @__PURE__ */Qe("div",{children:[
59
- /* @__PURE__ */Qe("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",R?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[E?/* @__PURE__ */et("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */et("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */et(nr,{children:K}),w&&/* @__PURE__ */et(rr,{label:S,progress:k,rounded:"rounded-md"})]}),!$&&(b||x)&&/* @__PURE__ */Qe("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */et(T,{id:A,variant:"secondary",size:"sm",onClick:()=>W(),disabled:w,children:L}),x&&/* @__PURE__ */et(T,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),z(null),t("")},disabled:w,children:D})]})]}),q=/* @__PURE__ */et("button",{type:"button",id:A,onClick:()=>W(),disabled:F,"aria-label":"string"==typeof B?B:M.upload,"aria-busy":w||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...O.zoneProps,className:er(R,F,tr(F)),style:{minHeight:h},children:w?/* @__PURE__ */et(Gt,{state:"busy",verb:S,pct:k}):/* @__PURE__ */Qe(tt,{children:[
61
+ return et(ue,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function or({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:f=!0,allowReplace:b=!0,allowRemove:y=!0,replaceLabel:x,removeLabel:v,busy:w=!1,busyLabel:N,progress:k,disabled:$=!1}){const M=fe().media,C=p??M.cta,L=x??M.replace,D=v??M.remove,S=N??M.uploading,A=We(),P=Re(null),[j,z]=Oe(null);_e(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const F=$||w,E=!!e&&(ar(e,c)||e===j),I=m??Qt(c,M),B=e=>{r?r(e):n?n(e):(e=>{P.current&&URL.revokeObjectURL(P.current);const r=URL.createObjectURL(e);P.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},O=me({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:F,onAccept:([e])=>B(e)}),{dragOver:R}=O,W=()=>{F||(r?r():O.open())},K=e?Zt(e):"",_=/* @__PURE__ */Qe("div",{children:[
62
+ /* @__PURE__ */Qe("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",R?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[E?/* @__PURE__ */et("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */et("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */et(nr,{children:K}),w&&/* @__PURE__ */et(rr,{label:S,progress:k,rounded:"rounded-md"})]}),!$&&(b||y)&&/* @__PURE__ */Qe("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */et(T,{id:A,variant:"secondary",size:"sm",onClick:()=>W(),disabled:w,children:L}),y&&/* @__PURE__ */et(T,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),z(null),t("")},disabled:w,children:D})]})]}),q=/* @__PURE__ */et("button",{type:"button",id:A,onClick:()=>W(),disabled:F,"aria-label":"string"==typeof I?I:M.upload,"aria-busy":w||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...O.zoneProps,className:er(R,F,tr(F)),style:{minHeight:h},children:w?/* @__PURE__ */et(Gt,{state:"busy",verb:S,pct:k}):/* @__PURE__ */Qe(tt,{children:[
60
63
  /* @__PURE__ */et("span",{className:"text-gray-400",children:/* @__PURE__ */et(ir,{})}),
61
- /* @__PURE__ */et("span",{className:"px-3 text-xs text-gray-500",children:B}),
64
+ /* @__PURE__ */et("span",{className:"px-3 text-xs text-gray-500",children:I}),
62
65
  /* @__PURE__ */et("span",{className:"text-sm font-medium text-blue-600",children:C}),g&&/* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
63
66
  return Qe(At,{label:a,htmlFor:A,hint:l,error:i,required:o,className:s,children:[e?_:q,!r&&/* @__PURE__ */et("input",{...O.inputProps}),
64
- /* @__PURE__ */et(ge,{rejections:O.rejections})]})}function sr({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:n,fallbackHasAlpha:a=null,fallbackIsLight:l=null,subjectName:i,assetName:o,onSave:s,onRemove:c,accept:d="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:u="PNG · ICO · SVG · JPG · WEBP",maxBytes:h=5242880,previews:m=[],disabled:g=!1}){const f=Re(null),[b,x]=Oe(null),[y,v]=Oe(""),[w,N]=Oe(""),[k,$]=Oe(!1),[M,C]=Oe(!1),L=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),D=be().brandAsset,S=y||e||n||"",A=b?null:e?t:a,P=b?null:e?r:l;_e(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const j=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
67
+ /* @__PURE__ */et(ge,{rejections:O.rejections})]})}function sr({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:n,fallbackHasAlpha:a=null,fallbackIsLight:l=null,subjectName:i,assetName:o,onSave:s,onRemove:c,accept:d="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:u="PNG · ICO · SVG · JPG · WEBP",maxBytes:h=5242880,previews:m=[],disabled:g=!1}){const f=Re(null),[b,y]=Oe(null),[x,v]=Oe(""),[w,N]=Oe(""),[k,$]=Oe(!1),[M,C]=Oe(!1),L=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),D=fe().brandAsset,S=x||e||n||"",A=b?null:e?t:a,P=b?null:e?r:l;_e(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const j=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
65
68
  return Qe("section",{"aria-label":D.region(o,i),className:"grid gap-4 lg:grid-cols-2",children:[
66
69
  /* @__PURE__ */Qe("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
67
- /* @__PURE__ */et(or,{value:S,onChange:()=>{},onFile:e=>{if(g)return;j();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),N("")},label:o,hint:w||D.usedFor(i),error:w||void 0,accept:d,acceptHint:u,maxSizeBytes:h,fit:"contain",height:180,allowRemove:!1,busy:k||M,disabled:g}),
70
+ /* @__PURE__ */et(or,{value:S,onChange:()=>{},onFile:e=>{if(g)return;j();const t=URL.createObjectURL(e);f.current=t,y(e),v(t),N("")},label:o,hint:w||D.usedFor(i),error:w||void 0,accept:d,acceptHint:u,maxSizeBytes:h,fit:"contain",height:180,allowRemove:!1,busy:k||M,disabled:g}),
68
71
  /* @__PURE__ */Qe("div",{className:"mt-3 flex flex-wrap gap-2",children:[
69
- /* @__PURE__ */et(T,{onClick:async()=>{if(b&&!g&&!k){$(!0),N("");try{await s(b),j(),x(null),v("")}catch(e){N(e instanceof Error?e.message:D.saveFailed(L,o))}finally{$(!1)}}},disabled:!b||g,loading:k,children:D.save(L,o)}),(b||e)&&/* @__PURE__ */et(T,{variant:"ghost-danger",onClick:async()=>{if(!g&&!M){if(b)return j(),x(null),v(""),void N("");if(e){C(!0),N("");try{await c()}catch(e){N(e instanceof Error?e.message:D.removeFailed(L,o))}finally{C(!1)}}}},disabled:g,loading:M,children:b?D.discard:D.remove(L,o)})]})]}),m.length>0&&/* @__PURE__ */Qe("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":D.previews(o),children:[
72
+ /* @__PURE__ */et(T,{onClick:async()=>{if(b&&!g&&!k){$(!0),N("");try{await s(b),j(),y(null),v("")}catch(e){N(e instanceof Error?e.message:D.saveFailed(L,o))}finally{$(!1)}}},disabled:!b||g,loading:k,children:D.save(L,o)}),(b||e)&&/* @__PURE__ */et(T,{variant:"ghost-danger",onClick:async()=>{if(!g&&!M){if(b)return j(),y(null),v(""),void N("");if(e){C(!0),N("");try{await c()}catch(e){N(e instanceof Error?e.message:D.removeFailed(L,o))}finally{C(!1)}}}},disabled:g,loading:M,children:b?D.discard:D.remove(L,o)})]})]}),m.length>0&&/* @__PURE__ */Qe("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":D.previews(o),children:[
70
73
  /* @__PURE__ */et("h3",{className:"text-sm font-semibold text-gray-900",children:D.preview}),
71
74
  /* @__PURE__ */et("div",{className:"mt-3 grid gap-3",children:m.map(e=>{const t=/* @__PURE__ */et(p,{src:S,alt:D.alt(i,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:A,isLight:P,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
72
75
  return Qe("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
@@ -81,150 +84,156 @@ return Qe("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
81
84
  /* @__PURE__ */et("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??i}),e.url&&/* @__PURE__ */et("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
82
85
  /* @__PURE__ */et("div",{className:"mt-2 text-sm font-medium text-blue-700",children:e.title??i}),e.description&&/* @__PURE__ */et("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */Qe("div",{className:["flex items-center gap-3 rounded-md border border-gray-200 p-3","dark"===e.surface?"bg-gray-900 text-white":"bg-white text-gray-900"].join(" "),children:[t,
83
86
  /* @__PURE__ */et("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function cr(e,t={}){return t.preferSquare&&e.logo_square_url?{src:e.logo_square_url,hasAlpha:e.logo_square_has_alpha,isLight:e.logo_square_is_light,adaptive:!0}:"dark"===t.surface&&e.logo_on_dark_url?{src:e.logo_on_dark_url,hasAlpha:null,isLight:null,adaptive:!1}:{src:e.logo_url,hasAlpha:e.logo_has_alpha,isLight:e.logo_is_light,adaptive:!0}}var dr=qe(null);function ur(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function hr({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Oe(t),[i,o]=Oe(!0),[s,c]=Oe(null),d=Re(e),u=Re(t);d.current=e,u.current=t,_e(()=>{const e=new AbortController;let t=!0;return l(u.current),o(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),o(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),o(!1))}),()=>{t=!1,e.abort()}},[]),_e(()=>(ur(a.favicon_url),()=>ur(null)),[a.favicon_url]),_e(()=>{r&&(document.title=r(a))},[a,r]);const h=Ke(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
84
- return et(dr.Provider,{value:h,children:n})}function mr(){const e=Ye(dr);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var pr=/* @__PURE__ */et(ue,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function gr({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:x=!1,coverLabel:y,busy:v=!1,busyLabel:w,progress:N,disabled:k=!1,readOnly:$=!1}){const M=be().media,C=f??M.cta,L=y??M.cover,D=w??M.uploading,S=We(),[A,P]=Oe(null),j=k||v,z=!(!t&&!r||j||$),F=!!n&&!j&&!$,E=!!a&&!j&&!$,B=tr(j),I=g??Qt(d,M),T=me({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!z,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),O=T.dragOver,R=()=>{z&&(t?t():T.open())},W={width:p,height:p},K=z&&/* @__PURE__ */Qe("button",{type:"button",onClick:()=>R(),"aria-label":M.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${B}`,style:W,children:[
87
+ return et(dr.Provider,{value:h,children:n})}function mr(){const e=Ye(dr);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var pr=/* @__PURE__ */et(ue,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function gr({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:y=!1,coverLabel:x,busy:v=!1,busyLabel:w,progress:N,disabled:k=!1,readOnly:$=!1}){const M=fe().media,C=f??M.cta,L=x??M.cover,D=w??M.uploading,S=We(),[A,P]=Oe(null),j=k||v,z=!(!t&&!r||j||$),F=!!n&&!j&&!$,E=!!a&&!j&&!$,I=tr(j),B=g??Qt(d,M),T=me({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!z,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),O=T.dragOver,R=()=>{z&&(t?t():T.open())},W={width:p,height:p},K=z&&/* @__PURE__ */Qe("button",{type:"button",onClick:()=>R(),"aria-label":M.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${I}`,style:W,children:[
85
88
  /* @__PURE__ */et(ir,{className:"h-5 w-5"}),
86
- /* @__PURE__ */et("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),_=z?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>R(),"aria-label":"string"==typeof I?I:M.upload,className:er(O,!1,B),style:{minHeight:p+32},children:[
89
+ /* @__PURE__ */et("span",{className:"text-xs font-medium text-gray-500",children:M.add})]}),_=z?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>R(),"aria-label":"string"==typeof B?B:M.upload,className:er(O,!1,I),style:{minHeight:p+32},children:[
87
90
  /* @__PURE__ */et("span",{className:"text-gray-400",children:/* @__PURE__ */et(ir,{})}),
88
- /* @__PURE__ */et("span",{className:"px-3 text-xs text-gray-500",children:I}),
91
+ /* @__PURE__ */et("span",{className:"px-3 text-xs text-gray-500",children:B}),
89
92
  /* @__PURE__ */et("span",{className:"text-sm font-medium text-blue-600",children:C}),b&&/* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */et("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:/* @__PURE__ */et("span",{className:v?"invisible":void 0,children:M.empty})});/* @__PURE__ */
90
93
  return Qe(At,{label:l,labelId:l?`${S}-label`:void 0,htmlFor:S,hint:i,error:o,required:s,className:c,children:[
91
- /* @__PURE__ */Qe("div",{id:S,role:"group","aria-labelledby":l?`${S}-label`:void 0,"aria-describedby":o?`${S}-error`:i?`${S}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...j?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?_:/* @__PURE__ */Qe("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:ar(t.url,d),i=Jt(t.url),o=x&&(t.cover??0===r);/* @__PURE__ */
92
- return Qe("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:E?()=>P(null):void 0,onDragOver:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation(),A!==r&&a(A,r),P(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?M.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",B,A===r?"opacity-50":""].join(" "),style:{...W,cursor:E?"move":void 0},children:[l?/* @__PURE__ */et("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */et("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */et("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:L}),null!=t.caption&&/* @__PURE__ */et(nr,{children:t.caption}),F&&/* @__PURE__ */et("button",{type:"button",onClick:()=>n(t.id),"aria-label":M.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${B}`,style:{background:"var(--rosh-media-scrim-button)"},children:pr})]},t.id)}),K]}),v&&/* @__PURE__ */et(rr,{label:D,progress:N})]}),!t&&r&&/* @__PURE__ */et("input",{...T.inputProps}),
93
- /* @__PURE__ */et(ge,{rejections:T.rejections})]})}var fr=e=>String(e).padStart(2,"0"),br="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function xr(e){return`${e.getFullYear()}-${fr(e.getMonth()+1)}-${fr(e.getDate())}`}function yr(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var vr=e=>`${e.getFullYear()}-${fr(e.getMonth()+1)}`;var wr=()=>xr(/* @__PURE__ */new Date);var Nr=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),kr=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function $r({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,markedDates:u,readOnly:h=!1,"aria-label":m,className:p=""}){const g=Ke(()=>new Set(u??[]),[u]),f=yr(e),b=oe(wr,null),x=yr(b),y=be().calendar,v=fe(),w=De(v),N=oe(()=>Se(v),0),k=c??N,$=()=>{if(!x)return null;const e=vr(x);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,C]=Oe(()=>o||(f?vr(f):$())),L=i??M??$(),D=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,x),[S,A]=Oe(()=>e??b),P=Re(null),j=Re(!1),[z,F]=Oe("days"),E=Ke(()=>D?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(D,k):[],[L,k]),B=e=>!!a&&e<a||!!l&&e>l,I=S??b,T=E.some(e=>xr(e)===I),O=D?E.find(e=>e.getMonth()===D.getMonth())??E[0]:null,R=T&&I?I:O?xr(O):"";if(_e(()=>{j.current&&(j.current=!1,P.current?.querySelector('[data-active="true"]')?.focus())},[R,L]),!D)/* @__PURE__ */
94
+ /* @__PURE__ */Qe("div",{id:S,role:"group","aria-labelledby":l?`${S}-label`:void 0,"aria-describedby":o?`${S}-error`:i?`${S}-hint`:void 0,"aria-busy":v||void 0,...T.zoneProps,className:"relative rounded-lg transition-colors",style:{...j?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?_:/* @__PURE__ */Qe("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:ar(t.url,d),i=Zt(t.url),o=y&&(t.cover??0===r);/* @__PURE__ */
95
+ return Qe("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:E?()=>P(null):void 0,onDragOver:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=A&&(e.preventDefault(),e.stopPropagation(),A!==r&&a(A,r),P(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?M.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",I,A===r?"opacity-50":""].join(" "),style:{...W,cursor:E?"move":void 0},children:[l?/* @__PURE__ */et("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */et("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */et("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:L}),null!=t.caption&&/* @__PURE__ */et(nr,{children:t.caption}),F&&/* @__PURE__ */et("button",{type:"button",onClick:()=>n(t.id),"aria-label":M.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${I}`,style:{background:"var(--rosh-media-scrim-button)"},children:pr})]},t.id)}),K]}),v&&/* @__PURE__ */et(rr,{label:D,progress:N})]}),!t&&r&&/* @__PURE__ */et("input",{...T.inputProps}),
96
+ /* @__PURE__ */et(ge,{rejections:T.rejections})]})}var fr=e=>String(e).padStart(2,"0"),br="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function yr(e){return`${e.getFullYear()}-${fr(e.getMonth()+1)}-${fr(e.getDate())}`}function xr(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var vr=e=>`${e.getFullYear()}-${fr(e.getMonth()+1)}`;var wr=()=>yr(/* @__PURE__ */new Date);var Nr=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),kr=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function $r({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,markedDates:u,readOnly:h=!1,"aria-label":m,className:p=""}){const g=Ke(()=>new Set(u??[]),[u]),f=xr(e),b=oe(wr,null),y=xr(b),x=fe().calendar,v=be(),w=De(v),N=oe(()=>Se(v),0),k=c??N,$=()=>{if(!y)return null;const e=vr(y);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,C]=Oe(()=>o||(f?vr(f):$())),L=i??M??$(),D=null===L?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(L,y),[S,A]=Oe(()=>e??b),P=Re(null),j=Re(!1),[z,F]=Oe("days"),E=Ke(()=>D?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(D,k):[],[L,k]),I=e=>!!a&&e<a||!!l&&e>l,B=S??b,T=E.some(e=>yr(e)===B),O=D?E.find(e=>e.getMonth()===D.getMonth())??E[0]:null,R=T&&B?B:O?yr(O):"";if(_e(()=>{j.current&&(j.current=!1,P.current?.querySelector('[data-active="true"]')?.focus())},[R,L]),!D)/* @__PURE__ */
94
97
  return Qe("div",{className:p,"aria-hidden":"true","data-calendar-pending":"",children:[
95
98
  /* @__PURE__ */et("div",{className:"mb-2 h-6"}),
96
99
  /* @__PURE__ */et("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */et("div",0===t?{className:"py-1 text-xs",children:" "}:{className:br,children:/* @__PURE__ */et("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(D.getFullYear()+12*e,D.getMonth(),1):"months"===z?new Date(D.getFullYear()+e,D.getMonth(),1):kr(D,e),K=e=>{const t=vr(e);void 0===i&&C(t),s?.(t)},_=m??w.monthYear(D.getFullYear(),D.getMonth());/* @__PURE__ */
97
100
  return Qe("div",{className:p,children:[
98
101
  /* @__PURE__ */Qe("div",{className:"mb-2 flex items-center justify-between px-1",children:[
99
- /* @__PURE__ */et("button",{type:"button","aria-label":"years"===z?y.previousYears:"months"===z?y.previousYear:y.previousMonth,onClick:()=>K(W(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
100
- /* @__PURE__ */et("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */Qe(tt,{children:["years"!==z&&/* @__PURE__ */et("button",{type:"button","aria-label":y.chooseMonth(w.months[D.getMonth()]),onClick:()=>F(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:w.months[D.getMonth()]}),
101
- /* @__PURE__ */et("button",{type:"button","aria-label":y.chooseYear(D.getFullYear()),onClick:()=>F(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:D.getFullYear()})]}):/* @__PURE__ */et("span",{children:w.monthYear(D.getFullYear(),D.getMonth())})}),
102
- /* @__PURE__ */et("button",{type:"button","aria-label":"years"===z?y.nextYears:"months"===z?y.nextYear:y.nextMonth,onClick:()=>K(W(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===z&&/* @__PURE__ */et("div",{role:"group","aria-label":y.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:w.monthsShort.map((e,t)=>/* @__PURE__ */et("button",{type:"button","aria-pressed":t===D.getMonth(),onClick:()=>{K(new Date(D.getFullYear(),t,1)),F("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===D.getMonth()?"bg-blue-600 font-semibold text-white":x&&t===x.getMonth()&&D.getFullYear()===x.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===z&&/* @__PURE__ */et("div",{role:"group","aria-label":y.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=D.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */et("button",{type:"button","aria-pressed":e===D.getFullYear(),onClick:()=>{K(new Date(e,D.getMonth(),1)),F("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===D.getFullYear()?"bg-blue-600 font-semibold text-white":e===x?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
103
- /* @__PURE__ */Qe("div",{ref:P,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=yr(R)??x??D,r={ArrowLeft:()=>Nr(t,-1),ArrowRight:()=>Nr(t,1),ArrowUp:()=>Nr(t,-7),ArrowDown:()=>Nr(t,7),Home:()=>Nr(t,-(t.getDay()-k+7)%7),End:()=>Nr(t,6-(t.getDay()-k+7)%7),PageUp:()=>kr(t,e.shiftKey?-12:-1),PageDown:()=>kr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,A(xr(a)),void(vr(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||B(R)||n(R))},hidden:"days"!==z,children:[
102
+ /* @__PURE__ */et("button",{type:"button","aria-label":"years"===z?x.previousYears:"months"===z?x.previousYear:x.previousMonth,onClick:()=>K(W(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
103
+ /* @__PURE__ */et("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */Qe(tt,{children:["years"!==z&&/* @__PURE__ */et("button",{type:"button","aria-label":x.chooseMonth(w.months[D.getMonth()]),onClick:()=>F(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:w.months[D.getMonth()]}),
104
+ /* @__PURE__ */et("button",{type:"button","aria-label":x.chooseYear(D.getFullYear()),onClick:()=>F(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:D.getFullYear()})]}):/* @__PURE__ */et("span",{children:w.monthYear(D.getFullYear(),D.getMonth())})}),
105
+ /* @__PURE__ */et("button",{type:"button","aria-label":"years"===z?x.nextYears:"months"===z?x.nextYear:x.nextMonth,onClick:()=>K(W(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===z&&/* @__PURE__ */et("div",{role:"group","aria-label":x.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:w.monthsShort.map((e,t)=>/* @__PURE__ */et("button",{type:"button","aria-pressed":t===D.getMonth(),onClick:()=>{K(new Date(D.getFullYear(),t,1)),F("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===D.getMonth()?"bg-blue-600 font-semibold text-white":y&&t===y.getMonth()&&D.getFullYear()===y.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===z&&/* @__PURE__ */et("div",{role:"group","aria-label":x.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=D.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */et("button",{type:"button","aria-pressed":e===D.getFullYear(),onClick:()=>{K(new Date(e,D.getMonth(),1)),F("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===D.getFullYear()?"bg-blue-600 font-semibold text-white":e===y?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
106
+ /* @__PURE__ */Qe("div",{ref:P,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=xr(R)??y??D,r={ArrowLeft:()=>Nr(t,-1),ArrowRight:()=>Nr(t,1),ArrowUp:()=>Nr(t,-7),ArrowDown:()=>Nr(t,7),Home:()=>Nr(t,-(t.getDay()-k+7)%7),End:()=>Nr(t,6-(t.getDay()-k+7)%7),PageUp:()=>kr(t,e.shiftKey?-12:-1),PageDown:()=>kr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,A(yr(a)),void(vr(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||I(R)||n(R))},hidden:"days"!==z,children:[
104
107
  /* @__PURE__ */et("div",{role:"row",className:`${br} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
105
- /* @__PURE__ */et("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */et("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */et("div",{role:"row",className:`${br} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=xr(a),i=a.getMonth()!==D.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=B(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */et("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
106
- return et("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Qe("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Qe("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var Mr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Cr=e=>`${e.getFullYear()}-${Lr(e.getMonth()+1)}`,Lr=e=>String(e).padStart(2,"0");function Dr(e){return`${e.getFullYear()}-${Lr(e.getMonth()+1)}-${Lr(e.getDate())}`}function Sr(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Dr(new Date(r,n,t.getDate()-14)),to:Dr(a)};case"lastMonth":return{from:Dr(i(1)),to:Dr(l)};case"last3Months":return{from:Dr(i(3)),to:Dr(l)};case"last6Months":return{from:Dr(i(6)),to:Dr(l)};case"last12Months":return{from:Dr(i(12)),to:Dr(l)}}}function Ar(e,t,r){const n=Cr(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Pr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function jr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var zr=/* @__PURE__ */new Map;function Fr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:s=!1,name:c,id:d,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:x=!1,allowOpenEnd:y=!1}){const v=be().dateRange,w=fe(),N=n??(w?function(e){let t=zr.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),zr.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(w):jr),k=p??v.placeholder,$=a??!s,[M,C]=Oe(!1),[L,D]=Oe(e),[S,A]=Oe(t),[P,j]=Oe(null),[z,F]=Oe("from"),E=Re(null),B=Re(null),I=Re(null),T=We(),O=We(),W=We(),[K,_]=Oe(!1),q=R(E,M,{preferredMaxWidth:520,preferredMaxHeight:K?720:560,popupRef:I}),H=Re(null),U=Re(null),[V,Y]=Oe(!0);ie(()=>{const e=U.current;if(!M||!K||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==V&&Y(a)});const G=Re(null);ie(()=>{const e=I.current;if(!M||!q||!e)return;const t=getComputedStyle(e),r=q.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(K)null!==G.current&&G.current<=r&&_(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;G.current=e,e>r+.5&&_(!0)}});const[X,J]=Oe(!1);ie(()=>{const e=!!d&&(B.current?.labels?.length??0)>0;e!==X&&J(e)});const Q=!!h||!!u||X,ee=/* @__PURE__ */new Date,[te,ae]=Oe(()=>e?Cr(Pr(e)):Ar(ee,f,b)),oe=Mr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Sr(e,ee),f,b)),se=e=>e?N(e):"";_e(()=>{if(!M)return;const e=e=>{const t=e.target;E.current?.contains(t)||I.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=re(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[M]),_e(()=>{x&&C(!1)},[x]);const ce=()=>{r("",""),C(!1)},de=e&&t?`${se(e)} — ${se(t)}`:e?v.fromOnly(se(e)):t?v.toOnly(se(t)):"",he=De(w),me=e=>{const t=yr(e);return t?he.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},pe=e&&t?v.range(me(e),me(t)):e?v.fromOnly(me(e)):t?v.toOnly(me(t)):k,ge=e=>K?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(P===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(P===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),xe=/* @__PURE__ */Qe(tt,{children:[oe.map(e=>/* @__PURE__ */et("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Sr(e,ee);D(t.from),A(t.to),j(e),ae(t.from.slice(0,7))})(e),className:ge(e),"aria-label":K?v[e]:void 0,children:K?V?v[e]:v[`${e}Short`]:v[e]},e)),
107
- /* @__PURE__ */et("button",{type:"button",onClick:()=>j("Custom"),className:ge("Custom"),children:v.custom})]}),ye=(e,t)=>y?/* @__PURE__ */et("button",{type:"button","data-range-end":e,"aria-pressed":z===e,onClick:()=>F(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */et("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ve=e=>y&&z===e?" ring-1 ring-blue-400":"",we=
108
- /* @__PURE__ */et($r,{mode:"range",min:f,max:b,value:L||null,endValue:S||null,month:te,onMonthChange:ae,onSelect:e=>{j("Custom"),y?"from"===z?(S&&e>S?(D(S),A(e)):D(e),F("to")):L&&e<L?(A(L),D(e)):A(e):!L||L&&S?(D(e),A("")):e<L?(A(L),D(e)):A(e)},weekStartsOn:m,"aria-label":v.dialog});/* @__PURE__ */
108
+ /* @__PURE__ */et("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */et("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */et("div",{role:"row",className:`${br} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=yr(a),i=a.getMonth()!==D.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=I(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */et("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
109
+ return et("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Qe("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Qe("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var Mr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Cr=e=>`${e.getFullYear()}-${Lr(e.getMonth()+1)}`,Lr=e=>String(e).padStart(2,"0");function Dr(e){return`${e.getFullYear()}-${Lr(e.getMonth()+1)}-${Lr(e.getDate())}`}function Sr(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Dr(new Date(r,n,t.getDate()-14)),to:Dr(a)};case"lastMonth":return{from:Dr(i(1)),to:Dr(l)};case"last3Months":return{from:Dr(i(3)),to:Dr(l)};case"last6Months":return{from:Dr(i(6)),to:Dr(l)};case"last12Months":return{from:Dr(i(12)),to:Dr(l)}}}function Ar(e,t,r){const n=Cr(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Pr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function jr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var zr=/* @__PURE__ */new Map;function Fr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:s=!1,name:c,id:d,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:y=!1,allowOpenEnd:x=!1}){const v=fe().dateRange,w=be(),N=n??(w?function(e){let t=zr.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),zr.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(w):jr),k=p??v.placeholder,$=a??!s,[M,C]=Oe(!1),[L,D]=Oe(e),[S,A]=Oe(t),[P,j]=Oe(null),[z,F]=Oe("from"),E=Re(null),I=Re(null),B=Re(null),T=We(),O=We(),W=We(),[K,_]=Oe(!1),q=R(E,M,{preferredMaxWidth:520,preferredMaxHeight:K?720:560,popupRef:B}),H=Re(null),U=Re(null),[V,Y]=Oe(!0);ie(()=>{const e=U.current;if(!M||!K||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==V&&Y(a)});const G=Re(null);ie(()=>{const e=B.current;if(!M||!q||!e)return;const t=getComputedStyle(e),r=q.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(K)null!==G.current&&G.current<=r&&_(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;G.current=e,e>r+.5&&_(!0)}});const[X,Z]=Oe(!1);ie(()=>{const e=!!d&&(I.current?.labels?.length??0)>0;e!==X&&Z(e)});const Q=!!h||!!u||X,ee=/* @__PURE__ */new Date,[te,ae]=Oe(()=>e?Cr(Pr(e)):Ar(ee,f,b)),oe=Mr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Sr(e,ee),f,b)),se=e=>e?N(e):"";_e(()=>{if(!M)return;const e=e=>{const t=e.target;E.current?.contains(t)||B.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=re(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[M]),_e(()=>{y&&C(!1)},[y]);const ce=()=>{r("",""),C(!1)},de=e&&t?`${se(e)} — ${se(t)}`:e?v.fromOnly(se(e)):t?v.toOnly(se(t)):"",he=De(w),me=e=>{const t=xr(e);return t?he.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},pe=e&&t?v.range(me(e),me(t)):e?v.fromOnly(me(e)):t?v.toOnly(me(t)):k,ge=e=>K?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(P===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(P===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),ye=/* @__PURE__ */Qe(tt,{children:[oe.map(e=>/* @__PURE__ */et("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Sr(e,ee);D(t.from),A(t.to),j(e),ae(t.from.slice(0,7))})(e),className:ge(e),"aria-label":K?v[e]:void 0,children:K?V?v[e]:v[`${e}Short`]:v[e]},e)),
110
+ /* @__PURE__ */et("button",{type:"button",onClick:()=>j("Custom"),className:ge("Custom"),children:v.custom})]}),xe=(e,t)=>x?/* @__PURE__ */et("button",{type:"button","data-range-end":e,"aria-pressed":z===e,onClick:()=>F(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */et("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ve=e=>x&&z===e?" ring-1 ring-blue-400":"",we=
111
+ /* @__PURE__ */et($r,{mode:"range",min:f,max:b,value:L||null,endValue:S||null,month:te,onMonthChange:ae,onSelect:e=>{j("Custom"),x?"from"===z?(S&&e>S?(D(S),A(e)):D(e),F("to")):L&&e<L?(A(L),D(e)):A(e):!L||L&&S?(D(e),A("")):e<L?(A(L),D(e)):A(e)},weekStartsOn:m,"aria-label":v.dialog});/* @__PURE__ */
109
112
  return Qe("div",{className:"relative"+(g?" w-full":""),ref:E,children:[
110
- /* @__PURE__ */Qe("div",{className:`${g?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?`${l} ${i}`:o}${x?" cursor-not-allowed opacity-60":""}`,children:[
111
- /* @__PURE__ */Qe("button",{ref:B,type:"button",onClick:()=>{x||(D(e),A(t),j(null),F(e&&!t?"to":"from"),ae(e?Cr(Pr(e)):Ar(ee,f,b)),C(!0))},"aria-haspopup":"dialog","aria-expanded":M,id:d,disabled:x||void 0,"aria-label":h,"aria-labelledby":u,"aria-describedby":[Q?O:void 0,s?W:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":M?T:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(g?" min-w-0 flex-1 justify-start":""),children:[
113
+ /* @__PURE__ */Qe("div",{className:`${g?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?`${l} ${i}`:o}${y?" cursor-not-allowed opacity-60":""}`,children:[
114
+ /* @__PURE__ */Qe("button",{ref:I,type:"button",onClick:()=>{y||(D(e),A(t),j(null),F(e&&!t?"to":"from"),ae(e?Cr(Pr(e)):Ar(ee,f,b)),C(!0))},"aria-haspopup":"dialog","aria-expanded":M,id:d,disabled:y||void 0,"aria-label":h,"aria-labelledby":u,"aria-describedby":[Q?O:void 0,s?W:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":M?T:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(g?" min-w-0 flex-1 justify-start":""),children:[
112
115
  /* @__PURE__ */et(ue,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
113
- /* @__PURE__ */et("span",{className:"truncate",children:de||k})]}),$&&!x&&(e||t)&&/* @__PURE__ */et("button",{type:"button",onClick:ce,"aria-label":v.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Q&&/* @__PURE__ */et("span",{id:O,className:"sr-only",children:pe}),s&&/* @__PURE__ */et("span",{id:W,className:"sr-only",children:v.required}),c&&/* @__PURE__ */Qe(tt,{children:[
114
- /* @__PURE__ */et("input",{type:"hidden",name:c.from,value:e,disabled:x||void 0}),
115
- /* @__PURE__ */et("input",{type:"hidden",name:c.to,value:t,disabled:x||void 0})]}),M&&rt(
116
- /* @__PURE__ */Qe("div",{ref:I,id:T,role:"dialog","aria-label":v.dialog,"data-layout":K?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:ne.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,width:K&&q?q.maxWidth:"max-content",maxWidth:q?.maxWidth,maxHeight:q?.maxHeight,overflowY:"auto",visibility:q?void 0:"hidden",...Z()},children:[
117
- /* @__PURE__ */Qe("div",{className:K?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[ye("from",/* @__PURE__ */Qe(tt,{children:[
116
+ /* @__PURE__ */et("span",{className:"truncate",children:de||k})]}),$&&!y&&(e||t)&&/* @__PURE__ */et("button",{type:"button",onClick:ce,"aria-label":v.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Q&&/* @__PURE__ */et("span",{id:O,className:"sr-only",children:pe}),s&&/* @__PURE__ */et("span",{id:W,className:"sr-only",children:v.required}),c&&/* @__PURE__ */Qe(tt,{children:[
117
+ /* @__PURE__ */et("input",{type:"hidden",name:c.from,value:e,disabled:y||void 0}),
118
+ /* @__PURE__ */et("input",{type:"hidden",name:c.to,value:t,disabled:y||void 0})]}),M&&rt(
119
+ /* @__PURE__ */Qe("div",{ref:B,id:T,role:"dialog","aria-label":v.dialog,"data-layout":K?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:ne.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,width:K&&q?q.maxWidth:"max-content",maxWidth:q?.maxWidth,maxHeight:q?.maxHeight,overflowY:"auto",visibility:q?void 0:"hidden",...J()},children:[
120
+ /* @__PURE__ */Qe("div",{className:K?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[xe("from",/* @__PURE__ */Qe(tt,{children:[
118
121
  /* @__PURE__ */et("span",{className:"text-xs font-medium text-gray-500",children:v.from}),
119
- /* @__PURE__ */et("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ve("from")}`,children:L?se(L):v.start})]})),!K&&/* @__PURE__ */et("span",{className:"text-gray-300",children:"—"}),ye("to",/* @__PURE__ */Qe(tt,{children:[
122
+ /* @__PURE__ */et("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ve("from")}`,children:L?se(L):v.start})]})),!K&&/* @__PURE__ */et("span",{className:"text-gray-300",children:"—"}),xe("to",/* @__PURE__ */Qe(tt,{children:[
120
123
  /* @__PURE__ */et("span",{className:"text-xs font-medium text-gray-500",children:v.to}),
121
124
  /* @__PURE__ */et("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${S?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ve("to")}`,children:S?se(S):v.end})]}))]}),K?/* @__PURE__ */Qe(tt,{children:[oe.length>0&&/* @__PURE__ */Qe("div",{className:"mb-3 @container",children:[!V&&/* @__PURE__ */et("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:v.lastHeading}),
122
- /* @__PURE__ */Qe("div",{ref:U,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[xe,oe.map(e=>/* @__PURE__ */et("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
125
+ /* @__PURE__ */Qe("div",{ref:U,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[ye,oe.map(e=>/* @__PURE__ */et("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
123
126
  /* @__PURE__ */et("div",{className:"w-full",children:we})]}):
124
127
  /* @__PURE__ */Qe("div",{ref:H,className:"flex w-max gap-4",children:[
125
- /* @__PURE__ */et("div",{className:"w-64",children:we}),oe.length>0&&/* @__PURE__ */et("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:xe})]}),
128
+ /* @__PURE__ */et("div",{className:"w-64",children:we}),oe.length>0&&/* @__PURE__ */et("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:ye})]}),
126
129
  /* @__PURE__ */Qe("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[$&&/* @__PURE__ */et("button",{type:"button",onClick:ce,className:le({variant:"ghost"}),children:v.clear}),
127
130
  /* @__PURE__ */et("button",{type:"button",onClick:()=>C(!1),className:le({variant:"secondary"}),children:v.cancel}),
128
- /* @__PURE__ */et("button",{type:"button",onClick:()=>{r(L,S),C(!1)},disabled:y?!L&&!S:!L||!S,className:le({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var Er=/^\d{2}:\d{2}(:\d{2})?$/,Br=e=>String(e).padStart(2,"0");function Ir(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Br(e.getHours())}:${Br(e.getMinutes())}`;return t?`${r}:${Br(e.getSeconds())}`:r}return Er.test(e)?e:""}var Tr=Ie(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",step:s,...c},d){const u=null!=s&&Number(s)<60,h=fe();/* @__PURE__ */
129
- return et("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":l||void 0,value:Ir(e,u),min:Ir(r,u)||void 0,max:Ir(a,u)||void 0,onChange:e=>t?.(Er.test(e.target.value)?e.target.value:null),className:n({invalid:l,size:i,className:o}),...c})}),Or=/^\d{4}-\d{2}-\d{2}$/,Rr=/^(aria|data)-/,Wr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Kr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Dr(e);if(Or.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Dr(t)}function _r(e){if(!Or.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function qr(e,t){const r=_r(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Hr=Ie(function({value:e,onChange:t,min:r,max:l,invalid:i,size:o,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:y,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C},L){const D=y??!x,S=Kr(e),A=Kr(r),P=Kr(l),j=be().datePicker,z=fe(),F=De(z),[E,B]=Oe(!1),I=Re(null),T=Re(null),O=Re(null),W=We(),K=We(),_=We(),q=R(T,E,{popupRef:O}),[H,U]=Oe(!1);ie(()=>{const e=!!p&&(T.current?.labels?.length??0)>0;e!==H&&U(e)});const V=!u&&(!!m||H);if(_e(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||O.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=re(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),_e(()=>{if(E)return te(e=>"Escape"===e.key&&(B(!1),T.current?.focus(),!0),()=>O.current)},[E]),s)/* @__PURE__ */
130
- return et("input",{ref:L,type:"date",lang:z,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":i||void 0,value:S,min:A||void 0,max:P||void 0,onChange:e=>t?.(_r(e.target.value)),className:n({invalid:i,size:o,className:d}),"aria-labelledby":m,required:x,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C});const Y=Object.fromEntries(Object.entries(C).filter(([e])=>Rr.test(e)&&!Wr.has(e))),G=C["aria-required"],X=!!x||!0===G||"true"===G,J=[V?K:void 0,X?_:void 0,h].filter(Boolean).join(" ")||void 0,Z=Dr(/* @__PURE__ */new Date),Q=(!A||Z>=A)&&(!P||Z<=P),ee=b??j.placeholder;/* @__PURE__ */
131
- return Qe("div",{ref:I,className:"relative",children:[
131
+ /* @__PURE__ */et("button",{type:"button",onClick:()=>{r(L,S),C(!1)},disabled:x?!L&&!S:!L||!S,className:le({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var Er=/^\d{2}:\d{2}(:\d{2})?$/,Ir=e=>String(e).padStart(2,"0");function Br(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Ir(e.getHours())}:${Ir(e.getMinutes())}`;return t?`${r}:${Ir(e.getSeconds())}`:r}return Er.test(e)?e:""}var Tr=Be(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",step:s,...c},d){const u=null!=s&&Number(s)<60,h=be();/* @__PURE__ */
132
+ return et("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":l||void 0,value:Br(e,u),min:Br(r,u)||void 0,max:Br(a,u)||void 0,onChange:e=>t?.(Er.test(e.target.value)?e.target.value:null),className:n({invalid:l,size:i,className:o}),...c})}),Or=/^\d{4}-\d{2}-\d{2}$/,Rr=/^(aria|data)-/,Wr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Kr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Dr(e);if(Or.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Dr(t)}function _r(e){if(!Or.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function qr(e,t){const r=_r(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Hr=Be(function({value:e,onChange:t,min:r,max:l,invalid:i,size:o,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:y,clearable:x,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C},L){const D=x??!y,S=Kr(e),A=Kr(r),P=Kr(l),j=fe().datePicker,z=be(),F=De(z),[E,I]=Oe(!1),B=Re(null),T=Re(null),O=Re(null),W=We(),K=We(),_=We(),q=R(T,E,{popupRef:O}),[H,U]=Oe(!1);ie(()=>{const e=!!p&&(T.current?.labels?.length??0)>0;e!==H&&U(e)});const V=!u&&(!!m||H);if(_e(()=>{if(!E)return;const e=e=>{const t=e.target;B.current?.contains(t)||O.current?.contains(t)||I(!1)};document.addEventListener("pointerdown",e,!0);const t=re(()=>I(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),_e(()=>{if(E)return te(e=>"Escape"===e.key&&(I(!1),T.current?.focus(),!0),()=>O.current)},[E]),s)/* @__PURE__ */
133
+ return et("input",{ref:L,type:"date",lang:z,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":i||void 0,value:S,min:A||void 0,max:P||void 0,onChange:e=>t?.(_r(e.target.value)),className:n({invalid:i,size:o,className:d}),"aria-labelledby":m,required:y,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C});const Y=Object.fromEntries(Object.entries(C).filter(([e])=>Rr.test(e)&&!Wr.has(e))),G=C["aria-required"],X=!!y||!0===G||"true"===G,Z=[V?K:void 0,X?_:void 0,h].filter(Boolean).join(" ")||void 0,J=Dr(/* @__PURE__ */new Date),Q=(!A||J>=A)&&(!P||J<=P),ee=b??j.placeholder;/* @__PURE__ */
134
+ return Qe("div",{ref:B,className:"relative",children:[
132
135
  /* @__PURE__ */et("input",{ref:L,type:"hidden",name:g,form:v,value:S}),
133
- /* @__PURE__ */Qe("button",{ref:T,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?W:void 0,"aria-labelledby":m,"aria-describedby":J,"aria-label":u?`${u}${S?`, ${qr(S,F)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${n({invalid:i,size:o,className:d})} flex items-center justify-between text-left`,children:[
136
+ /* @__PURE__ */Qe("button",{ref:T,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?W:void 0,"aria-labelledby":m,"aria-describedby":Z,"aria-label":u?`${u}${S?`, ${qr(S,F)}`:""}`:void 0,onClick:()=>I(e=>!e),className:`${n({invalid:i,size:o,className:d})} flex items-center justify-between text-left`,children:[
134
137
  /* @__PURE__ */et("span",{className:S?"text-gray-900":"text-gray-400",children:S?qr(S,F):ee}),
135
138
  /* @__PURE__ */et(ue,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */et("span",{id:K,className:"sr-only",children:S?qr(S,F):ee}),X&&/* @__PURE__ */et("span",{id:_,className:"sr-only",children:j.required}),E&&rt(
136
139
  /* @__PURE__ */Qe("div",{ref:O,id:W,role:"dialog","aria-label":u??j.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:ne.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,maxWidth:q?.maxWidth,visibility:q?void 0:"hidden"},children:[
137
- /* @__PURE__ */et($r,{value:S||null,min:A||null,max:P||null,weekStartsOn:c,onSelect:e=>{B(!1),T.current?.focus(),t?.(_r(e))}}),(D||Q)&&/* @__PURE__ */Qe("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */et("button",{type:"button",onClick:()=>{B(!1),T.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:j.clear}),Q&&/* @__PURE__ */et("button",{type:"button",onClick:()=>{B(!1),T.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:j.today})]})]}),document.body)]})}),Ur=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Vr=e=>String(e).padStart(2,"0");function Yr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Vr(t.getMonth()+1)}-${Vr(t.getDate())}T${Vr(t.getHours())}:${Vr(t.getMinutes())}`:Ur.test(e)?e:"";var t}var Gr=Ie(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",...s},c){const d=fe();/* @__PURE__ */
138
- return et("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":l||void 0,value:Yr(e),min:Yr(r)||void 0,max:Yr(a)||void 0,onChange:e=>t?.(function(e){if(!Ur.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:n({invalid:l,size:i,className:o}),...s})});function Xr(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function Jr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function Zr(e,t,r){const n=await Jr(t,r),a=ye().copy;return n?x.success(a.copiedLabel(e)):x.error(a.failed),n}var Qr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},en={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function tn(){/* @__PURE__ */
140
+ /* @__PURE__ */et($r,{value:S||null,min:A||null,max:P||null,weekStartsOn:c,onSelect:e=>{I(!1),T.current?.focus(),t?.(_r(e))}}),(D||Q)&&/* @__PURE__ */Qe("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */et("button",{type:"button",onClick:()=>{I(!1),T.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:j.clear}),Q&&/* @__PURE__ */et("button",{type:"button",onClick:()=>{I(!1),T.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:j.today})]})]}),document.body)]})}),Ur=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Vr=e=>String(e).padStart(2,"0");function Yr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Vr(t.getMonth()+1)}-${Vr(t.getDate())}T${Vr(t.getHours())}:${Vr(t.getMinutes())}`:Ur.test(e)?e:"";var t}var Gr=Be(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",...s},c){const d=be();/* @__PURE__ */
141
+ return et("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":l||void 0,value:Yr(e),min:Yr(r)||void 0,max:Yr(a)||void 0,onChange:e=>t?.(function(e){if(!Ur.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:n({invalid:l,size:i,className:o}),...s})});function Xr(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function Zr(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function Jr(e,t,r){const n=await Zr(t,r),a=xe().copy;return n?y.success(a.copiedLabel(e)):y.error(a.failed),n}var Qr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},en={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function tn(){/* @__PURE__ */
139
142
  return et(ue,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function rn(){/* @__PURE__ */
140
- return et(ue,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function nn({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":d,className:u=""}){const[h,p]=Oe(!1),g=Re(null),f=be().copy;_e(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=Te(async()=>{await Jr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):x.error(f.failed)},[e,o,f]),{box:y,button:v}=en[a],w=!i;/* @__PURE__ */
141
- return Qe("div",{id:w?void 0:c,"aria-describedby":w?void 0:d,className:["inline-flex max-w-full items-center rounded-md",Qr[l],y,u].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
143
+ return et(ue,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function nn({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":d,className:u=""}){const[h,p]=Oe(!1),g=Re(null),f=fe().copy;_e(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=Te(async()=>{await Zr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):y.error(f.failed)},[e,o,f]),{box:x,button:v}=en[a],w=!i;/* @__PURE__ */
144
+ return Qe("div",{id:w?void 0:c,"aria-describedby":w?void 0:d,className:["inline-flex max-w-full items-center rounded-md",Qr[l],x,u].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
142
145
  /* @__PURE__ */et("span",{className:"min-w-0 font-mono text-gray-800 "+(s?"whitespace-pre-wrap break-all":"truncate"),title:s?void 0:e,children:t??e}),!i&&/* @__PURE__ */Qe(tt,{children:[
143
146
  /* @__PURE__ */et(m,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":d,onClick:b,className:`${v} text-gray-400`,children:/* @__PURE__ */et(h?rn:tn,{})}),
144
- /* @__PURE__ */et("span",{"aria-live":"polite",className:"sr-only",children:h?f.copied:""})]})]})}var an=2;function ln(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function on(e){return e.slice(0,-1)}var sn=["1","2","3","4","5","6","7","8","9",".","0"];function cn({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=be().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
147
+ /* @__PURE__ */et("span",{"aria-live":"polite",className:"sr-only",children:h?f.copied:""})]})]})}var an=2;function ln(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function on(e){return e.slice(0,-1)}var sn=["1","2","3","4","5","6","7","8","9",".","0"];function cn({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=fe().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
145
148
  return Qe("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[sn.map(t=>/* @__PURE__ */et(T,{size:"touch-xl",variant:"secondary",onClick:()=>o(ln(e,t)),children:t},t)),
146
- /* @__PURE__ */et(T,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(on(e)),children:"⌫"}),r&&/* @__PURE__ */et(T,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var dn={md:"h-24 p-3",lg:"h-32 p-4"},un=Ie(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
149
+ /* @__PURE__ */et(T,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(on(e)),children:"⌫"}),r&&/* @__PURE__ */et(T,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var dn={md:"h-24 p-3",lg:"h-32 p-4"},un=Be(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
147
150
  return Qe("button",{ref:s,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",dn[r],i].filter(Boolean).join(" "),...o,children:[
148
151
  /* @__PURE__ */et("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */et("span",{className:"text-sm text-gray-500",children:t})]})}),hn={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function mn(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function pn({size:e="md",selected:t,disabled:r=!1,block:n=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",hn[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function gn(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function fn({icon:e,label:t}){/* @__PURE__ */
149
152
  return Qe(tt,{children:[e?/* @__PURE__ */et("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function bn({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=We(),h=mn(l,o),m=gn(l);/* @__PURE__ */
150
153
  return et("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */Qe("label",{htmlFor:i,className:pn({size:a,selected:o,disabled:r.disabled,block:l}),children:[
151
154
  /* @__PURE__ */et("input",{id:i,type:"radio",name:n,value:r.value,checked:o,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
152
- /* @__PURE__ */et(fn,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */et("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */et(O,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */et("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:pn({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */et(fn,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */et(O,{content:r.title,className:m,children:i},r.value):i})})}var xn=/(^|[\s:])!?z-/;function yn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:x,panelClassName:y=""}){const[v,w]=Oe(s),N=(o??v)&&!f,M=se(),C=Re(null),L=Re(null),S=Re(null),A=Re(null),P=We(),j=m??P,z=We(),F=We(),E=We(),B=Re(null),I=Re(!1),T=Re({openProp:o,onOpenChange:c});T.current={openProp:o,onOpenChange:c};const O=Te(e=>{void 0===T.current.openProp&&w(e),T.current.onOpenChange?.(e)},[]),R=Te((e=!1)=>{I.current=e,O(!1)},[O]),W=e=>{B.current=e.nativeEvent},U=Te(()=>{const e=S.current,t=L.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=_(t),a=Math.max(0,n.right-n.left-2*H),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${a}px`,o.maxHeight="none",o.width=d?`${Math.min(r.width,a)}px`:"";const s={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=K({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);ie(()=>{N&&M&&U()}),_e(()=>{if(!N||!M)return;const e=q(()=>L.current,U),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>U());return r.observe(t),()=>{e(),r.disconnect()}},[N,M,U]),_e(()=>{if(!N)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(B.current===e)return!1;const t=e.target;return!(t&&(C.current?.contains(t)||S.current?.contains(t)))})(e)&&R(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=re(()=>R()),a=te(e=>"Escape"===e.key&&(R(),L.current?.focus(),!0),()=>S.current);return()=>{t(),r(),n(),a()}},[N,R]),k(S,N&&M),ie(()=>{if(!N||!M)return;const e=S.current;return()=>{if(I.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||L.current?.focus({preventScroll:!0})}},[N,M]),_e(()=>{if(!N||!M)return;const e=S.current;e&&(I.current=!1,(h?.current??$(e)[0]??e).focus({preventScroll:!0}))},[N,M]);const V="function"==typeof t?t({close:()=>R()}):t,Y=r?{"aria-labelledby":F}:a?{"aria-label":a}:{"aria-labelledby":j};/* @__PURE__ */
155
+ /* @__PURE__ */et(fn,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */et("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */et(O,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */et("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:pn({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */et(fn,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */et(O,{content:r.title,className:m,children:i},r.value):i})})}var yn=/(^|[\s:])!?z-/;function xn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:y,panelClassName:x=""}){const[v,w]=Oe(s),N=(o??v)&&!f,M=se(),C=Re(null),L=Re(null),S=Re(null),A=Re(null),P=We(),j=m??P,z=We(),F=We(),E=We(),I=Re(null),B=Re(!1),T=Re({openProp:o,onOpenChange:c});T.current={openProp:o,onOpenChange:c};const O=Te(e=>{void 0===T.current.openProp&&w(e),T.current.onOpenChange?.(e)},[]),R=Te((e=!1)=>{B.current=e,O(!1)},[O]),W=e=>{I.current=e.nativeEvent},U=Te(()=>{const e=S.current,t=L.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=_(t),a=Math.max(0,n.right-n.left-2*H),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${a}px`,o.maxHeight="none",o.width=d?`${Math.min(r.width,a)}px`:"";const s={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=K({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);ie(()=>{N&&M&&U()}),_e(()=>{if(!N||!M)return;const e=q(()=>L.current,U),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>U());return r.observe(t),()=>{e(),r.disconnect()}},[N,M,U]),_e(()=>{if(!N)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(I.current===e)return!1;const t=e.target;return!(t&&(C.current?.contains(t)||S.current?.contains(t)))})(e)&&R(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=re(()=>R()),a=te(e=>"Escape"===e.key&&(R(),L.current?.focus(),!0),()=>S.current);return()=>{t(),r(),n(),a()}},[N,R]),k(S,N&&M),ie(()=>{if(!N||!M)return;const e=S.current;return()=>{if(B.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||L.current?.focus({preventScroll:!0})}},[N,M]),_e(()=>{if(!N||!M)return;const e=S.current;e&&(B.current=!1,(h?.current??$(e)[0]??e).focus({preventScroll:!0}))},[N,M]);const V="function"==typeof t?t({close:()=>R()}):t,Y=r?{"aria-labelledby":F}:a?{"aria-label":a}:{"aria-labelledby":j};/* @__PURE__ */
153
156
  return Qe("div",{ref:C,className:`relative inline-flex ${b}`.trim(),children:[
154
- /* @__PURE__ */et("button",{ref:L,id:j,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&M?z:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>N?R():O(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=S.current;return e?$(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:x??le({variant:"secondary"}),children:e}),N&&M&&rt(
155
- /* @__PURE__ */et("div",{ref:S,id:z,role:"dialog",...Y,"aria-describedby":n?E:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:W,onFocusCapture:W,onKeyDown:e=>{const t=S.current,r=L.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=$(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=D(r,t);R(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${y}`.trim(),style:xn.test(y)?void 0:{zIndex:ne.popup},children:/* @__PURE__ */Qe("div",{ref:A,children:[r&&/* @__PURE__ */et("h2",{id:F,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */et("p",{id:E,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */et("div",{className:"mt-3",children:V}):V]})}),document.body)]})}var vn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function wn({value:e,onChange:t,options:r,label:n,emptyValue:a,columns:l=5,disabled:i=!1,className:o=""}){const s=be(),c=s.iconPicker,d=s.iconNames,u=e=>e.label??d[e.value]??e.value,h=Re([]),p=Math.max(0,r.findIndex(t=>t.value===e)),g=r[p],f=g?.value===a,b=Re(null);/* @__PURE__ */
156
- return et(yn,{className:o,disabled:i,triggerLabel:g?c.button(n,u(g)):n,"aria-label":n,initialFocus:b,panelClassName:"!p-2",trigger:/* @__PURE__ */Qe("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */et("span",f||!g?{className:"text-sm",children:g?u(g):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:g.icon}),
157
+ /* @__PURE__ */et("button",{ref:L,id:j,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&M?z:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>N?R():O(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=S.current;return e?$(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:y??le({variant:"secondary"}),children:e}),N&&M&&rt(
158
+ /* @__PURE__ */et("div",{ref:S,id:z,role:"dialog",...Y,"aria-describedby":n?E:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:W,onFocusCapture:W,onKeyDown:e=>{const t=S.current,r=L.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=$(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=D(r,t);R(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${x}`.trim(),style:yn.test(x)?void 0:{zIndex:ne.popup},children:/* @__PURE__ */Qe("div",{ref:A,children:[r&&/* @__PURE__ */et("h2",{id:F,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */et("p",{id:E,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */et("div",{className:"mt-3",children:V}):V]})}),document.body)]})}var vn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function wn({value:e,onChange:t,options:r,label:n,emptyValue:a,columns:l=5,disabled:i=!1,className:o=""}){const s=fe(),c=s.iconPicker,d=s.iconNames,u=e=>e.label??d[e.value]??e.value,h=Re([]),p=Math.max(0,r.findIndex(t=>t.value===e)),g=r[p],f=g?.value===a,b=Re(null);/* @__PURE__ */
159
+ return et(xn,{className:o,disabled:i,triggerLabel:g?c.button(n,u(g)):n,"aria-label":n,initialFocus:b,panelClassName:"!p-2",trigger:/* @__PURE__ */Qe("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */et("span",f||!g?{className:"text-sm",children:g?u(g):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:g.icon}),
157
160
  /* @__PURE__ */et(ue,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:a})=>/* @__PURE__ */et("div",{role:"listbox","aria-label":n,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${l}, 2rem)`},children:r.map((n,i)=>{const o=n.value===e;/* @__PURE__ */
158
- return et(O,{content:u(n),children:/* @__PURE__ */et(m,{ref:e=>{h.current[i]=e,i===p&&(b.current=e)},role:"option","aria-selected":o,"aria-label":u(n),pressed:o,tabIndex:i===p?0:-1,onKeyDown:e=>((e,t)=>{const n=vn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of h.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");h.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}var Nn={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},kn={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},$n={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},Mn=Ie(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=We(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */et("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",Nn[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */et("span",{className:["inline-block rounded-full bg-white shadow transition-transform",kn[n],e?$n[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Qe("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
159
- /* @__PURE__ */Qe("span",{className:"min-w-0",children:[a&&/* @__PURE__ */et("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */et("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */et("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */et("span",{className:o,children:y})});function Cn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Ln=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Dn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Re(a);l.current=a;const i=Re({}),o=Te(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);_e(()=>o,[o]),_e(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */et(ue,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */et("button",{type:"button",...c,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:s}):/* @__PURE__ */et(m,{size:"sm",...c,children:s})}var Sn=Ie(function({value:e,onChange:t,min:r,max:a,precision:l,step:i,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:x,onFocus:y,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":D,"aria-labelledby":S,"aria-describedby":A,...P},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),B=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),I=be(),[T,O]=Oe(()=>Ln(e,l)),R=Re(T);R.current=T;const W=Re(null),K=Te(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),_=Re(e),q=Re(e);q.current=e;const H=Boolean(s||c),U="compact"===v;_e(()=>{E(R.current)!==e&&O(Ln(e,l))},[e,l]);const V=e=>{if(H)return;let n=(E(R.current)??w??(u?E(u):null)??0)+e;null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a);const o=l??String(i??1).split(".")[1]?.length??0;n=Number(n.toFixed(o));const s=Ln(n,l);R.current=s,O(s),t(n),Q()},Y=Re(V);Y.current=V;const[G,X]=Oe(!1),[J,Z]=Oe(0),Q=()=>{z&&Z(e=>e+1)};_e(()=>{z&&G&&document.activeElement===W.current&&W.current?.select()},[z,G,J]);const ee=Re(!1);_e(()=>{if(G&&!H)return te(e=>{if("Escape"!==e.key||document.activeElement!==W.current)return!1;const r=_.current;if(E(R.current)===r)return!1;const n=Ln(r,l);return R.current=n,O(n),q.current!==r&&(L??t)(r),Q(),!0})},[G,H,l,t,L]);const re=()=>{const e=E(R.current);if(null==e){if(!k){const e=Ln(q.current,l);return R.current=e,O(e),q.current}return R.current="",O(""),null!==q.current&&t(null),null}let n=e;const o=l??(N?Math.max(Cn(i??1),Cn(r??0)):void 0);N&&(n=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(n,i??1,r??0)),null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a),null!=o&&(n=Number(n.toFixed(o)));const s=Ln(n,l);return R.current=s,O(s),n===e&&n===q.current||t(n),n},ne=/* @__PURE__ */et("input",{ref:K,id:g,name:f,type:"text",inputMode:0===l?"numeric":"decimal",value:!G&&M?M(e):T,disabled:s,readOnly:c,placeholder:u,step:i,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?u||void 0:`${Ln(e,l)}${z&&F?F:""}`,"aria-describedby":A,"data-appearance":z?"bare":void 0,...B,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":d||void 0,"aria-label":D,"aria-labelledby":S,onChange:e=>(e=>{if(c)return;const r=F&&e.trimEnd().endsWith(F)?e.trimEnd().slice(0,-F.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(O(e),!C)return;const n=E(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!H)return _.current=re(),void Q();const t=i??1,r=o??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||H||(e.preventDefault(),V(n))},onFocus:()=>{_.current=q.current,X(!0),ee.current=!0,y?.()},onMouseUp:z?e=>{ee.current&&(ee.current=!1,e.preventDefault())}:void 0,onBlur:()=>{X(!1),ee.current=!1,re(),x?.()},className:z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G?"bg-white":"bg-transparent",H?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):n({invalid:d,size:h,readOnly:c,className:[m?"pl-8":"",U?p?"pr-12":"pr-6":v?p?"pr-24":"pr-16":p?"pr-10":"","text-right tabular-nums",b].filter(Boolean).join(" ")})});if(z||!m&&!p&&!v)return ne;const ae=E(T);/* @__PURE__ */
160
- return Qe("div",{className:"relative",children:[m&&/* @__PURE__ */et("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),ne,p&&/* @__PURE__ */et("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */et(Dn,{dir:-1,compact:U,label:I.number.decrease,disabled:H||null!=r&&null!=ae&&ae<=r,onStep:e=>Y.current(-(e?o??10*(i??1):i??1))}),t=/* @__PURE__ */et(Dn,{dir:1,compact:U,label:I.number.increase,disabled:H||null!=a&&null!=ae&&ae>=a,onStep:e=>Y.current(e?o??10*(i??1):i??1)});/* @__PURE__ */
161
- return Qe("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),An=(e,t,r)=>Math.min(r,Math.max(t,e));var Pn=8,jn=40;var zn="undefined"==typeof window?_e:Ze;function Fn(e,t,r,n){return Number(An(e,t,r).toFixed(n))}var En=qe(null);function Bn({children:e}){const[t,r]=Oe({}),n=Ke(()=>(e,t)=>r(r=>{if(null===t){if(!(e in r))return r;const t={...r};return delete t[e],t}return r[e]===t?r:{...r,[e]:t}}),[]),a=Ke(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
162
- return et(En.Provider,{value:a,children:e})}function In({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:x,size:y="md",className:v=""}){const w=be(),N=We(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,S=An(e??h??r,r,n),A=Re(null),[P,j]=Oe(null),z=Boolean(c);zn(()=>{const e=()=>{const e=A.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,r)=>e+(parseFloat(t[r])||0),0);r<=0||j(e=>e&&e.frame===r&&e.fontSize===t.fontSize?e:{frame:r,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z,d]);const F=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,E=null==e?u??(null!=h?F(h)??String(h):void 0):F(e),B=`calc(${I=[r.toFixed($),n.toFixed($),e?.toFixed($),u,h?.toFixed($)],Math.max(1,...I.map(e=>(e??"").length))}ch + ${(P?.frame??10+(z?jn:Pn))+2}px)`;var I;const T=Ye(En),O=We(),R=T?.set;return zn(()=>{R&&R(O,d?B:null)},[R,O,B,d]),_e(()=>()=>R?.(O,null),[R,O]),/* @__PURE__ */Qe("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
163
- /* @__PURE__ */et("input",{id:k,type:"range",min:r,max:n,step:a,value:S,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":E,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(Fn((e??D??S)+o*(s?l??a:a),r,n,$))},onChange:e=>t(Fn(Number(e.target.value),r,n,$)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&
164
- /* @__PURE__ */et("div",{ref:A,className:"shrink-0 text-xs",style:{width:T?.width??B,...P?{fontSize:P.fontSize}:{}},children:/* @__PURE__ */et(Sn,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:D,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}function Tn({items:e,onChange:r,label:n,className:a="","aria-labelledby":l,"aria-describedby":i}){const o=be().displayChips,s=We();/* @__PURE__ */
161
+ return et(O,{content:u(n),children:/* @__PURE__ */et(m,{ref:e=>{h.current[i]=e,i===p&&(b.current=e)},role:"option","aria-selected":o,"aria-label":u(n),pressed:o,tabIndex:i===p?0:-1,onKeyDown:e=>((e,t)=>{const n=vn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of h.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");h.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}function Nn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var kn=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function $n({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Re(a);l.current=a;const i=Re({}),o=Te(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);_e(()=>o,[o]),_e(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */et(ue,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */et("button",{type:"button",...c,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:s}):/* @__PURE__ */et(m,{size:"sm",...c,children:s})}var Mn=Be(function({value:e,onChange:t,min:r,max:a,precision:l,step:i,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:y,onFocus:x,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":D,"aria-labelledby":S,"aria-describedby":A,...P},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),I=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),B=fe(),[T,O]=Oe(()=>kn(e,l)),R=Re(T);R.current=T;const W=Re(null),K=Te(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),_=Re(e),q=Re(e);q.current=e;const H=Boolean(s||c),U="compact"===v;_e(()=>{E(R.current)!==e&&O(kn(e,l))},[e,l]);const V=e=>{if(H)return;let n=(E(R.current)??w??(u?E(u):null)??0)+e;null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a);const o=l??String(i??1).split(".")[1]?.length??0;n=Number(n.toFixed(o));const s=kn(n,l);R.current=s,O(s),t(n),Q()},Y=Re(V);Y.current=V;const[G,X]=Oe(!1),[Z,J]=Oe(0),Q=()=>{z&&J(e=>e+1)};_e(()=>{z&&G&&document.activeElement===W.current&&W.current?.select()},[z,G,Z]);const ee=Re(!1);_e(()=>{if(G&&!H)return te(e=>{if("Escape"!==e.key||document.activeElement!==W.current)return!1;const r=_.current;if(E(R.current)===r)return!1;const n=kn(r,l);return R.current=n,O(n),q.current!==r&&(L??t)(r),Q(),!0})},[G,H,l,t,L]);const re=()=>{const e=E(R.current);if(null==e){if(!k){const e=kn(q.current,l);return R.current=e,O(e),q.current}return R.current="",O(""),null!==q.current&&t(null),null}let n=e;const o=l??(N?Math.max(Nn(i??1),Nn(r??0)):void 0);N&&(n=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(n,i??1,r??0)),null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a),null!=o&&(n=Number(n.toFixed(o)));const s=kn(n,l);return R.current=s,O(s),n===e&&n===q.current||t(n),n},ne=/* @__PURE__ */et("input",{ref:K,id:g,name:f,type:"text",inputMode:0===l?"numeric":"decimal",value:!G&&M?M(e):T,disabled:s,readOnly:c,placeholder:u,step:i,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?u||void 0:`${kn(e,l)}${z&&F?F:""}`,"aria-describedby":A,"data-appearance":z?"bare":void 0,...I,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":d||void 0,"aria-label":D,"aria-labelledby":S,onChange:e=>(e=>{if(c)return;const r=F&&e.trimEnd().endsWith(F)?e.trimEnd().slice(0,-F.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(O(e),!C)return;const n=E(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!H)return _.current=re(),void Q();const t=i??1,r=o??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||H||(e.preventDefault(),V(n))},onFocus:()=>{_.current=q.current,X(!0),ee.current=!0,x?.()},onMouseUp:z?e=>{ee.current&&(ee.current=!1,e.preventDefault())}:void 0,onBlur:()=>{X(!1),ee.current=!1,re(),y?.()},className:z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G?"bg-white":"bg-transparent",H?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):n({invalid:d,size:h,readOnly:c,className:[m?"pl-6":"",U?p?"pr-10":"pr-6":v?p?"pr-24":"pr-16":p?"pr-10":"","text-left tabular-nums",b].filter(Boolean).join(" ")})});if(z||!m&&!p&&!v)return ne;const ae=E(T);/* @__PURE__ */
162
+ return Qe("div",{className:"relative",children:[m&&/* @__PURE__ */et("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),ne,p&&/* @__PURE__ */et("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */et($n,{dir:-1,compact:U,label:B.number.decrease,disabled:H||null!=r&&null!=ae&&ae<=r,onStep:e=>Y.current(-(e?o??10*(i??1):i??1))}),t=/* @__PURE__ */et($n,{dir:1,compact:U,label:B.number.increase,disabled:H||null!=a&&null!=ae&&ae>=a,onStep:e=>Y.current(e?o??10*(i??1):i??1)});/* @__PURE__ */
163
+ return Qe("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),Cn="h-3.5 w-3.5",Ln={top:/* @__PURE__ */et(ue,{name:"padding-top","aria-hidden":"true",className:Cn}),right:/* @__PURE__ */et(ue,{name:"padding-right","aria-hidden":"true",className:Cn}),bottom:/* @__PURE__ */et(ue,{name:"padding-bottom","aria-hidden":"true",className:Cn}),left:/* @__PURE__ */et(ue,{name:"padding-left","aria-hidden":"true",className:Cn}),vertical:/* @__PURE__ */et(ue,{name:"padding-y","aria-hidden":"true",className:Cn}),horizontal:/* @__PURE__ */et(ue,{name:"padding-left-right","aria-hidden":"true",className:Cn}),each:/* @__PURE__ */et(ue,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"})};var Dn=(e,t,r)=>null===e[r]?t[r]:String(e[r]);function Sn(e,t){const r=r=>Dn(e,t,r);return r("left")!==r("right")||r("top")!==r("bottom")}function An({label:e,value:t,onChange:r,each:n,placeholder:a,words:l,min:i=0,max:o=200,step:s=4,readOnly:c}){const d=(e,n,d)=>{const u=function(e,t){const r=t.map(t=>e[t]);return r.every(e=>e===r[0])?r[0]:"mixed"}(t,e),h=e.map(e=>Dn(t,a,e)),m="mixed"!==u&&h.every(e=>e===h[0])?h[0]:"–";/* @__PURE__ */
164
+ return et("div",{"data-side":e.join("-"),className:"min-w-0",children:/* @__PURE__ */et(Mn,{value:"mixed"===u?null:u,onChange:n=>((e,n)=>{const a={...t};for(const t of e)a[t]=n;r(a)})(e,n),min:i,max:o,step:s,snap:!0,precision:0,steppers:"compact",readOnly:c,placeholder:m,prefix:d,suffix:l.unit,"aria-label":n})})};/* @__PURE__ */
165
+ return et("div",{role:"group","aria-label":e,"data-sides":n?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */Qe(tt,n?{children:[d(["left"],l.sides.left,Ln.left),d(["top"],l.sides.top,Ln.top),d(["right"],l.sides.right,Ln.right),d(["bottom"],l.sides.bottom,Ln.bottom)]}:{children:[d(["left","right"],l.horizontal,Ln.horizontal),d(["top","bottom"],l.vertical,Ln.vertical)]})})}function Pn({each:e,onChange:t,label:r,disabled:n}){/* @__PURE__ */
166
+ return et(O,{content:r,children:/* @__PURE__ */et(m,{size:"sm","aria-label":r,"aria-pressed":e,disabled:n,onClick:()=>t(!e),children:Ln.each})})}var jn=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function zn(e){const t=e.trim().replace(/^#/,"");if(!jn.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Fn=e=>e.toUpperCase(),En=(e,t,r)=>Math.min(r,Math.max(t,e));function In(e){const t=zn(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let o=0;return 0!==i&&(o=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(o+360)%360,s:0===l?0:i/l,v:l}}function Bn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=En(t,0,1),l=En(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Tn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Bn({h:e%360,s:1,v:1})).join(", ")})`,On={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Rn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Wn(e){return e?{background:e}:Rn}function Kn({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",On[e],r].filter(Boolean).join(" ")}var _n=Be(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
167
+ return et("button",{ref:i,type:a,"aria-pressed":r,className:Kn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute inset-0",style:Wn(e)})})}),qn=(e,t,r)=>Math.min(r,Math.max(t,e)),Hn=e=>"string"==typeof e?{value:e}:e;var Un={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Vn({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=fe().color,h=zn(l??""),[m,p]=Oe(()=>In(e||h||"")),g=Re(e);_e(()=>{e!==g.current&&(g.current=e,e?p(In(e)):h&&p(In(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=zn(e);t&&(p(In(t)),f(t))},y=e=>{p(e),f(Bn(e))},[x,v]=Oe(!1),w=Re(m);w.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,w.current);"end"===i?(v(!0),p(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&x&&(v(!1),y(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?En((r-a.left)/a.width,0,1):0,v:a.height>0?1-En((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*En((r-n.left)/n.width,0,1)):0)};var r,n}),M=x?Bn(m):e,C=e=>`${Math.round(100*e)}%`,L=(n??[]).map(Hn),D=zn(e);/* @__PURE__ */
168
+ return Qe("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(L.length>0||a)&&/* @__PURE__ */Qe("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */et(O,{content:u.clear,children:/* @__PURE__ */et(_n,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),L.map(e=>{const t=zn(e.value),r=e.label?`${e.label} · ${Fn(t??e.value)}`:Fn(t??e.value);/* @__PURE__ */
169
+ return et(O,{content:r,children:/* @__PURE__ */et(_n,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===D,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
170
+ /* @__PURE__ */et("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:qn(e.s+a[0],0,1),v:qn(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...k,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Bn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:C(m.s),top:C(1-m.v),...Un}})}),
171
+ /* @__PURE__ */et("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return qn(e-n,0,359);case"ArrowRight":case"ArrowUp":return qn(e+n,0,359);case"PageDown":return qn(e-10,0,359);case"PageUp":return qn(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...m,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Tn},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:m.h/360*100+"%",background:Bn({h:m.h,s:1,v:1}),...Un}})}),
172
+ /* @__PURE__ */Qe("div",{className:"flex items-center gap-2",children:[
173
+ /* @__PURE__ */et("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Wn(M||(h??""))}),
174
+ /* @__PURE__ */et(Gn,{value:M,placeholder:!e&&h?Fn(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}var Yn={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"};function Gn({value:e,onChange:t,label:r,placeholder:a,disabled:l,id:i,size:o="md",className:s=""}){const[c,d]=Oe(null);/* @__PURE__ */
175
+ return et("input",{id:i,type:"text",value:c??(e?Fn(e):""),"aria-label":r,placeholder:a,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:l,onChange:r=>{d(r.target.value);const n=zn(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(null))},onBlur:()=>d(null),className:n({size:o,className:`${Yn[o]} flex-1 font-mono uppercase ${s}`.trim()}).replace(/(^| )w-full( |$)/," ")})}function Xn({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=fe().color,f=We(),b=zn(l??""),y=e||b||"",x=e?Fn(e):b?Fn(b):g.none;/* @__PURE__ */
176
+ return Qe("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
177
+ /* @__PURE__ */et(xn,{id:s,trigger:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute inset-0",style:Wn(y)}),triggerLabel:g.swatch(r,x),triggerClassName:Kn({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */et(Vn,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
178
+ /* @__PURE__ */et("div",{className:"w-24 flex-none",children:/* @__PURE__ */et(Gn,{value:e,placeholder:!e&&b?Fn(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o,size:d})})]})}var Zn=["solid","dashed","dotted"],Jn=["top","right","bottom","left"];function Qn(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(Jn.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function ea(e,t){const r=e??{},n=Qn(t),a=Jn.some(e=>"number"==typeof r[e]),l=Jn.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:a?0:n[e]);return!l.every(e=>e===l[0])}var ta="h-3.5 w-3.5",ra={all:/* @__PURE__ */et(ue,{name:"border-all","aria-hidden":"true",className:ta}),top:/* @__PURE__ */et(ue,{name:"border-top","aria-hidden":"true",className:ta}),right:/* @__PURE__ */et(ue,{name:"border-right","aria-hidden":"true",className:ta}),bottom:/* @__PURE__ */et(ue,{name:"border-bottom","aria-hidden":"true",className:ta}),left:/* @__PURE__ */et(ue,{name:"border-left","aria-hidden":"true",className:ta})},na={solid:/* @__PURE__ */et(ue,{name:"line-solid","aria-hidden":"true",className:ta}),dashed:/* @__PURE__ */et(ue,{name:"line-dashed","aria-hidden":"true",className:ta}),dotted:/* @__PURE__ */et(ue,{name:"line-dotted","aria-hidden":"true",className:ta})};function aa({label:e,value:t,onChange:r,each:n,placeholder:a,presets:l,words:i,widths:o=!0,styles:s=!0,min:c=0,max:d=20,step:u=1,readOnly:h}){const m=e=>"number"==typeof t[e]?t[e]:null,p=(e,n)=>{const a={...t};if("number"==typeof t.width)for(const e of Jn)null===m(e)&&(a[e]=t.width);a[e]=n,delete a.width,r(a)},g=(e,t,r,n,a,l)=>/* @__PURE__ */et("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */et(Mn,{value:n,onChange:l,min:c,max:d,step:u,precision:0,steppers:"compact",readOnly:h,placeholder:a,prefix:r,suffix:i.unit,"aria-label":t})}),f=Jn.map(m),b="number"==typeof t.width?t.width:f.every(e=>null!==e&&e===f[0])?f[0]:null,y=null===b&&f.some(e=>null!==e),x=Jn.every(e=>a.sides[e]===a.sides.top)?String(a.sides.top):"–",v=e=>m(e)??("number"==typeof t.width?t.width:null),w=t.style??a.style;/* @__PURE__ */
179
+ return Qe("div",{role:"group","aria-label":e,"data-border":n?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[o?n?/* @__PURE__ */Qe(tt,{children:[g("left",i.sides.left,ra.left,v("left"),String(a.sides.left),e=>p("left",e)),g("top",i.sides.top,ra.top,v("top"),String(a.sides.top),e=>p("top",e)),g("right",i.sides.right,ra.right,v("right"),String(a.sides.right),e=>p("right",e)),g("bottom",i.sides.bottom,ra.bottom,v("bottom"),String(a.sides.bottom),e=>p("bottom",e))]}):g("all",i.width,ra.all,b,y?"–":x,e=>{const n={...t,width:e};for(const e of Jn)delete n[e];r(n)}):null,s&&/* @__PURE__ */et("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */et(bn,{block:!0,size:"sm",label:i.style,value:w,onChange:e=>{h||r({...t,style:e})},options:Zn.map(e=>({value:e,label:/* @__PURE__ */Qe(tt,{children:[na[e],
180
+ /* @__PURE__ */et("span",{className:"sr-only",children:i.styles[e]})]}),title:i.styles[e]}))})}),
181
+ /* @__PURE__ */et("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */et(Xn,{value:t.color??"",onChange:e=>{h||r({...t,color:e})},label:i.color,presets:l,fallback:a.color,showHexInput:!0,size:"sm",disabled:h})})]})}var la={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},ia={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},oa={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},sa=Be(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=We(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,y=[p,g??b].filter(Boolean).join(" ")||void 0,x=/* @__PURE__ */et("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":y,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",la[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */et("span",{className:["inline-block rounded-full bg-white shadow transition-transform",ia[n],e?oa[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Qe("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[x,
182
+ /* @__PURE__ */Qe("span",{className:"min-w-0",children:[a&&/* @__PURE__ */et("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */et("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */et("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */et("span",{className:o,children:x})}),ca=(e,t,r)=>Math.min(r,Math.max(t,e));var da=8,ua=40;var ha="undefined"==typeof window?_e:Je;function ma(e,t,r,n){return Number(ca(e,t,r).toFixed(n))}var pa=qe(null);function ga({children:e}){const[t,r]=Oe({}),n=Ke(()=>(e,t)=>r(r=>{if(null===t){if(!(e in r))return r;const t={...r};return delete t[e],t}return r[e]===t?r:{...r,[e]:t}}),[]),a=Ke(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
183
+ return et(pa.Provider,{value:a,children:e})}function fa({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:y,size:x="md",className:v=""}){const w=fe(),N=We(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,S=ca(e??h??r,r,n),A=Re(null),[P,j]=Oe(null),z=Boolean(c);ha(()=>{const e=()=>{const e=A.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,r)=>e+(parseFloat(t[r])||0),0);r<=0||j(e=>e&&e.frame===r&&e.fontSize===t.fontSize?e:{frame:r,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z,d]);const F=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,E=null==e?u??(null!=h?F(h)??String(h):void 0):F(e),I=`calc(${B=[r.toFixed($),n.toFixed($),e?.toFixed($),u,h?.toFixed($)],Math.max(1,...B.map(e=>(e??"").length))}ch + ${(P?.frame??10+(z?ua:da))+2}px)`;var B;const T=Ye(pa),O=We(),R=T?.set;return ha(()=>{R&&R(O,d?I:null)},[R,O,I,d]),_e(()=>()=>R?.(O,null),[R,O]),/* @__PURE__ */Qe("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
184
+ /* @__PURE__ */et("input",{id:k,type:"range",min:r,max:n,step:a,value:S,disabled:y,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":E,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(ma((e??D??S)+o*(s?l??a:a),r,n,$))},onChange:e=>t(ma(Number(e.target.value),r,n,$)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===x?"h-1":"h-1.5")}),d&&
185
+ /* @__PURE__ */et("div",{ref:A,className:"shrink-0 text-xs",style:{width:T?.width??I,...P?{fontSize:P.fontSize}:{}},children:/* @__PURE__ */et(Mn,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:D,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:y,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}function ba({items:e,onChange:r,label:n,className:a="","aria-labelledby":l,"aria-describedby":i}){const o=fe().displayChips,s=We();/* @__PURE__ */
165
186
  return et("div",{role:"group","aria-label":l?void 0:n,"aria-labelledby":l,"aria-describedby":i,className:`flex flex-wrap gap-2 ${a}`.trim(),children:e.map((e,n)=>{const a=`${s}-${n}-state`,l=`${s}-${n}-reason`,i=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,c=/* @__PURE__ */Qe("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||i)||void 0,"aria-disabled":!!i||void 0,"aria-describedby":V(a,i?l:void 0),onClick:i?U:()=>r(e.id,!e.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(e.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
166
187
  /* @__PURE__ */et(ue,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
167
188
  /* @__PURE__ */et(t,{children:e.label})]}),d=/* @__PURE__ */et("span",{id:a,className:"sr-only",children:e.shown?o.shown:o.hidden});/* @__PURE__ */
168
- return Qe(Ge,{children:[i?/* @__PURE__ */et(Y,{reason:e.disabledReason,id:l,children:c}):/* @__PURE__ */et(O,{content:e.shown?o.shownHint:o.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:c}),d]},e.id)})})}var On=4,Rn=10,Wn={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},Kn={1:[],2:[50],3:[34,33],4:[25,25,25]},_n=e=>"number"==typeof e&&Number.isFinite(e);function qn(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(_n))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,Rn,100-n-(t-1-a)*Rn);r.push(l),n+=l}),r}function Hn(e,t){const r=qn(e,t);if(!r)return(e=>[...Wn[e]??Wn[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function Un(e,t){return Hn(t,e)}var Vn=(e,t,r)=>Math.min(r,Math.max(t,e)),Yn=e=>e.reduce((e,t)=>e+t,0),Gn=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var Xn,Jn="w-0.5",Zn=`${Jn} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var Qn=["text-blue-700","text-gray-600"];function ea({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=be().widths,d=We(),u=Vn(Math.round(e)||1,1,4),h=qn(t,u),m=h??[...Kn[u]??[]],p=[...m,100-Yn(m)],g=l||i,f=Re(null),b=Re({onChange:r,shown:m,locked:g,n:u,stored:h});b.current={onChange:r,shown:m,locked:g,n:u,stored:h};const x=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=qn(e,a);return!(!l||Gn(l,r))&&(t(l),!0)},y=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=Vn(Math.round(r),Rn,n-Rn),a[t+1]=n-a[t],x(a.slice(0,-1))&&(I.current=null)},v=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?10:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+10:"PageDown"===t.key?p[e]-10:"Home"===t.key?Rn:"End"===t.key?n-Rn:null;null!==a&&(t.preventDefault(),y(p,e,a))},w=Re(null),[N,k]=Oe(null),$=()=>{w.current=null,k(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};_e(()=>$,[]);const M=e=>t=>{if(0!==t.button||g)return;t.preventDefault();const r=f.current?.getBoundingClientRect().width??0;r<=0||(w.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},k(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},C=e=>{const t=w.current;if(!t)return;if(0===e.buttons)return void $();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}y(t.from,t.i,t.from[t.i]+r/t.width*100)},L=e=>{const t=w.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),$())},D=(e,t)=>{const{shown:r}=b.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=Vn(Math.round(r),Rn,100-(n-1)*Rn);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-Rn);a[e]-=t,i-=t}return a}([...r,100-Yn(r)],e,t);return x(n.slice(0,-1))?n:null},[S,A]=Oe(0);_e(()=>{const e=f.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>A(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const P=Re(null),[j,z]=Oe(null),[F,E]=Oe([]),B=(e,t)=>z(r=>t?e:r===e?null:r),I=Re(null),R=(e,t)=>{const r=I.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:a,stored:l}=b.current;var i,o;return a||(i=l,o=r.stored,void 0===i||void 0===o?i===o:Gn(i,o))||n(r.stored),!0},W=p.join(",");_e(()=>{const e=null===j?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===Xn&&(Xn=document.createElement("canvas").getContext("2d")),!Xn)return[];const a=Xn;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(P.current,j);E(t=>Gn(t,e)?t:e)},[j,W,S]);const K=p.slice(0,-1).map((e,t)=>Yn(p.slice(0,t+1)));/* @__PURE__ */
189
+ return Qe(Ge,{children:[i?/* @__PURE__ */et(Y,{reason:e.disabledReason,id:l,children:c}):/* @__PURE__ */et(O,{content:e.shown?o.shownHint:o.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:c}),d]},e.id)})})}var ya=4,xa=10,va={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},wa={1:[],2:[50],3:[34,33],4:[25,25,25]},Na=e=>"number"==typeof e&&Number.isFinite(e);function ka(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(Na))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,xa,100-n-(t-1-a)*xa);r.push(l),n+=l}),r}function $a(e,t){const r=ka(e,t);if(!r)return(e=>[...va[e]??va[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function Ma(e,t){return $a(t,e)}var Ca=(e,t,r)=>Math.min(r,Math.max(t,e)),La=e=>e.reduce((e,t)=>e+t,0),Da=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var Sa,Aa="w-0.5",Pa=`${Aa} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var ja=["text-blue-700","text-gray-600"];function za({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=fe().widths,d=We(),u=Ca(Math.round(e)||1,1,4),h=ka(t,u),m=h??[...wa[u]??[]],p=[...m,100-La(m)],g=l||i,f=Re(null),b=Re({onChange:r,shown:m,locked:g,n:u,stored:h});b.current={onChange:r,shown:m,locked:g,n:u,stored:h};const y=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=ka(e,a);return!(!l||Da(l,r))&&(t(l),!0)},x=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=Ca(Math.round(r),xa,n-xa),a[t+1]=n-a[t],y(a.slice(0,-1))&&(B.current=null)},v=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?10:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+10:"PageDown"===t.key?p[e]-10:"Home"===t.key?xa:"End"===t.key?n-xa:null;null!==a&&(t.preventDefault(),x(p,e,a))},w=Re(null),[N,k]=Oe(null),$=()=>{w.current=null,k(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};_e(()=>$,[]);const M=e=>t=>{if(0!==t.button||g)return;t.preventDefault();const r=f.current?.getBoundingClientRect().width??0;r<=0||(w.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},k(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},C=e=>{const t=w.current;if(!t)return;if(0===e.buttons)return void $();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}x(t.from,t.i,t.from[t.i]+r/t.width*100)},L=e=>{const t=w.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),$())},D=(e,t)=>{const{shown:r}=b.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=Ca(Math.round(r),xa,100-(n-1)*xa);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-xa);a[e]-=t,i-=t}return a}([...r,100-La(r)],e,t);return y(n.slice(0,-1))?n:null},[S,A]=Oe(0);_e(()=>{const e=f.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>A(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const P=Re(null),[j,z]=Oe(null),[F,E]=Oe([]),I=(e,t)=>z(r=>t?e:r===e?null:r),B=Re(null),R=(e,t)=>{const r=B.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:a,stored:l}=b.current;var i,o;return a||(i=l,o=r.stored,void 0===i||void 0===o?i===o:Da(i,o))||n(r.stored),!0},W=p.join(",");_e(()=>{const e=null===j?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===Sa&&(Sa=document.createElement("canvas").getContext("2d")),!Sa)return[];const a=Sa;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(P.current,j);E(t=>Da(t,e)?t:e)},[j,W,S]);const K=p.slice(0,-1).map((e,t)=>La(p.slice(0,t+1)));/* @__PURE__ */
169
190
  return Qe("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-describedby":u>1?d:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${i?"opacity-60":""} ${s}`.trim(),children:[
170
191
  /* @__PURE__ */Qe("div",{ref:P,"data-widths-bar":"",className:"relative h-8",children:[
171
- /* @__PURE__ */et("div",{ref:f,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */et("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${Qn[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */et("span",{"data-widths-label":"",children:`${e}%`})},t))}),
172
- /* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Qe(Ge,{children:[(()=>{const r=j===t,n=Yn(p.slice(0,t)),a=r?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
173
- return et("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */et(Sn,{appearance:"bare",value:e,display:()=>(e=>S>0&&S*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:Rn,max:100-(u-1)*Rn,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:l,disabled:i,"aria-label":c.column(t+1),"aria-describedby":d,"data-widths-label":"",onChange:e=>{null===e||R(t,e)||D(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||R(e,t)||D(e,t)})(t,e),onFocus:()=>{I.current={column:t,share:e,stored:b.current.stored},B(t,!0)},onBlur:()=>B(t,!1),className:`absolute inset-0 text-xs font-medium ${Qn[t%2]} ${F.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */et("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${K[t]}%`},children:/* @__PURE__ */et(O,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */et("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":Rn,"aria-valuemax":p[t]+p[t+1]-Rn,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":g||void 0,onKeyDown:g?void 0:v(t),onPointerDown:M(t),onPointerMove:C,onPointerUp:L,onPointerCancel:L,onLostPointerCapture:()=>{w.current&&$()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(g?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */et("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(g?`${Jn} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${N===t?"w-1":Zn}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */et("span",{id:d,className:"sr-only",children:c.hint(u,Rn)}),u>1&&o&&/* @__PURE__ */et("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
174
- /* @__PURE__ */et("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,Rn)}),
175
- /* @__PURE__ */et(T,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var ta=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function ra(e){const t=e.trim().replace(/^#/,"");if(!ta.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var na=e=>e.toUpperCase(),aa=(e,t,r)=>Math.min(r,Math.max(t,e));function la(e){const t=ra(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let o=0;return 0!==i&&(o=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(o+360)%360,s:0===l?0:i/l,v:l}}function ia({h:e,s:t,v:r}){const n=(e%360+360)%360,a=aa(t,0,1),l=aa(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var oa=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>ia({h:e%360,s:1,v:1})).join(", ")})`,sa={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},ca={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function da(e){return e?{background:e}:ca}function ua({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",sa[e],r].filter(Boolean).join(" ")}var ha=Ie(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
176
- return et("button",{ref:i,type:a,"aria-pressed":r,className:ua({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute inset-0",style:da(e)})})}),ma=(e,t,r)=>Math.min(r,Math.max(t,e)),pa=e=>"string"==typeof e?{value:e}:e;var ga={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function fa({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=be().color,h=ra(l??""),[m,p]=Oe(()=>la(e||h||"")),g=Re(e);_e(()=>{e!==g.current&&(g.current=e,e?p(la(e)):h&&p(la(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=ra(e);t&&(p(la(t)),f(t))},x=e=>{p(e),f(ia(e))},[y,v]=Oe(!1),w=Re(m);w.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,w.current);"end"===i?(v(!0),p(r)):x(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):x(r)},onPointerUp:t=>{"end"===i&&y&&(v(!1),x(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?aa((r-a.left)/a.width,0,1):0,v:a.height>0?1-aa((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*aa((r-n.left)/n.width,0,1)):0)};var r,n}),M=y?ia(m):e,C=e=>`${Math.round(100*e)}%`,L=(n??[]).map(pa),D=ra(e);/* @__PURE__ */
177
- return Qe("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(L.length>0||a)&&/* @__PURE__ */Qe("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */et(O,{content:u.clear,children:/* @__PURE__ */et(ha,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),L.map(e=>{const t=ra(e.value),r=e.label?`${e.label} · ${na(t??e.value)}`:na(t??e.value);/* @__PURE__ */
178
- return et(O,{content:r,children:/* @__PURE__ */et(ha,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===D,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
179
- /* @__PURE__ */et("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:ma(e.s+a[0],0,1),v:ma(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),x(t))},...k,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:ia({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:C(m.s),top:C(1-m.v),...ga}})}),
180
- /* @__PURE__ */et("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return ma(e-n,0,359);case"ArrowRight":case"ArrowUp":return ma(e+n,0,359);case"PageDown":return ma(e-10,0,359);case"PageUp":return ma(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),x({...m,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:oa},children:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:m.h/360*100+"%",background:ia({h:m.h,s:1,v:1}),...ga}})}),
181
- /* @__PURE__ */Qe("div",{className:"flex items-center gap-2",children:[
182
- /* @__PURE__ */et("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:da(M||(h??""))}),
183
- /* @__PURE__ */et(xa,{value:M,placeholder:!e&&h?na(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}var ba={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"};function xa({value:e,onChange:t,label:r,placeholder:a,disabled:l,id:i,size:o="md",className:s=""}){const[c,d]=Oe(null);/* @__PURE__ */
184
- return et("input",{id:i,type:"text",value:c??(e?na(e):""),"aria-label":r,placeholder:a,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:l,onChange:r=>{d(r.target.value);const n=ra(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(null))},onBlur:()=>d(null),className:n({size:o,className:`${ba[o]} flex-1 font-mono uppercase ${s}`.trim()}).replace(/(^| )w-full( |$)/," ")})}function ya({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=be().color,f=We(),b=ra(l??""),x=e||b||"",y=e?na(e):b?na(b):g.none;/* @__PURE__ */
185
- return Qe("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
186
- /* @__PURE__ */et(yn,{id:s,trigger:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute inset-0",style:da(x)}),triggerLabel:g.swatch(r,y),triggerClassName:ua({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */et(fa,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
187
- /* @__PURE__ */et("div",{className:"w-24 flex-none",children:/* @__PURE__ */et(xa,{value:e,placeholder:!e&&b?na(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o,size:d})})]})}var va={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},wa={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function Na({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=be().imageFocus,u=We(),h=Re(null),m=Re(!1),{x:p,y:g}=$e(e),f=Me(p,g),b=r=>{r!==e&&t(r)},x=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=Le(r,e,t);b(Me(n.x,n.y))},y=()=>{m.current=!1};if(!n)/* @__PURE__ */
192
+ /* @__PURE__ */et("div",{ref:f,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */et("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${ja[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */et("span",{"data-widths-label":"",children:`${e}%`})},t))}),
193
+ /* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Qe(Ge,{children:[(()=>{const r=j===t,n=La(p.slice(0,t)),a=r?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
194
+ return et("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */et(Mn,{appearance:"bare",value:e,display:()=>(e=>S>0&&S*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:xa,max:100-(u-1)*xa,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:l,disabled:i,"aria-label":c.column(t+1),"aria-describedby":d,"data-widths-label":"",onChange:e=>{null===e||R(t,e)||D(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||R(e,t)||D(e,t)})(t,e),onFocus:()=>{B.current={column:t,share:e,stored:b.current.stored},I(t,!0)},onBlur:()=>I(t,!1),className:`absolute inset-0 text-xs font-medium ${ja[t%2]} ${F.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */et("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${K[t]}%`},children:/* @__PURE__ */et(O,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */et("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":xa,"aria-valuemax":p[t]+p[t+1]-xa,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":g||void 0,onKeyDown:g?void 0:v(t),onPointerDown:M(t),onPointerMove:C,onPointerUp:L,onPointerCancel:L,onLostPointerCapture:()=>{w.current&&$()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(g?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */et("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(g?`${Aa} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${N===t?"w-1":Pa}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */et("span",{id:d,className:"sr-only",children:c.hint(u,xa)}),u>1&&o&&/* @__PURE__ */et("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
195
+ /* @__PURE__ */et("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,xa)}),
196
+ /* @__PURE__ */et(T,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var Fa={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},Ea={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function Ia({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=fe().imageFocus,u=We(),h=Re(null),m=Re(!1),{x:p,y:g}=$e(e),f=Me(p,g),b=r=>{r!==e&&t(r)},y=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=Le(r,e,t);b(Me(n.x,n.y))},x=()=>{m.current=!1};if(!n)/* @__PURE__ */
188
197
  return et("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */et("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===a,w=null!==a;/* @__PURE__ */
189
198
  return Qe("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
190
- /* @__PURE__ */et("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=Ce(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,x(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!o&&x(e.clientX,e.clientY)},onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */Qe("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
199
+ /* @__PURE__ */et("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=Ce(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,y(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!o&&y(e.clientX,e.clientY)},onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */Qe("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
191
200
  /* @__PURE__ */et("img",{src:n,alt:"",draggable:!1,className:"block h-auto max-h-36 w-auto max-w-full select-none object-contain"}),
192
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...va}}),
193
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...va}}),
194
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...wa}})]})}),w||i?/* @__PURE__ */Qe("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */et("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */et("span",{id:u,className:"sr-only",children:d.hint})]})}function ka({onClear:e,ariaLabel:t}){/* @__PURE__ */
195
- return et("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function $a(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:d=!1,freeTextOption:u,onSearchChange:h,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:x=!0,"aria-label":y,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,k=e.multiple?e.value:e.value?[e.value]:[],$=e.multiple?"":e.value,M=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},C=k.length>0,L=o&&C&&!l,D=N||o,S=null!=u,A=d||S,[P,j]=Oe(!1),[z,F]=Oe(-1),E=We(),B=i??`${E}-input`,I=`${E}-listbox`,K=e=>`${E}-opt-${e}`,[_,q]=Oe(""),H=be(),U=n??H.select.none,V=e=>{q(e),F(-1),h?.(e)},Y=Re(null),G=Re(null),X=Re(null),J=Re(null),ee=Re(P);ee.current=P;const ae=Re(!1),le=e=>{ee.current&&(ee.current=!1,e&&d&&!S&&Se&&(N?k.includes(Se)||M([...k,Se]):Se!==$&&M([Se])),j(!1),V(""))},oe=(e,t)=>{if(!e.disabled){if(N)return M(k.includes(e.value)?k.filter(t=>t!==e.value):[...k,e.value]),void(e===Ae?V(""):F(t));M([e.value]),le(!1)}},[se,ce]=Oe(null);ie(()=>{if(!f||P)return void ce(null);const e=J.current?.offsetWidth??0;ce(e?e+(ge?32:8)+6:null)});const de=R(G,P,D?{popupRef:X}:{matchTriggerWidth:!0}),ue=Ke(()=>ft(t),[t]),he=k.join("\0"),me=Ke(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of ue)k.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(A)for(const r of k)t.has(r)||e.push(r);return e},[ue,he,A]),pe=me.join(", "),ge=x&&C&&!l,[fe,xe]=Oe(null),ye=Re(null),ve=Re(""),we=Re(()=>{});we.current=()=>{const e=G.current,t=ye.current;if(!N||!e||!t)return;const r=getComputedStyle(e),n=e.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),a=[r.fontStyle,r.fontWeight,r.fontSize,r.fontFamily,r.letterSpacing].join("|"),l=`${n}|${a}|${me.join("\0")}`;if(l===ve.current)return;ve.current=l;let i=null;n>0&&me.length>0&&(t.style.fontStyle=r.fontStyle,t.style.fontWeight=r.fontWeight,t.style.fontSize=r.fontSize,t.style.fontFamily=r.fontFamily,t.style.letterSpacing=r.letterSpacing,i=function(e,t){const r=e.length;if(0===r||t(e.join(", ")))return{shown:r,cut:!1};if(1===r)return{shown:1,cut:!0};let n=0;for(let a=1;a<r&&t(`${e.slice(0,a).join(", ")} +${r-a}`);a+=1)n=a;return{shown:n,cut:!1}}(me,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),xe(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},ie(()=>{we.current()}),_e(()=>{const e=G.current;if(!N||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>we.current());return t.observe(e),()=>t.disconnect()},[N]);const Ne=me.length,ke=!N||!fe||fe.shown>=Ne?pe:0===fe.shown?H.select.selectedCount(Ne):`${me.slice(0,fe.shown).join(", ")} +${Ne-fe.shown}`,$e=N&&null!==fe&&(fe.shown<Ne||fe.cut),Me=P&&C&&D;_e(()=>{if(!P)return;const e=e=>{const t=e.target;Y.current?.contains(t)||X.current?.contains(t)||le(!0)};document.addEventListener("mousedown",e);const t=re(()=>le(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[P,d,_,he,e.onChange]),_e(()=>{if(P)return te(e=>!("Escape"!==e.key||!ee.current)&&(le(!1),G.current?.blur(),!0),()=>X.current)},[P]);const Ce=Ke(()=>{const e=/* @__PURE__ */new Set;return bt(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),Le=Ke(()=>{if(h)return Ce;const e=_.trim().toLowerCase();return e?bt(Ce,t=>vt(t,e)):Ce},[Ce,_,h]),De=Ke(()=>ft(Le),[Le]),Se=_.trim(),Ae=Ke(()=>S&&Se?ue.some(e=>e.label===Se)||k.includes(Se)?null:{value:Se,label:Se}:null,[S,Se,ue,he]),Pe=Ke(()=>Ae?[...De,Ae]:De,[De,Ae]);/* @__PURE__ */
196
- return Qe("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||X.current?.contains(t))||ae.current||document.activeElement!==G.current&&le(!0)},children:[(je=/* @__PURE__ */et("input",{id:B,ref:G,type:"text",autoComplete:"off",role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":P?I:void 0,"aria-activedescendant":P&&z>=0&&z<Pe.length?K(z):void 0,"aria-label":v?void 0:y,"aria-labelledby":v,"aria-describedby":w,value:P?_:ke,onChange:e=>{V(e.target.value),j(!0)},onFocus:()=>{l||(V(""),j(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!P)return void j(!0);if(0===Pe.length)return;const t="ArrowDown"===e.key?1:-1;return void F(e=>mt(Pe,e,t))}"Enter"===e.key?(e.preventDefault(),P&&z>=0&&z<Pe.length?oe(Pe[z],z):1!==De.length||De[0].disabled?d&&!S&&Se&&(N?(k.includes(Se)||M([...k,Se]),V("")):(M([Se]),le(!1),G.current?.blur())):oe(De[0],0)):"Escape"===e.key?(le(!1),G.current?.blur()):"Tab"===e.key&&le(!0)},placeholder:Me?ke:r||U,className:`${L?s:c} ${a} ${ge?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Me?" rosh-field-shows-choice":""}`,style:se?{paddingRight:se}:void 0,disabled:l}),N?/* @__PURE__ */et(O,{content:!P&&$e?pe:null,className:"block",children:je}):je),N&&
197
- /* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */et("span",{ref:ye,className:"whitespace-pre"})}),ge&&/* @__PURE__ */et(ka,{ariaLabel:H.select.clear,onClear:()=>{M([]),le(!1)}}),f&&!P&&/* @__PURE__ */et("div",{ref:J,className:`absolute top-1/2 -translate-y-1/2 ${ge?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:f}),P&&rt(
198
- /* @__PURE__ */Qe("div",{ref:X,onMouseDownCapture:()=>{ae.current=!0,setTimeout(()=>{ae.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ne.popup,left:de?.left,right:de?.right,top:de?.top,bottom:de?.bottom,minWidth:de?.minWidth,width:de?.width,...D&&{maxWidth:de?.maxWidth},visibility:de?void 0:"hidden",...Z()},children:[N&&C&&x&&!l&&
201
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...Fa}}),
202
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Fa}}),
203
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...Ea}})]})}),w||i?/* @__PURE__ */Qe("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */et("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */et("span",{id:u,className:"sr-only",children:d.hint})]})}function Ba({onClear:e,ariaLabel:t}){/* @__PURE__ */
204
+ return et("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Ta(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:d=!1,freeTextOption:u,onSearchChange:h,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:y=!0,"aria-label":x,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,k=e.multiple?e.value:e.value?[e.value]:[],$=e.multiple?"":e.value,M=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},C=k.length>0,L=o&&C&&!l,D=N||o,S=null!=u,A=d||S,[P,j]=Oe(!1),[z,F]=Oe(-1),E=We(),I=i??`${E}-input`,B=`${E}-listbox`,K=e=>`${E}-opt-${e}`,[_,q]=Oe(""),H=fe(),U=n??H.select.none,V=e=>{q(e),F(-1),h?.(e)},Y=Re(null),G=Re(null),X=Re(null),Z=Re(null),ee=Re(P);ee.current=P;const ae=Re(!1),le=e=>{ee.current&&(ee.current=!1,e&&d&&!S&&Se&&(N?k.includes(Se)||M([...k,Se]):Se!==$&&M([Se])),j(!1),V(""))},oe=(e,t)=>{if(!e.disabled){if(N)return M(k.includes(e.value)?k.filter(t=>t!==e.value):[...k,e.value]),void(e===Ae?V(""):F(t));M([e.value]),le(!1)}},[se,ce]=Oe(null);ie(()=>{if(!f||P)return void ce(null);const e=Z.current?.offsetWidth??0;ce(e?e+(ge?32:8)+6:null)});const de=R(G,P,D?{popupRef:X}:{matchTriggerWidth:!0}),ue=Ke(()=>ft(t),[t]),he=k.join("\0"),me=Ke(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of ue)k.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(A)for(const r of k)t.has(r)||e.push(r);return e},[ue,he,A]),pe=me.join(", "),ge=y&&C&&!l,[be,ye]=Oe(null),xe=Re(null),ve=Re(""),we=Re(()=>{});we.current=()=>{const e=G.current,t=xe.current;if(!N||!e||!t)return;const r=getComputedStyle(e),n=e.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),a=[r.fontStyle,r.fontWeight,r.fontSize,r.fontFamily,r.letterSpacing].join("|"),l=`${n}|${a}|${me.join("\0")}`;if(l===ve.current)return;ve.current=l;let i=null;n>0&&me.length>0&&(t.style.fontStyle=r.fontStyle,t.style.fontWeight=r.fontWeight,t.style.fontSize=r.fontSize,t.style.fontFamily=r.fontFamily,t.style.letterSpacing=r.letterSpacing,i=function(e,t){const r=e.length;if(0===r||t(e.join(", ")))return{shown:r,cut:!1};if(1===r)return{shown:1,cut:!0};let n=0;for(let a=1;a<r&&t(`${e.slice(0,a).join(", ")} +${r-a}`);a+=1)n=a;return{shown:n,cut:!1}}(me,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),ye(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},ie(()=>{we.current()}),_e(()=>{const e=G.current;if(!N||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>we.current());return t.observe(e),()=>t.disconnect()},[N]);const Ne=me.length,ke=!N||!be||be.shown>=Ne?pe:0===be.shown?H.select.selectedCount(Ne):`${me.slice(0,be.shown).join(", ")} +${Ne-be.shown}`,$e=N&&null!==be&&(be.shown<Ne||be.cut),Me=P&&C&&D;_e(()=>{if(!P)return;const e=e=>{const t=e.target;Y.current?.contains(t)||X.current?.contains(t)||le(!0)};document.addEventListener("mousedown",e);const t=re(()=>le(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[P,d,_,he,e.onChange]),_e(()=>{if(P)return te(e=>!("Escape"!==e.key||!ee.current)&&(le(!1),G.current?.blur(),!0),()=>X.current)},[P]);const Ce=Ke(()=>{const e=/* @__PURE__ */new Set;return bt(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),Le=Ke(()=>{if(h)return Ce;const e=_.trim().toLowerCase();return e?bt(Ce,t=>vt(t,e)):Ce},[Ce,_,h]),De=Ke(()=>ft(Le),[Le]),Se=_.trim(),Ae=Ke(()=>S&&Se?ue.some(e=>e.label===Se)||k.includes(Se)?null:{value:Se,label:Se}:null,[S,Se,ue,he]),Pe=Ke(()=>Ae?[...De,Ae]:De,[De,Ae]);/* @__PURE__ */
205
+ return Qe("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||X.current?.contains(t))||ae.current||document.activeElement!==G.current&&le(!0)},children:[(je=/* @__PURE__ */et("input",{id:I,ref:G,type:"text",autoComplete:"off",role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":P?B:void 0,"aria-activedescendant":P&&z>=0&&z<Pe.length?K(z):void 0,"aria-label":v?void 0:x,"aria-labelledby":v,"aria-describedby":w,value:P?_:ke,onChange:e=>{V(e.target.value),j(!0)},onFocus:()=>{l||(V(""),j(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!P)return void j(!0);if(0===Pe.length)return;const t="ArrowDown"===e.key?1:-1;return void F(e=>mt(Pe,e,t))}"Enter"===e.key?(e.preventDefault(),P&&z>=0&&z<Pe.length?oe(Pe[z],z):1!==De.length||De[0].disabled?d&&!S&&Se&&(N?(k.includes(Se)||M([...k,Se]),V("")):(M([Se]),le(!1),G.current?.blur())):oe(De[0],0)):"Escape"===e.key?(le(!1),G.current?.blur()):"Tab"===e.key&&le(!0)},placeholder:Me?ke:r||U,className:`${L?s:c} ${a} ${ge?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Me?" rosh-field-shows-choice":""}`,style:se?{paddingRight:se}:void 0,disabled:l}),N?/* @__PURE__ */et(O,{content:!P&&$e?pe:null,className:"block",children:je}):je),N&&
206
+ /* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */et("span",{ref:xe,className:"whitespace-pre"})}),ge&&/* @__PURE__ */et(Ba,{ariaLabel:H.select.clear,onClear:()=>{M([]),le(!1)}}),f&&!P&&/* @__PURE__ */et("div",{ref:Z,className:`absolute top-1/2 -translate-y-1/2 ${ge?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:f}),P&&rt(
207
+ /* @__PURE__ */Qe("div",{ref:X,onMouseDownCapture:()=>{ae.current=!0,setTimeout(()=>{ae.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ne.popup,left:de?.left,right:de?.right,top:de?.top,bottom:de?.bottom,minWidth:de?.minWidth,width:de?.width,...D&&{maxWidth:de?.maxWidth},visibility:de?void 0:"hidden",...J()},children:[N&&C&&y&&!l&&
199
208
  /* @__PURE__ */et("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),M([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${Q}`,children:H.select.clearAll}),m?
200
- /* @__PURE__ */et(Be,{size:"sm",padding:"py-2",label:H.search.searching}):p?/* @__PURE__ */Qe("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
209
+ /* @__PURE__ */et(Ie,{size:"sm",padding:"py-2",label:H.search.searching}):p?/* @__PURE__ */Qe("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
201
210
  /* @__PURE__ */et("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */et(T,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:g,className:"shrink-0",children:H.list.retry})]}):null,
202
- /* @__PURE__ */Qe("div",{id:I,role:Pe.length?"listbox":void 0,"aria-labelledby":Pe.length?v??(y?void 0:B):void 0,"aria-label":Pe.length&&!v?y:void 0,"aria-multiselectable":!(!Pe.length||!N)||void 0,className:"overflow-y-auto",style:{maxHeight:de?.maxHeight??W},children:[0===Pe.length?m||p?null:/* @__PURE__ */et("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:H.select.noMatches}):0===De.length?null:xt(Le,(e,t)=>{const r=k.includes(e.value);/* @__PURE__ */
203
- return Qe("button",{id:K(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),oe(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===z?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[N&&/* @__PURE__ */et(yt,{selected:r}),
211
+ /* @__PURE__ */Qe("div",{id:B,role:Pe.length?"listbox":void 0,"aria-labelledby":Pe.length?v??(x?void 0:I):void 0,"aria-label":Pe.length&&!v?x:void 0,"aria-multiselectable":!(!Pe.length||!N)||void 0,className:"overflow-y-auto",style:{maxHeight:de?.maxHeight??W},children:[0===Pe.length?m||p?null:/* @__PURE__ */et("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:H.select.noMatches}):0===De.length?null:yt(Le,(e,t)=>{const r=k.includes(e.value);/* @__PURE__ */
212
+ return Qe("button",{id:K(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),oe(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===z?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[N&&/* @__PURE__ */et(xt,{selected:r}),
204
213
  /* @__PURE__ */et("span",{className:`min-w-0 ${D?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===z}):e.label}),e.sublabel&&/* @__PURE__ */et(wt,{grows:D,children:e.sublabel})]},e.value)},E),Ae&&u&&
205
- /* @__PURE__ */et("button",{id:K(De.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),oe(Ae,De.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${De.length?`border-t ${Q}`:""} ${z===De.length?"bg-gray-100":""}`,children:/* @__PURE__ */et("span",{className:"min-w-0 flex-1 truncate",children:u(Ae.value)})},`${E}-typed`)]})]}),document.body)]});var je}function Ma(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Ca="address",La={kindOf:()=>Ca,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Da=e=>b(e.trim());function Sa(e){const{value:t,kinds:r,rules:n=La,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=be().link,u=n.isSafe??Da,h=We(),m=Re(null),p=Re(null),[g,f]=Oe({url:t}),b=c?g.url:t,[x,y]=Oe(!1),[v,w]=Oe(null),[N,k]=Oe(null),$=Re(()=>{});$.current=c?e.onCancel:()=>{},_e(()=>{if(c)return te(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),_e(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:Ca,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),L=M.filter(e=>!e.hideWhenEmpty||Ma(e.target).length>0||e.value===C),D=L.find(e=>"text"===e.target.type),S=L.find(e=>e.value===C)??D??L[0];if(!S)return null;const A="text"!==S.target.type,P=A?n.targetOf(b):b,j=Ma(S.target),z=j.find(e=>e.value===P),F=e=>({value:e,label:d.unavailable(e)}),E="select"===S.target.type&&P&&a?a(P):null,B=E?n.readFilter(b):null,I=B?E?.find(e=>e.param===B.param):void 0,O=N&&N.against===b?N.text:b,R=!A&&""!==O.trim()&&!u(O),W=R&&(!c||x),K=(t,r)=>{c?f({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},_=(e,t)=>{w(t=>t?{...t,against:e}:t),K(e,t)},q=e=>{if(!e)return _("");const t=j.find(t=>t.value===e);_(e,t?.label)},H=A?b:O.trim(),U=()=>{if(!c||!H)return;if(!A&&R)return void y(!0);const t=A&&g.url===H?g.name:void 0,r=e.onApply;void 0===t?r(H):r(H,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[F(t),...e]:[...e],Y=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
206
- return et($a,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
207
- return et(Mt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===S.target.type)G=/* @__PURE__ */et(ct,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:W,"aria-label":d.address,"aria-describedby":W?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:O,readOnly:i,onChange:e=>(e=>{y(!1);const t=e.trim();t?u(e)?(k({text:e,against:t}),_(t)):k({text:e,against:b}):(k({text:e,against:""}),_(""))})(e.target.value)});else{const e="groups"===S.target.type?S.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):S.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:S.target.placeholder},...V(e,P)];G=Y(S.label,P,t,q,e.length>10)}const X=/* @__PURE__ */Qe(tt,{children:[r&&Y(d.linkType,S.value,L.map(e=>({value:e.value,label:e.label})),e=>{k(null),y(!1);const t=L.find(t=>t.value===e);if(!t||"text"===t.target.type)return void w({kind:e,against:b});const r=Ma(t.target)[0];w({kind:e,against:r?r.value:""}),r?K(r.value,r.label):K("")},!1),G,E&&Y(d.filter,B?.param??"",[{value:"",label:d.noFilter},...B&&!I?[F(B.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return _(P,z?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&_(n.withFilter(P,{param:e,value:r.value}),r.label)},!1),E&&B&&Y(d.value,B.value,V((I?.values??[]).map(e=>({value:e.value,label:e.label})),B.value),e=>{if(!B)return;const t=I?.values.find(t=>t.value===e);_(n.withFilter(P,{param:B.param,value:e}),t?.label)},(I?.values.length??0)>10),W&&/* @__PURE__ */et("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),S.hint&&/* @__PURE__ */et("p",{className:"text-2xs leading-4 text-gray-400",children:S.hint}),E&&/* @__PURE__ */et("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
208
- return et("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const J=e.onRemove;/* @__PURE__ */
214
+ /* @__PURE__ */et("button",{id:K(De.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),oe(Ae,De.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${De.length?`border-t ${Q}`:""} ${z===De.length?"bg-gray-100":""}`,children:/* @__PURE__ */et("span",{className:"min-w-0 flex-1 truncate",children:u(Ae.value)})},`${E}-typed`)]})]}),document.body)]});var je}function Oa(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Ra="address",Wa={kindOf:()=>Ra,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Ka=e=>b(e.trim());function _a(e){const{value:t,kinds:r,rules:n=Wa,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=fe().link,u=n.isSafe??Ka,h=We(),m=Re(null),p=Re(null),[g,f]=Oe({url:t}),b=c?g.url:t,[y,x]=Oe(!1),[v,w]=Oe(null),[N,k]=Oe(null),$=Re(()=>{});$.current=c?e.onCancel:()=>{},_e(()=>{if(c)return te(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),_e(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:Ra,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),L=M.filter(e=>!e.hideWhenEmpty||Oa(e.target).length>0||e.value===C),D=L.find(e=>"text"===e.target.type),S=L.find(e=>e.value===C)??D??L[0];if(!S)return null;const A="text"!==S.target.type,P=A?n.targetOf(b):b,j=Oa(S.target),z=j.find(e=>e.value===P),F=e=>({value:e,label:d.unavailable(e)}),E="select"===S.target.type&&P&&a?a(P):null,I=E?n.readFilter(b):null,B=I?E?.find(e=>e.param===I.param):void 0,O=N&&N.against===b?N.text:b,R=!A&&""!==O.trim()&&!u(O),W=R&&(!c||y),K=(t,r)=>{c?f({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},_=(e,t)=>{w(t=>t?{...t,against:e}:t),K(e,t)},q=e=>{if(!e)return _("");const t=j.find(t=>t.value===e);_(e,t?.label)},H=A?b:O.trim(),U=()=>{if(!c||!H)return;if(!A&&R)return void x(!0);const t=A&&g.url===H?g.name:void 0,r=e.onApply;void 0===t?r(H):r(H,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[F(t),...e]:[...e],Y=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
215
+ return et(Ta,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
216
+ return et(Mt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===S.target.type)G=/* @__PURE__ */et(ct,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:W,"aria-label":d.address,"aria-describedby":W?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:O,readOnly:i,onChange:e=>(e=>{x(!1);const t=e.trim();t?u(e)?(k({text:e,against:t}),_(t)):k({text:e,against:b}):(k({text:e,against:""}),_(""))})(e.target.value)});else{const e="groups"===S.target.type?S.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):S.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:S.target.placeholder},...V(e,P)];G=Y(S.label,P,t,q,e.length>10)}const X=/* @__PURE__ */Qe(tt,{children:[r&&Y(d.linkType,S.value,L.map(e=>({value:e.value,label:e.label})),e=>{k(null),x(!1);const t=L.find(t=>t.value===e);if(!t||"text"===t.target.type)return void w({kind:e,against:b});const r=Oa(t.target)[0];w({kind:e,against:r?r.value:""}),r?K(r.value,r.label):K("")},!1),G,E&&Y(d.filter,I?.param??"",[{value:"",label:d.noFilter},...I&&!B?[F(I.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return _(P,z?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&_(n.withFilter(P,{param:e,value:r.value}),r.label)},!1),E&&I&&Y(d.value,I.value,V((B?.values??[]).map(e=>({value:e.value,label:e.label})),I.value),e=>{if(!I)return;const t=B?.values.find(t=>t.value===e);_(n.withFilter(P,{param:I.param,value:e}),t?.label)},(B?.values.length??0)>10),W&&/* @__PURE__ */et("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),S.hint&&/* @__PURE__ */et("p",{className:"text-2xs leading-4 text-gray-400",children:S.hint}),E&&/* @__PURE__ */et("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
217
+ return et("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const Z=e.onRemove;/* @__PURE__ */
209
218
  return Qe("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),U())},children:[A?/* @__PURE__ */et("span",{className:Et({inline:!0}),children:d.title}):/* @__PURE__ */et("label",{htmlFor:`${h}-address`,className:Et({inline:!0}),children:d.title}),X,
210
- /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2",children:[J?/* @__PURE__ */et(T,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:J,children:d.remove}):null,
219
+ /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2",children:[Z?/* @__PURE__ */et(T,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:Z,children:d.remove}):null,
211
220
  /* @__PURE__ */Qe("span",{className:"ml-auto flex gap-1",children:[
212
221
  /* @__PURE__ */et(T,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>$.current(),children:d.cancel}),
213
- /* @__PURE__ */et(T,{variant:"primary",size:"sm","data-window-action":"apply",onClick:U,disabled:i||""===H,children:d.apply})]})]})]})}function Aa({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:u=""}){const h=be().link,[m,p]=Oe(!1),g=Re(null),f=We(),b=()=>{p(!1),g.current?.focus()};/* @__PURE__ */
222
+ /* @__PURE__ */et(T,{variant:"primary",size:"sm","data-window-action":"apply",onClick:U,disabled:i||""===H,children:d.apply})]})]})]})}function qa({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:u=""}){const h=fe().link,[m,p]=Oe(!1),g=Re(null),f=We(),b=()=>{p(!1),g.current?.focus()};/* @__PURE__ */
214
223
  return Qe("div",{className:`flex min-w-0 flex-auto flex-col ${u}`.trim(),children:[
215
224
  /* @__PURE__ */et(ct,{size:"sm",type:"text",className:"rounded-b-none","aria-label":h.text(e),placeholder:s,value:t,readOnly:c,onChange:e=>r(e.target.value)}),
216
225
  /* @__PURE__ */Qe("button",{ref:g,type:"button","aria-label":h.linkOf(e,n),"aria-expanded":m,"aria-controls":m?f:void 0,disabled:c,onClick:()=>p(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${d.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
217
226
  /* @__PURE__ */et(ue,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(n?"text-blue-600":"text-gray-400")}),
218
- /* @__PURE__ */et("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||h.addLink})]}),m&&/* @__PURE__ */et("div",{id:f,className:"mt-2",children:/* @__PURE__ */et(Sa,{value:n,label:h.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),b()},onRemove:n?()=>{a(""),b()}:void 0,onCancel:b})})]})}var Pa=e=>e.preventDefault(),ja=e=>null!=e&&!1!==e,za=["bold","italic","underline","strike","link","sup","sub"],Fa=["left","center","right","justify"];function Ea(e,t,r){const n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===n||0===t.length)return;const a=[...e.currentTarget.querySelectorAll('[role="radio"]')],l=a.findIndex(t=>t===e.target||t.contains(e.target));if(l<0)return;e.preventDefault();const i=a.length,o="first"===n?0:"last"===n?i-1:(l+n+i)%i;a[o].disabled||(r(t[o]),a[o].focus())}function Ba(e,t){const r=["bold","italic","underline","strike"].filter(t=>e.has(t)).length;return{color:r,link:r+(t?1:0)}}function Ia({offered:e,color:t,last:r,alignment:n,list:a,letterCase:l}){const i=za.filter(t=>e.has(t)).length+(t?1:0)+(ja(r)?1:0),o=(n?Fa.filter(e=>n.allow.includes(e)).length:0)+(a&&e.has("bullet")?1:0)+(a&&e.has("number")?1:0)+(l?3:0);return{words:i>0,paragraph:o>0,oneRow:i>0&&o>0&&i+1+o<=9,flow:i>0&&o>0&&i+1+o>9&&i<=7}}function Ta(e,t){/* @__PURE__ */
219
- return et(O,{content:e,children:t},t.key??void 0)}function Oa({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:c=!1,"aria-label":d,windows:u,className:h=""}){const p=be().textToolbar,g=Ia({offered:e,color:n,last:l,alignment:i,list:o,letterCase:s});if(!g.words&&!g.paragraph)return null;const f=(e,t="")=>`rosh-tb-btn${e?" is-on":""}${t?` ${t}`:""}`,b=(n,l,i,o)=>e.has(n)?Ta(l,/* @__PURE__ */et(m,"link"===n?{pressed:a,className:f(a),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":a,"aria-keyshortcuts":o,disabled:c,onMouseDown:Pa,onClick:()=>r(n),children:i}:{className:f(Boolean(t[n])),"aria-label":l,"aria-pressed":Boolean(t[n]),"aria-keyshortcuts":o,disabled:c,onMouseDown:Pa,onClick:()=>r(n),children:i},n)):null,x=[["left",p.alignLeft,/* @__PURE__ */et(ue,{name:"align-left"})],["center",p.alignCenter,/* @__PURE__ */et(ue,{name:"align-center"})],["right",p.alignRight,/* @__PURE__ */et(ue,{name:"align-right"})],["justify",p.alignJustify,/* @__PURE__ */et(ue,{name:"align-justify"})]],y=i?Fa.filter(e=>i.allow.includes(e)):[],v=i&&y.includes(i.value)?i.value:y[0],w=[["none",p.caseNone,/* @__PURE__ */et(ue,{name:"case-normal"})],["upper",p.caseUpper,/* @__PURE__ */et(ue,{name:"case-upper"})],["lower",p.caseLower,/* @__PURE__ */et(ue,{name:"case-lower"})]],N=/* @__PURE__ */Qe(tt,{children:[b("bold",p.bold,/* @__PURE__ */et(ue,{name:"bold"}),"Meta+B"),b("italic",p.italic,/* @__PURE__ */et(ue,{name:"italic"}),"Meta+I"),b("underline",p.underline,/* @__PURE__ */et(ue,{name:"underline"}),"Meta+U"),b("strike",p.strike,/* @__PURE__ */et(ue,{name:"strike"})),n?Ta(p.color,/* @__PURE__ */et(m,{pressed:n.open,className:f(n.open,"rosh-tb-color"),"aria-label":p.color,"aria-haspopup":"dialog","aria-expanded":n.open,disabled:c,style:n.run?{"--rosh-tb-run":n.run}:void 0,onMouseDown:Pa,onClick:n.onToggle,children:/* @__PURE__ */et(ue,{name:"text-color"})},"color")):null,b("link",p.link,/* @__PURE__ */et(ue,{name:"link"}),"Meta+K"),b("sup",p.sup,/* @__PURE__ */et(ue,{name:"superscript"})),b("sub",p.sub,/* @__PURE__ */et(ue,{name:"subscript"})),ja(l)?l:null]}),k=/* @__PURE__ */Qe(tt,{children:[i&&y.length>0?/* @__PURE__ */et("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.alignment,onKeyDown:e=>Ea(e,y,e=>i.onChange(e)),children:x.map(([e,t,r])=>i.allow.includes(e)?Ta(t,/* @__PURE__ */et(m,{role:"radio",pressed:i.value===e,className:f(i.value===e),"aria-checked":i.value===e,"aria-label":t,tabIndex:e===v?0:-1,disabled:c||i.disabled,onMouseDown:Pa,onClick:()=>i.onChange(e),children:r},e)):null)}):null,o&&e.has("bullet")?Ta(p.bullet,/* @__PURE__ */et(m,{className:f("bullet"===o.pressed),"aria-label":p.bullet,"aria-pressed":"bullet"===o.pressed,disabled:c,onMouseDown:Pa,onClick:()=>o.onList("bullet"),children:/* @__PURE__ */et(ue,{name:"list"})},"bullet")):null,o&&e.has("number")?Ta(p.number,/* @__PURE__ */et(m,{className:f("number"===o.pressed),"aria-label":p.number,"aria-pressed":"number"===o.pressed,disabled:c,onMouseDown:Pa,onClick:()=>o.onList("number"),children:/* @__PURE__ */et(ue,{name:"numbered-list"})},"number")):null,s?/* @__PURE__ */et("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.letterCase,onKeyDown:e=>Ea(e,w.map(([e])=>e),e=>s.onChange(e)),children:w.map(([e,t,r])=>Ta(t,/* @__PURE__ */et(m,{role:"radio",pressed:s.value===e,className:f(s.value===e),"aria-checked":s.value===e,"aria-label":t,tabIndex:e===(s.value||"none")?0:-1,disabled:c||s.disabled,onMouseDown:Pa,onClick:()=>s.onChange(s.value===e?"":e),children:r},e)))}):null]}),$=g.flow?" is-flow":g.oneRow?" is-one-row":g.words&&void 0===l?" is-eight":"",M=Ba(e,Boolean(n)),C={"--rosh-tb-color-col":String(M.color),"--rosh-tb-link-col":String(M.link)};let L;return L=g.flow?/* @__PURE__ */Qe("div",{className:"rosh-tb-row is-flow",children:[N,
227
+ /* @__PURE__ */et("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||h.addLink})]}),m&&/* @__PURE__ */et("div",{id:f,className:"mt-2",children:/* @__PURE__ */et(_a,{value:n,label:h.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),b()},onRemove:n?()=>{a(""),b()}:void 0,onCancel:b})})]})}var Ha=e=>e.preventDefault(),Ua=e=>null!=e&&!1!==e,Va=["bold","italic","underline","strike","link","sup","sub"],Ya=["left","center","right","justify"];function Ga(e,t,r){const n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===n||0===t.length)return;const a=[...e.currentTarget.querySelectorAll('[role="radio"]')],l=a.findIndex(t=>t===e.target||t.contains(e.target));if(l<0)return;e.preventDefault();const i=a.length,o="first"===n?0:"last"===n?i-1:(l+n+i)%i;a[o].disabled||(r(t[o]),a[o].focus())}function Xa(e,t){const r=["bold","italic","underline","strike"].filter(t=>e.has(t)).length;return{color:r,link:r+(t?1:0)}}function Za({offered:e,color:t,last:r,alignment:n,list:a,letterCase:l}){const i=Va.filter(t=>e.has(t)).length+(t?1:0)+(Ua(r)?1:0),o=(n?Ya.filter(e=>n.allow.includes(e)).length:0)+(a&&e.has("bullet")?1:0)+(a&&e.has("number")?1:0)+(l?3:0);return{words:i>0,paragraph:o>0,oneRow:i>0&&o>0&&i+1+o<=9,flow:i>0&&o>0&&i+1+o>9&&i<=7}}function Ja(e,t){/* @__PURE__ */
228
+ return et(O,{content:e,children:t},t.key??void 0)}function Qa({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:c=!1,"aria-label":d,windows:u,className:h=""}){const p=fe().textToolbar,g=Za({offered:e,color:n,last:l,alignment:i,list:o,letterCase:s});if(!g.words&&!g.paragraph)return null;const f=(e,t="")=>`rosh-tb-btn${e?" is-on":""}${t?` ${t}`:""}`,b=(n,l,i,o)=>e.has(n)?Ja(l,/* @__PURE__ */et(m,"link"===n?{pressed:a,className:f(a),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":a,"aria-keyshortcuts":o,disabled:c,onMouseDown:Ha,onClick:()=>r(n),children:i}:{className:f(Boolean(t[n])),"aria-label":l,"aria-pressed":Boolean(t[n]),"aria-keyshortcuts":o,disabled:c,onMouseDown:Ha,onClick:()=>r(n),children:i},n)):null,y=[["left",p.alignLeft,/* @__PURE__ */et(ue,{name:"align-left"})],["center",p.alignCenter,/* @__PURE__ */et(ue,{name:"align-center"})],["right",p.alignRight,/* @__PURE__ */et(ue,{name:"align-right"})],["justify",p.alignJustify,/* @__PURE__ */et(ue,{name:"align-justify"})]],x=i?Ya.filter(e=>i.allow.includes(e)):[],v=i&&x.includes(i.value)?i.value:x[0],w=[["none",p.caseNone,/* @__PURE__ */et(ue,{name:"case-normal"})],["upper",p.caseUpper,/* @__PURE__ */et(ue,{name:"case-upper"})],["lower",p.caseLower,/* @__PURE__ */et(ue,{name:"case-lower"})]],N=/* @__PURE__ */Qe(tt,{children:[b("bold",p.bold,/* @__PURE__ */et(ue,{name:"bold"}),"Meta+B"),b("italic",p.italic,/* @__PURE__ */et(ue,{name:"italic"}),"Meta+I"),b("underline",p.underline,/* @__PURE__ */et(ue,{name:"underline"}),"Meta+U"),b("strike",p.strike,/* @__PURE__ */et(ue,{name:"strike"})),n?Ja(p.color,/* @__PURE__ */et(m,{pressed:n.open,className:f(n.open,"rosh-tb-color"),"aria-label":p.color,"aria-haspopup":"dialog","aria-expanded":n.open,disabled:c,style:n.run?{"--rosh-tb-run":n.run}:void 0,onMouseDown:Ha,onClick:n.onToggle,children:/* @__PURE__ */et(ue,{name:"text-color"})},"color")):null,b("link",p.link,/* @__PURE__ */et(ue,{name:"link"}),"Meta+K"),b("sup",p.sup,/* @__PURE__ */et(ue,{name:"superscript"})),b("sub",p.sub,/* @__PURE__ */et(ue,{name:"subscript"})),Ua(l)?l:null]}),k=/* @__PURE__ */Qe(tt,{children:[i&&x.length>0?/* @__PURE__ */et("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.alignment,onKeyDown:e=>Ga(e,x,e=>i.onChange(e)),children:y.map(([e,t,r])=>i.allow.includes(e)?Ja(t,/* @__PURE__ */et(m,{role:"radio",pressed:i.value===e,className:f(i.value===e),"aria-checked":i.value===e,"aria-label":t,tabIndex:e===v?0:-1,disabled:c||i.disabled,onMouseDown:Ha,onClick:()=>i.onChange(e),children:r},e)):null)}):null,o&&e.has("bullet")?Ja(p.bullet,/* @__PURE__ */et(m,{className:f("bullet"===o.pressed),"aria-label":p.bullet,"aria-pressed":"bullet"===o.pressed,disabled:c,onMouseDown:Ha,onClick:()=>o.onList("bullet"),children:/* @__PURE__ */et(ue,{name:"list"})},"bullet")):null,o&&e.has("number")?Ja(p.number,/* @__PURE__ */et(m,{className:f("number"===o.pressed),"aria-label":p.number,"aria-pressed":"number"===o.pressed,disabled:c,onMouseDown:Ha,onClick:()=>o.onList("number"),children:/* @__PURE__ */et(ue,{name:"numbered-list"})},"number")):null,s?/* @__PURE__ */et("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.letterCase,onKeyDown:e=>Ga(e,w.map(([e])=>e),e=>s.onChange(e)),children:w.map(([e,t,r])=>Ja(t,/* @__PURE__ */et(m,{role:"radio",pressed:s.value===e,className:f(s.value===e),"aria-checked":s.value===e,"aria-label":t,tabIndex:e===(s.value||"none")?0:-1,disabled:c||s.disabled,onMouseDown:Ha,onClick:()=>s.onChange(s.value===e?"":e),children:r},e)))}):null]}),$=g.flow?" is-flow":g.oneRow?" is-one-row":g.words&&void 0===l?" is-eight":"",M=Xa(e,Boolean(n)),C={"--rosh-tb-color-col":String(M.color),"--rosh-tb-link-col":String(M.link)};let L;return L=g.flow?/* @__PURE__ */Qe("div",{className:"rosh-tb-row is-flow",children:[N,
220
229
  /* @__PURE__ */et("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),k]}):g.oneRow?/* @__PURE__ */Qe("div",{className:"rosh-tb-row is-one-row",children:[
221
230
  /* @__PURE__ */et("div",{className:"rosh-tb-words",children:N}),
222
231
  /* @__PURE__ */et("div",{className:"rosh-tb-para",children:k})]}):/* @__PURE__ */Qe(tt,{children:[g.words?/* @__PURE__ */et("div",{className:"rosh-tb-row"+(void 0===l?" is-eight":""),children:N}):null,g.paragraph?/* @__PURE__ */et("div",{className:"rosh-tb-row",children:k}):null]}),/* @__PURE__ */Qe("div",{className:`rosh-tb-wrap${$} ${h}`.trim(),style:C,children:[
223
- /* @__PURE__ */et("div",{className:"rosh-tb",role:"toolbar","aria-label":d??p.formatting,children:L}),u]})}var Ra={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},Wa=["tl","tr","bl","br"];function Ka({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:u=!1,disabledReason:h,id:p,className:g=""}){const f=be(),b=function(e){const t=Wa.map(t=>e.find(e=>e.value===t));for(const r of e){if(Wa.includes(r.value))continue;const e=t.findIndex(e=>void 0===e);-1===e?t.push(r):t[e]=r}return t.filter(e=>void 0!==e)}(r),[x,y]=Oe(0),v=Re(null);/* @__PURE__ */
232
+ /* @__PURE__ */et("div",{className:"rosh-tb",role:"toolbar","aria-label":d??p.formatting,children:L}),u]})}var el={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},tl=["tl","tr","bl","br"];function rl({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:u=!1,disabledReason:h,id:p,className:g=""}){const f=fe(),b=function(e){const t=tl.map(t=>e.find(e=>e.value===t));for(const r of e){if(tl.includes(r.value))continue;const e=t.findIndex(e=>void 0===e);-1===e?t.push(r):t[e]=r}return t.filter(e=>void 0!==e)}(r),[y,x]=Oe(0),v=Re(null);/* @__PURE__ */
224
233
  return Qe("div",{id:p,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${g}`.trim(),children:[l&&
225
- /* @__PURE__ */et("div",{className:"w-30 shrink-0",children:/* @__PURE__ */et(Sn,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */et("span",{"data-radius-mark":"","aria-hidden":"true",children:f.corners.radiusMark}),suffix:f.corners.unit,steppers:"compact",disabled:u,"aria-label":i??f.corners.radius})}),
226
- /* @__PURE__ */et("div",{ref:v,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(v.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:b.map((e,r)=>{const a=t.includes(e.value),l=u||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,o=/* @__PURE__ */et(m,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===x?0:-1,onFocus:()=>y(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */et(ue,{name:"corner",strokeWidth:2,className:["h-4 w-4",Ra[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */et(O,{content:e.title??e.label,children:o},e.value)})})]})}var _a={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function qa({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=We(),c=Re([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
227
- return et("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,d=a||!0===e.disabled,u=d&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,m=`${s}-${i}`,p=/* @__PURE__ */et("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":V(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=_a[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:d?U:()=>n(e.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(o?"bg-blue-50 hover:bg-blue-100":"bg-white hover:bg-gray-50"),children:e.icon?/* @__PURE__ */et("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(o?"text-blue-700":"text-gray-500 group-hover:text-gray-700"),children:e.icon}):/* @__PURE__ */et("span",{"data-dot":"","aria-hidden":"true",className:o?"size-3 rounded-sm bg-blue-600":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},e.value);return u?/* @__PURE__ */et(Y,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */et(O,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var Ha=Ie(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=We(),g=be().files,f=me({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
234
+ /* @__PURE__ */et("div",{className:"w-30 shrink-0",children:/* @__PURE__ */et(Mn,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */et("span",{"data-radius-mark":"","aria-hidden":"true",children:f.corners.radiusMark}),suffix:f.corners.unit,steppers:"compact",disabled:u,"aria-label":i??f.corners.radius})}),
235
+ /* @__PURE__ */et("div",{ref:v,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(v.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:b.map((e,r)=>{const a=t.includes(e.value),l=u||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,o=/* @__PURE__ */et(m,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===y?0:-1,onFocus:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */et(ue,{name:"corner",strokeWidth:2,className:["h-4 w-4",el[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */et(O,{content:e.title??e.label,children:o},e.value)})})]})}var nl={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function al({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=We(),c=Re([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
236
+ return et("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,d=a||!0===e.disabled,u=d&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,m=`${s}-${i}`,p=/* @__PURE__ */et("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":V(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=nl[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:d?U:()=>n(e.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(o?"bg-blue-50 hover:bg-blue-100":"bg-white hover:bg-gray-50"),children:e.icon?/* @__PURE__ */et("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(o?"text-blue-700":"text-gray-500 group-hover:text-gray-700"),children:e.icon}):/* @__PURE__ */et("span",{"data-dot":"","aria-hidden":"true",className:o?"size-3 rounded-sm bg-blue-600":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},e.value);return u?/* @__PURE__ */et(Y,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */et(O,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var ll=Be(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=We(),g=fe().files,f=me({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
228
237
  return Qe(At,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
229
238
  /* @__PURE__ */Qe("button",{ref:m,type:"button",id:p,disabled:o,onClick:f.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...f.zoneProps,className:er(f.dragOver,o,tr(o),"px-4 py-6"),children:[
230
239
  /* @__PURE__ */Qe("span",{children:[
@@ -234,105 +243,105 @@ return Qe(At,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
234
243
  /* @__PURE__ */et("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
235
244
  /* @__PURE__ */et("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:pe(r.size,g)}),
236
245
  /* @__PURE__ */et("button",{type:"button",disabled:o,onClick:()=>{f.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */et(lr,{})})]},`${r.name}-${n}`))}),
237
- /* @__PURE__ */et(ge,{rejections:f.rejections})]})});function Ua({className:e="h-4 w-4"}){/* @__PURE__ */
238
- return et(ue,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Va({className:e="h-4 w-4"}){/* @__PURE__ */
239
- return et(ue,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Ya({intake:e,dropLabel:t,className:r="",children:n}){const a=be().files;/* @__PURE__ */
246
+ /* @__PURE__ */et(ge,{rejections:f.rejections})]})});function il({className:e="h-4 w-4"}){/* @__PURE__ */
247
+ return et(ue,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function ol({className:e="h-4 w-4"}){/* @__PURE__ */
248
+ return et(ue,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function sl({intake:e,dropLabel:t,className:r="",children:n}){const a=fe().files;/* @__PURE__ */
240
249
  return Qe("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
241
- /* @__PURE__ */et("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function Ga({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=be().files,l=Re(/* @__PURE__ */new Map);_e(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),_e(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */et("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
242
- return Qe("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */et("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */et("span",{className:"text-gray-400",children:/* @__PURE__ */et(Va,{})}),
250
+ /* @__PURE__ */et("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */et("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function cl({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=fe().files,l=Re(/* @__PURE__ */new Map);_e(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),_e(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */et("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
251
+ return Qe("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */et("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */et("span",{className:"text-gray-400",children:/* @__PURE__ */et(ol,{})}),
243
252
  /* @__PURE__ */et("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
244
- /* @__PURE__ */et("span",{className:"shrink-0 tabular-nums text-gray-400",children:pe(e.size,a)}),t&&/* @__PURE__ */et("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */et(lr,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Xa({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=be().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */Qe("span",{className:"relative inline-flex",children:[
245
- /* @__PURE__ */et(m,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */et(Ua,{})}),t>0&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */et(T,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */et(Ua,{}),children:o})}function Ja({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=me({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Re([]);return _e(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Qe(Ya,{intake:p,dropLabel:o,className:h,children:[m,
246
- /* @__PURE__ */et(Ga,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
253
+ /* @__PURE__ */et("span",{className:"shrink-0 tabular-nums text-gray-400",children:pe(e.size,a)}),t&&/* @__PURE__ */et("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */et(lr,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function dl({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=fe().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */Qe("span",{className:"relative inline-flex",children:[
254
+ /* @__PURE__ */et(m,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */et(il,{})}),t>0&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */et(T,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */et(il,{}),children:o})}function ul({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=me({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Re([]);return _e(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Qe(sl,{intake:p,dropLabel:o,className:h,children:[m,
255
+ /* @__PURE__ */et(cl,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
247
256
  /* @__PURE__ */Qe("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
248
- /* @__PURE__ */et(Xa,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
249
- /* @__PURE__ */et(ge,{rejections:p.rejections})]})}var Za={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${Tt.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function Qa({value:e,onChange:t,options:r=[],placeholder:a,allowFreeText:l=!1,invalid:i,disabled:o,id:s,className:c="",tone:d,tooltip:u,split:h}){const[m,p]=Oe(!1),[g,f]=Oe(""),b=be(),x=Re(null),y=Re(null),v=Re(null),w=R(x,m),N=e=>r.find(t=>t.value===e)?.label??e,k=Ke(()=>{const t=new Set(e),n=[],a=g.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!vt(e,a)||n.push(e));return n},[r,e,g]),$=n=>{const a=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(l?t:null);o&&!a.includes(o)&&a.push(o)}a.length!==e.length&&t(a)},M=r=>{r&&!e.includes(r)?(t([...e,r]),f("")):f("")},C=r=>t(e.filter(e=>e!==r)),L=()=>{const e=g.trim();if(h&&e)return $(e.split(h)),void f("");l&&e?M(e):f("")},D=Re(()=>{});D.current=()=>{L(),p(!1)},_e(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||v.current?.contains(t)||(L(),p(!1))};document.addEventListener("mousedown",e);const t=re(()=>D.current());return()=>{document.removeEventListener("mousedown",e),t()}});const S=r.length>0;/* @__PURE__ */
250
- return Qe("div",{ref:x,className:"relative",children:[
251
- /* @__PURE__ */Qe("div",{onMouseDown:e=>{o||e.target.closest("button")||(e.preventDefault(),y.current?.focus())},className:n({invalid:i,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${o?"bg-gray-50 cursor-not-allowed":""} ${c}`}),children:[e.map(e=>{const t=d?.(e),r=Za[t??"accent"],n=/* @__PURE__ */Qe("span",{"data-tone":t,className:r.chip,children:[
257
+ /* @__PURE__ */et(dl,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
258
+ /* @__PURE__ */et(ge,{rejections:p.rejections})]})}var hl={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${Tt.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function ml({value:e,onChange:t,options:r=[],placeholder:a,allowFreeText:l=!1,invalid:i,disabled:o,id:s,className:c="",tone:d,tooltip:u,split:h}){const[m,p]=Oe(!1),[g,f]=Oe(""),b=fe(),y=Re(null),x=Re(null),v=Re(null),w=R(y,m),N=e=>r.find(t=>t.value===e)?.label??e,k=Ke(()=>{const t=new Set(e),n=[],a=g.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!vt(e,a)||n.push(e));return n},[r,e,g]),$=n=>{const a=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(l?t:null);o&&!a.includes(o)&&a.push(o)}a.length!==e.length&&t(a)},M=r=>{r&&!e.includes(r)?(t([...e,r]),f("")):f("")},C=r=>t(e.filter(e=>e!==r)),L=()=>{const e=g.trim();if(h&&e)return $(e.split(h)),void f("");l&&e?M(e):f("")},D=Re(()=>{});D.current=()=>{L(),p(!1)},_e(()=>{if(!m)return;const e=e=>{const t=e.target;y.current?.contains(t)||v.current?.contains(t)||(L(),p(!1))};document.addEventListener("mousedown",e);const t=re(()=>D.current());return()=>{document.removeEventListener("mousedown",e),t()}});const S=r.length>0;/* @__PURE__ */
259
+ return Qe("div",{ref:y,className:"relative",children:[
260
+ /* @__PURE__ */Qe("div",{onMouseDown:e=>{o||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:n({invalid:i,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${o?"bg-gray-50 cursor-not-allowed":""} ${c}`}),children:[e.map(e=>{const t=d?.(e),r=hl[t??"accent"],n=/* @__PURE__ */Qe("span",{"data-tone":t,className:r.chip,children:[
252
261
  /* @__PURE__ */et("span",{className:"truncate",children:N(e)}),!o&&/* @__PURE__ */et("button",{type:"button","aria-label":b.select.removeItem?.(N(e))??`${b.select.remove} ${N(e)}`,onClick:()=>C(e),className:r.remove,children:"×"})]},e),a=u?.(e);return null==a?n:/* @__PURE__ */et(O,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
253
- /* @__PURE__ */et("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&S,"aria-invalid":i||void 0,disabled:o,value:g,placeholder:0===e.length?a:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return $(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&S&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&l){t.preventDefault();const e=g.trim(),r=e?k.filter(t=>vt(t,e.toLowerCase())):[];1===r.length?M(r[0].value):L()}else"Backspace"===t.key&&""===g&&e.length>0?C(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),y.current?.blur()):"Tab"===t.key&&(L(),p(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),m&&S&&rt(
254
- /* @__PURE__ */et("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ne.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??G,width:"max-content",visibility:w?void 0:"hidden",...Z()},children:/* @__PURE__ */et("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??W},children:0===k.length?/* @__PURE__ */et("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?b.select.allSelected:b.select.noMatches}):k.map(e=>/* @__PURE__ */et("button",{type:"button",onMouseDown:t=>{t.preventDefault(),M(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */Qe(tt,{children:[
262
+ /* @__PURE__ */et("input",{id:s,ref:x,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&S,"aria-invalid":i||void 0,disabled:o,value:g,placeholder:0===e.length?a:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return $(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&S&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&l){t.preventDefault();const e=g.trim(),r=e?k.filter(t=>vt(t,e.toLowerCase())):[];1===r.length?M(r[0].value):L()}else"Backspace"===t.key&&""===g&&e.length>0?C(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),x.current?.blur()):"Tab"===t.key&&(L(),p(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),m&&S&&rt(
263
+ /* @__PURE__ */et("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ne.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??G,width:"max-content",visibility:w?void 0:"hidden",...J()},children:/* @__PURE__ */et("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??W},children:0===k.length?/* @__PURE__ */et("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?b.select.allSelected:b.select.noMatches}):k.map(e=>/* @__PURE__ */et("button",{type:"button",onMouseDown:t=>{t.preventDefault(),M(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */Qe(tt,{children:[
255
264
  /* @__PURE__ */et("span",{className:"min-w-0 truncate",children:e.label}),
256
- /* @__PURE__ */et(wt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var el={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},tl={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function rl({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=el[l??(a?"md":"none")],p=We(),g=We(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,x=`h${i}`,y=null!=s&&""!==s,v=b||y,w=v?"section":"div",N=`rounded-(--radius-card) border ${tl[h]} bg-white shadow-sm ${c}`.trim(),k=He.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",D=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
257
- return Qe(w,{className:N,style:u,...y?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
258
- /* @__PURE__ */Qe("div",{className:`${$}${L}${m.edge}`,children:[null!=o?/* @__PURE__ */Qe("div",{className:`flex items-center justify-between gap-3 ${C}`,children:[b?/* @__PURE__ */et(x,{id:p,children:t}):/* @__PURE__ */et("span",{children:t}),o]}):b?/* @__PURE__ */et(x,{id:p,className:C,children:t}):/* @__PURE__ */et("div",{className:C,children:t}),
265
+ /* @__PURE__ */et(wt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var pl={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},gl={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function fl({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=pl[l??(a?"md":"none")],p=We(),g=We(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,y=`h${i}`,x=null!=s&&""!==s,v=b||x,w=v?"section":"div",N=`rounded-(--radius-card) border ${gl[h]} bg-white shadow-sm ${c}`.trim(),k=He.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",D=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
266
+ return Qe(w,{className:N,style:u,...x?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
267
+ /* @__PURE__ */Qe("div",{className:`${$}${L}${m.edge}`,children:[null!=o?/* @__PURE__ */Qe("div",{className:`flex items-center justify-between gap-3 ${C}`,children:[b?/* @__PURE__ */et(y,{id:p,children:t}):/* @__PURE__ */et("span",{children:t}),o]}):b?/* @__PURE__ */et(y,{id:p,className:C,children:t}):/* @__PURE__ */et("div",{className:C,children:t}),
259
268
  /* @__PURE__ */et("p",{id:g,className:M?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-gray-500",children:r})]}):null!=t&&(null!=o?
260
- /* @__PURE__ */Qe("div",{className:`${D} flex items-center justify-between gap-3`,children:[b?/* @__PURE__ */et(x,{id:p,children:t}):/* @__PURE__ */et("span",{children:t}),o]}):b?
261
- /* @__PURE__ */et(x,{id:p,className:D,children:t}):/* @__PURE__ */et("div",{className:D,children:t})),k&&/* @__PURE__ */et("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */et("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function nl({label:e,value:t,icon:r,delta:n,className:a=""}){const l=fe(),i="number"==typeof t&&l?we(t,l):t,o="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",s="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
269
+ /* @__PURE__ */Qe("div",{className:`${D} flex items-center justify-between gap-3`,children:[b?/* @__PURE__ */et(y,{id:p,children:t}):/* @__PURE__ */et("span",{children:t}),o]}):b?
270
+ /* @__PURE__ */et(y,{id:p,className:D,children:t}):/* @__PURE__ */et("div",{className:D,children:t})),k&&/* @__PURE__ */et("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */et("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function bl({label:e,value:t,icon:r,delta:n,className:a=""}){const l=be(),i="number"==typeof t&&l?we(t,l):t,o="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",s="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
262
271
  return Qe("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
263
272
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between text-gray-500",children:[
264
273
  /* @__PURE__ */et("span",{className:"text-xs font-medium uppercase tracking-wide",children:e}),r]}),
265
274
  /* @__PURE__ */Qe("div",{className:"mt-2 flex items-baseline gap-2",children:[
266
- /* @__PURE__ */et("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */Qe("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var al={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},ll={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},il={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function ol({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
267
- return et(l,{className:[al[t],ll[r],il[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var sl={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function cl({children:e,level:t=2,as:r,id:n,tone:a="default",className:l=""}){/* @__PURE__ */
268
- return et(r??`h${t}`,{id:n,className:[sl[t],al[a],l].filter(Boolean).join(" "),children:e})}function dl({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
269
- return et("p",{className:[al[t],ll[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var ul={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},hl={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},ml={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function pl({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
270
- return et("div",{className:["flex flex-col",ul[t],r?hl[r]:"",n?ml[n]:"",a].filter(Boolean).join(" "),children:e})}function gl({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
271
- return et("div",{className:["flex",a?"flex-wrap":"",ul[t],hl[r],n?ml[n]:"",l].filter(Boolean).join(" "),children:e})}var fl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},bl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},xl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function yl({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
272
- return et("div",{className:["grid",fl[t],r?bl[r]:"",n?xl[n]:"",ul[a],l].filter(Boolean).join(" "),children:e})}var vl={sm:"my-2",md:"my-4",lg:"my-6"};function wl({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=We();if("vertical"===e)/* @__PURE__ */
275
+ /* @__PURE__ */et("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */Qe("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var yl={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},xl={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},vl={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function wl({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
276
+ return et(l,{className:[yl[t],xl[r],vl[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var Nl={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function kl({children:e,level:t=2,as:r,id:n,tone:a="default",className:l=""}){/* @__PURE__ */
277
+ return et(r??`h${t}`,{id:n,className:[Nl[t],yl[a],l].filter(Boolean).join(" "),children:e})}function $l({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
278
+ return et("p",{className:[yl[t],xl[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var Ml={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},Cl={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Ll={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Dl({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
279
+ return et("div",{className:["flex flex-col",Ml[t],r?Cl[r]:"",n?Ll[n]:"",a].filter(Boolean).join(" "),children:e})}function Sl({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
280
+ return et("div",{className:["flex",a?"flex-wrap":"",Ml[t],Cl[r],n?Ll[n]:"",l].filter(Boolean).join(" "),children:e})}var Al={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Pl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},jl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function zl({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
281
+ return et("div",{className:["grid",Al[t],r?Pl[r]:"",n?jl[n]:"",Ml[a],l].filter(Boolean).join(" "),children:e})}var Fl={sm:"my-2",md:"my-4",lg:"my-6"};function El({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=We();if("vertical"===e)/* @__PURE__ */
273
282
  return et("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${a}`.trim()});if(!t)/* @__PURE__ */
274
- return et("hr",{className:`border-0 border-t border-gray-200 ${vl[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
283
+ return et("hr",{className:`border-0 border-t border-gray-200 ${Fl[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
275
284
  /* @__PURE__ */
276
- return Qe("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${vl[n]} ${a}`.trim(),children:[
285
+ return Qe("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Fl[n]} ${a}`.trim(),children:[
277
286
  /* @__PURE__ */et("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
278
287
  /* @__PURE__ */et("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
279
- /* @__PURE__ */et("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Nl=[2,4,8,12,16,20,24,32,40,48],kl={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},$l={sm:24,md:32,lg:40},Ml={menu:36,windowBar:44,compactBar:32};function Cl(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&Nl.includes(4*t)}var Ll=[9,11,12,14,16,18,20,24,30],Dl={body:400,control:500,heading:600,figure:700},Sl={fast:120,base:160},Al={hairline:1,strong:2,accent:4},Pl=["control","card","panel","popup","window"],jl=["none","raised","panel","popup","dialog"],zl={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Fl=e=>"number"==typeof e?`${e}px`:e;function El({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${zl[e]} ${a}`.trim();if("circle"===e){const e=Fl(r??t)??"2.5rem";/* @__PURE__ */
280
- return et("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Fl(t)??"100%",height:Fl(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
281
- return et("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */et("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Bl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Il={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Tl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Ol={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Rl({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const o="number"==typeof t?{base:t}:t,s=o.base??1,c=Math.max(s,o.sm??0,o.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
288
+ /* @__PURE__ */et("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Il=[2,4,8,12,16,20,24,32,40,48],Bl={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},Tl={sm:24,md:32,lg:40},Ol={menu:36,windowBar:44,compactBar:32};function Rl(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&Il.includes(4*t)}var Wl=[9,11,12,14,16,18,20,24,30],Kl={body:400,control:500,heading:600,figure:700},_l={fast:120,base:160},ql={hairline:1,strong:2,accent:4},Hl=["control","card","panel","popup","window"],Ul=["none","raised","panel","popup","dialog"],Vl={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Yl=e=>"number"==typeof e?`${e}px`:e;function Gl({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Vl[e]} ${a}`.trim();if("circle"===e){const e=Yl(r??t)??"2.5rem";/* @__PURE__ */
289
+ return et("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Yl(t)??"100%",height:Yl(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
290
+ return et("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */et("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Xl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Zl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Jl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Ql={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function ei({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const o="number"==typeof t?{base:t}:t,s=o.base??1,c=Math.max(s,o.sm??0,o.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
282
291
  return Qe("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */et("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
283
- /* @__PURE__ */et("dl",{className:["grid",Bl[s],o.sm?Il[o.sm]:"",o.lg?Tl[o.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */Qe("div",{className:[e.span?Ol[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
292
+ /* @__PURE__ */et("dl",{className:["grid",Xl[s],o.sm?Zl[o.sm]:"",o.lg?Jl[o.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */Qe("div",{className:[e.span?Ql[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
284
293
  /* @__PURE__ */et("dt",{className:`${u} text-gray-500`,children:e.label}),
285
- /* @__PURE__ */et("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}var Wl={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"px-3 py-2",gap:"gap-3",text:"text-xs",bodyTop:"mt-2",bodyPad:"pt-2"}};function Kl({label:e,value:t,description:r,children:n,controlId:a,unknownText:l="—",quiet:i=!1,size:o="default",divider:s=!0,className:c=""}){const d=Wl[o],u=void 0!==t||void 0===n,h=null==t||""===t,m=i?"text-gray-500":"text-gray-800",p=h?"text-gray-400":i?"text-gray-500":"text-gray-900",g=`${d.text} font-medium ${m}`,f=[s?"border-t border-gray-100 first:border-t-0":"",d.pad,c].filter(Boolean).join(" ");/* @__PURE__ */
294
+ /* @__PURE__ */et("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}var ti={default:{pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},compact:{pad:"px-3 py-2",gap:"gap-3",text:"text-xs",bodyTop:"mt-2",bodyPad:"pt-2"}};function ri({label:e,value:t,description:r,children:n,controlId:a,unknownText:l="—",quiet:i=!1,size:o="default",divider:s=!0,className:c=""}){const d=ti[o],u=void 0!==t||void 0===n,h=null==t||""===t,m=i?"text-gray-500":"text-gray-800",p=h?"text-gray-400":i?"text-gray-500":"text-gray-900",g=`${d.text} font-medium ${m}`,f=[s?"border-t border-gray-100 first:border-t-0":"",d.pad,c].filter(Boolean).join(" ");/* @__PURE__ */
286
295
  return Qe("div",{className:f,children:[
287
296
  /* @__PURE__ */Qe("div",{className:`flex items-center justify-between ${d.gap}`,children:[
288
- /* @__PURE__ */Qe("div",{className:"min-w-0 flex-1",children:[a?/* @__PURE__ */et("label",{htmlFor:a,className:g,children:e}):/* @__PURE__ */et("span",{className:g,children:e}),r&&/* @__PURE__ */et("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),u&&/* @__PURE__ */et("div",{className:`shrink-0 ${d.text} ${p}`,children:h?l:t})]}),null!=n&&!1!==n&&/* @__PURE__ */et("div",{className:`${d.bodyTop} border-t border-gray-100 ${d.bodyPad}`,children:n})]})}var _l={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function ql({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=fe(),c=e>t?`${we(t,s)}+`:we(e,s),d=l?"":i,u=o?/* @__PURE__ */et("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${_l[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${_l[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */Qe("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */et("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var Hl={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},Ul={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function Vl({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=fe(),c="number"!=typeof t?t:null!=r?Ne(t,r,s):s?we(t,s):t;/* @__PURE__ */
297
+ /* @__PURE__ */Qe("div",{className:"min-w-0 flex-1",children:[a?/* @__PURE__ */et("label",{htmlFor:a,className:g,children:e}):/* @__PURE__ */et("span",{className:g,children:e}),r&&/* @__PURE__ */et("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),u&&/* @__PURE__ */et("div",{className:`shrink-0 ${d.text} ${p}`,children:h?l:t})]}),null!=n&&!1!==n&&/* @__PURE__ */et("div",{className:`${d.bodyTop} border-t border-gray-100 ${d.bodyPad}`,children:n})]})}var ni={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function ai({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=be(),c=e>t?`${we(t,s)}+`:we(e,s),d=l?"":i,u=o?/* @__PURE__ */et("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${ni[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${ni[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */Qe("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */et("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var li={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},ii={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function oi({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=be(),c="number"!=typeof t?t:null!=r?Ne(t,r,s):s?we(t,s):t;/* @__PURE__ */
289
298
  return Qe("div",{className:o,children:[e&&/* @__PURE__ */et("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
290
- /* @__PURE__ */Qe("div",{className:`mt-1 flex items-baseline gap-1 ${Ul[l]}`,children:[n&&/* @__PURE__ */et("span",{className:"text-sm",children:n}),
291
- /* @__PURE__ */et("span",{className:`font-semibold tabular-nums ${Hl[i]}`,children:c}),a&&/* @__PURE__ */et("span",{className:"text-sm",children:a})]})]})}var Yl={xs:24,sm:32,md:40,lg:56},Gl={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function Xl(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function Jl({src:e,name:t,size:r="md",status:n,className:a=""}){const l=Yl[r],i=Math.max(8,Math.round(.28*l)),[o,s]=Oe(!1);_e(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
299
+ /* @__PURE__ */Qe("div",{className:`mt-1 flex items-baseline gap-1 ${ii[l]}`,children:[n&&/* @__PURE__ */et("span",{className:"text-sm",children:n}),
300
+ /* @__PURE__ */et("span",{className:`font-semibold tabular-nums ${li[i]}`,children:c}),a&&/* @__PURE__ */et("span",{className:"text-sm",children:a})]})]})}var si={xs:24,sm:32,md:40,lg:56},ci={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function di(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function ui({src:e,name:t,size:r="md",status:n,className:a=""}){const l=si[r],i=Math.max(8,Math.round(.28*l)),[o,s]=Oe(!1);_e(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
292
301
  /* @__PURE__ */
293
- return Qe("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */et("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */et("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:Xl(t)}),n&&/* @__PURE__ */et("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${Gl[n]}`,style:{width:i,height:i}})]})}function Zl({children:e,max:t,size:r="md",className:n=""}){const a=He.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=Yl[r],s=Math.round(.3*o),c=fe();/* @__PURE__ */
294
- return Qe("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */et("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */Qe("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",we(i,c)]})]})}var Ql={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},ei={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function ti({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
302
+ return Qe("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */et("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */et("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:di(t)}),n&&/* @__PURE__ */et("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${ci[n]}`,style:{width:i,height:i}})]})}function hi({children:e,max:t,size:r="md",className:n=""}){const a=He.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=si[r],s=Math.round(.3*o),c=be();/* @__PURE__ */
303
+ return Qe("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */et("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */Qe("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",we(i,c)]})]})}var mi={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},pi={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function gi({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
295
304
  return et(ue,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
296
305
  return et(ue,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
297
306
  return et(ue,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
298
- return et(ue,{name:"info",look:"mini",...t})}}function ri({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=Ql[e],d="solid"===t,u=be().banner,h=d?ei[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */Qe(tt,{children:[r&&/* @__PURE__ */et("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */et("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
307
+ return et(ue,{name:"info",look:"mini",...t})}}function fi({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=mi[e],d="solid"===t,u=fe().banner,h=d?pi[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */Qe(tt,{children:[r&&/* @__PURE__ */et("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */et("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
299
308
  return Qe("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${s}`.trim(),children:[
300
- /* @__PURE__ */et("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */et(ti,{tone:e})}),null==l?/* @__PURE__ */et("div",{className:"min-w-0 flex-1 text-sm",children:p}):
309
+ /* @__PURE__ */et("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */et(gi,{tone:e})}),null==l?/* @__PURE__ */et("div",{className:"min-w-0 flex-1 text-sm",children:p}):
301
310
  /* @__PURE__ */Qe("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
302
311
  /* @__PURE__ */et("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
303
- /* @__PURE__ */et("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */et("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */et(ue,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var ni=(e,t)=>`${e}-tab-${t}`,ai=(e,t)=>`${e}-panel-${t}`,li=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function ii(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-900 hover:border-gray-300"}`}function oi({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Re([]),d="pill"===n,u=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},h=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
304
- return et("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?mn(a,i):li(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */et("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?ni(l,e.id):void 0,"aria-controls":l?ai(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?pn({selected:i,disabled:e.disabled,block:a}):ii(i,a),children:/* @__PURE__ */et(fn,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */et(O,{content:e.tooltip,className:d||a?gn(a):void 0,children:o},e.id):o})})}var si=()=>/* @__PURE__ */et(ue,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function ci({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
305
- return et("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,o=/* @__PURE__ */et("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */et(si,{}):n+1}),s=/* @__PURE__ */Qe("span",{className:"min-w-0 text-center",children:[
312
+ /* @__PURE__ */et("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */et("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */et(ue,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var bi=(e,t)=>`${e}-tab-${t}`,yi=(e,t)=>`${e}-panel-${t}`,xi=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function vi(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-900 hover:border-gray-300"}`}function wi({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Re([]),d="pill"===n,u=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},h=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
313
+ return et("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?mn(a,i):xi(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */et("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?bi(l,e.id):void 0,"aria-controls":l?yi(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?pn({selected:i,disabled:e.disabled,block:a}):vi(i,a),children:/* @__PURE__ */et(fn,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */et(O,{content:e.tooltip,className:d||a?gn(a):void 0,children:o},e.id):o})})}var Ni=()=>/* @__PURE__ */et(ue,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function ki({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
314
+ return et("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,o=/* @__PURE__ */et("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */et(Ni,{}):n+1}),s=/* @__PURE__ */Qe("span",{className:"min-w-0 text-center",children:[
306
315
  /* @__PURE__ */et("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */et("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
307
- return Qe("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */Qe("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}var di=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function ui({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,level:l=3,className:i=""}){const[o,s]=Oe(t),c=We(),d=`h${l}`,u=r??o;/* @__PURE__ */
308
- return et("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${i}`.trim(),children:e.map(e=>{const t=u.includes(e.id),l=`${c}-${di(e.id)}-head`,i=`${c}-${di(e.id)}-panel`;/* @__PURE__ */
316
+ return Qe("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */Qe("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}var $i=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function Mi({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,level:l=3,className:i=""}){const[o,s]=Oe(t),c=We(),d=`h${l}`,u=r??o;/* @__PURE__ */
317
+ return et("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${i}`.trim(),children:e.map(e=>{const t=u.includes(e.id),l=`${c}-${$i(e.id)}-head`,i=`${c}-${$i(e.id)}-panel`;/* @__PURE__ */
309
318
  return Qe("div",{children:[
310
319
  /* @__PURE__ */et(d,{className:"m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]",children:/* @__PURE__ */Qe("button",{type:"button",id:l,disabled:e.disabled,"aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>(e=>{const t=u.includes(e)?u.filter(t=>t!==e):a?[...u,e]:[e];void 0===r&&s(t),n?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
311
320
  /* @__PURE__ */et("span",{children:e.title}),
312
- /* @__PURE__ */et(ue,{name:"chevron-down",className:"h-4 w-4 shrink-0 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]})}),t&&/* @__PURE__ */et("div",{id:i,role:"region","aria-labelledby":l,className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function hi(){const[e,t]=Oe(null);return{pct:e,start:Te(e=>{const r=e.reduce((e,t)=>e+t.size,0)||1,n=new Array(e.length).fill(0);return t(0),e=>a=>{n[e]=a,t(Math.min(100,Math.round(n.reduce((e,t)=>e+t,0)/r*100)))}},[]),done:Te(()=>t(null),[])}}function mi({colorClass:e,tone:r,children:n,size:a="sm",capitalize:l=!1,closable:i=!1,onClose:o,closeLabel:s,className:c=""}){const d=e??Tt[r??"neutral"],u="xs"===a?"px-2 py-0.5 text-3xs":"md"===a?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",h=l?"capitalize":"",m=be().badge,p=s??("string"==typeof n?m.removeItem(n):m.remove),g="xs"===a?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
313
- return Qe("span",{className:[It,"font-medium",u,h,d,c].filter(Boolean).join(" "),children:[
314
- /* @__PURE__ */et(t,{children:n}),i&&/* @__PURE__ */et("button",{type:"button",onClick:o,"aria-label":p,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */et(ue,{name:"close",look:"mini",className:g,"aria-hidden":"true"})})]})}function pi({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:o}){const s=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==s),u=be().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
315
- return Qe("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */et("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */et(ue,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */et("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */et("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */et("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */et("div",{className:"mt-4",children:o})]})}function gi({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
321
+ /* @__PURE__ */et(ue,{name:"chevron-down",className:"h-4 w-4 shrink-0 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]})}),t&&/* @__PURE__ */et("div",{id:i,role:"region","aria-labelledby":l,className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function Ci(){const[e,t]=Oe(null);return{pct:e,start:Te(e=>{const r=e.reduce((e,t)=>e+t.size,0)||1,n=new Array(e.length).fill(0);return t(0),e=>a=>{n[e]=a,t(Math.min(100,Math.round(n.reduce((e,t)=>e+t,0)/r*100)))}},[]),done:Te(()=>t(null),[])}}function Li({colorClass:e,tone:r,children:n,size:a="sm",capitalize:l=!1,closable:i=!1,onClose:o,closeLabel:s,className:c=""}){const d=e??Tt[r??"neutral"],u="xs"===a?"px-2 py-0.5 text-3xs":"md"===a?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",h=l?"capitalize":"",m=fe().badge,p=s??("string"==typeof n?m.removeItem(n):m.remove),g="xs"===a?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
322
+ return Qe("span",{className:[Bt,"font-medium",u,h,d,c].filter(Boolean).join(" "),children:[
323
+ /* @__PURE__ */et(t,{children:n}),i&&/* @__PURE__ */et("button",{type:"button",onClick:o,"aria-label":p,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */et(ue,{name:"close",look:"mini",className:g,"aria-hidden":"true"})})]})}function Di({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:o}){const s=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==s),u=fe().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
324
+ return Qe("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */et("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */et(ue,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */et("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */et("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */et("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */et("div",{className:"mt-4",children:o})]})}function Si({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
316
325
  return Qe("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */et(e,{items:o,className:"mb-3"}),
317
326
  /* @__PURE__ */Qe("div",{className:"flex items-start justify-between gap-4",children:[
318
327
  /* @__PURE__ */Qe("div",{children:[
319
- /* @__PURE__ */Qe("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */et("span",{className:"shrink-0",children:i}),t]}),s&&/* @__PURE__ */et("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */et("div",{className:"flex items-center gap-2",children:c})]})]})}var fi=["success","warning","danger"];function bi(e){return"string"==typeof e&&fi.includes(e)}function xi(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=yi(t),a=yi(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function yi(e){return null!=e&&Number.isFinite(e)?e:null}var vi={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var wi=/* @__PURE__ */new Set;function Ni(e,t){if(null==e)return null;if(bi(e))return vi[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;wi.has(r)||(wi.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${fi.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function ki({at:e,title:t,className:r}){/* @__PURE__ */
320
- return et("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var $i=e=>Math.min(100,Math.max(0,e));function Mi({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=be().meter,m=fe(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,wi.has(b)||(wi.add(b),console.error(x)));const y=Ni(l,"MetricBar"),v=null!=g?y??(null==(w=xi(g,n,a))?null:vi[w]):null;var w;const N=yi(n),k=yi(a),$=null!=g&&null!=f?$i(g/f*100):0,M=null!=g?(o??(e=>100===f?ke(e,1,m):we(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,S=/* @__PURE__ */Qe("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":M}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
321
- /* @__PURE__ */et("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */et(ki,{at:$i(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */et(ki,{at:$i(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),A=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
328
+ /* @__PURE__ */Qe("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */et("span",{className:"shrink-0",children:i}),t]}),s&&/* @__PURE__ */et("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */et("div",{className:"flex items-center gap-2",children:c})]})]})}var Ai=["success","warning","danger"];function Pi(e){return"string"==typeof e&&Ai.includes(e)}function ji(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=zi(t),a=zi(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function zi(e){return null!=e&&Number.isFinite(e)?e:null}var Fi={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var Ei=/* @__PURE__ */new Set;function Ii(e,t){if(null==e)return null;if(Pi(e))return Fi[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;Ei.has(r)||(Ei.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Ai.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function Bi({at:e,title:t,className:r}){/* @__PURE__ */
329
+ return et("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Ti=e=>Math.min(100,Math.max(0,e));function Oi({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=fe().meter,m=be(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,y;null==f&&(b=`MetricBar:max:${String(r)}`,y=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Ei.has(b)||(Ei.add(b),console.error(y)));const x=Ii(l,"MetricBar"),v=null!=g?x??(null==(w=ji(g,n,a))?null:Fi[w]):null;var w;const N=zi(n),k=zi(a),$=null!=g&&null!=f?Ti(g/f*100):0,M=null!=g?(o??(e=>100===f?ke(e,1,m):we(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,S=/* @__PURE__ */Qe("div",{...D?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":M}:{"aria-hidden":!0},className:D&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[D&&
330
+ /* @__PURE__ */et("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */et(Bi,{at:Ti(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */et(Bi,{at:Ti(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),A=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
322
331
  return Qe("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */et("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
323
332
  /* @__PURE__ */Qe("div",{className:"mt-1 flex items-baseline gap-2",children:[
324
333
  /* @__PURE__ */et("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${A}`,children:M}),
325
334
  /* @__PURE__ */et("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]}:{className:u,children:[
326
335
  /* @__PURE__ */Qe("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */et("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
327
336
  /* @__PURE__ */et("span",{className:`text-sm font-semibold tabular-nums ${A}`,children:M}),
328
- /* @__PURE__ */et("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]})}function Ci(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Li(e,t){const r=Ci(e);if(null==r)return"no-reading";const n=Ci(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Di=e=>Math.min(100,Math.max(0,e));function Si({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:o,size:s="sm",ariaLabel:c,className:d=""}){const u=be().meter,h=fe(),m=l??(e=>function(e,t=xe.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=o??u.noBudget,f=Ci(t),b=Ci(r),x=null!=b&&b>0?b:null,y=Ci(n)??0,v="over"===Li(t,r),w=null!=x?x+y:null,N=null!=x&&null!=w?Di(x/w*100):null,k=v&&y>0,$=null==w||null==f?0:v?k?N??0:0:Di(f/w*100),M=k?N??0:0,C=v?k&&null!=w&&null!=f?Di(f/w*100):100:0,L=Math.max(0,C-M),D=null!=f&&null!=x?f/x*100:null,S=null!=D?ke(Math.round(D),0,h):null!=f?m(f):"—",A=a??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),P="md"===s?"h-2":"h-1.5",j=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=x&&null!=w?/* @__PURE__ */Qe("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(S),className:`relative mt-2 ${P} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */et("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${$}%`}}),L>0&&/* @__PURE__ */et("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${M}%`,width:`${L}%`}}),y>0&&null!=N&&/* @__PURE__ */et("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
337
+ /* @__PURE__ */et("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),S]})}function Ri(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Wi(e,t){const r=Ri(e);if(null==r)return"no-reading";const n=Ri(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Ki=e=>Math.min(100,Math.max(0,e));function _i({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:o,size:s="sm",ariaLabel:c,className:d=""}){const u=fe().meter,h=be(),m=l??(e=>function(e,t=ye.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=o??u.noBudget,f=Ri(t),b=Ri(r),y=null!=b&&b>0?b:null,x=Ri(n)??0,v="over"===Wi(t,r),w=null!=y?y+x:null,N=null!=y&&null!=w?Ki(y/w*100):null,k=v&&x>0,$=null==w||null==f?0:v?k?N??0:0:Ki(f/w*100),M=k?N??0:0,C=v?k&&null!=w&&null!=f?Ki(f/w*100):100:0,L=Math.max(0,C-M),D=null!=f&&null!=y?f/y*100:null,S=null!=D?ke(Math.round(D),0,h):null!=f?m(f):"—",A=a??(null==f?p:null==y?g:`${m(f)} / ${m(y)}`),P="md"===s?"h-2":"h-1.5",j=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=y&&null!=w?/* @__PURE__ */Qe("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(S),className:`relative mt-2 ${P} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */et("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${$}%`}}),L>0&&/* @__PURE__ */et("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${M}%`,width:`${L}%`}}),x>0&&null!=N&&/* @__PURE__ */et("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
329
338
  return Qe("div","md"===s?{className:d,children:[null!=e&&/* @__PURE__ */et("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
330
339
  /* @__PURE__ */Qe("div",{className:"mt-1 flex items-baseline gap-2",children:[
331
340
  /* @__PURE__ */et("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:S}),
332
341
  /* @__PURE__ */et("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:A})]}),z]}:{className:d,children:[
333
342
  /* @__PURE__ */Qe("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */et("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
334
343
  /* @__PURE__ */et("span",{className:`text-sm font-semibold tabular-nums ${j}`,children:S}),
335
- /* @__PURE__ */et("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:A})]}),z]})}var Ai=864e5;function Pi(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function ji(e,t){return Ae(new Date(e).toISOString().slice(0,10),{locale:t})}var zi=(e,t)=>`${e}-fill-${t}`,Fi=e=>`${e}-glow`,Ei=e=>`${e}-reveal`,Bi=e=>`${e}-ground`;function Ii(e,t,r,n){return"solid"===r?n:`url(#${zi(e,t)})`}function Ti(e){return"solid"===e?void 0:"4 3"}function Oi({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=zi(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
344
+ /* @__PURE__ */et("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:A})]}),z]})}var qi=864e5;function Hi(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function Ui(e,t){return Ae(new Date(e).toISOString().slice(0,10),{locale:t})}var Vi=(e,t)=>`${e}-fill-${t}`,Yi=e=>`${e}-glow`,Gi=e=>`${e}-reveal`,Xi=e=>`${e}-ground`;function Zi(e,t,r,n){return"solid"===r?n:`url(#${Vi(e,t)})`}function Ji(e){return"solid"===e?void 0:"4 3"}function Qi({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Vi(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
336
345
  return Qe("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
337
346
  /* @__PURE__ */et("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
338
347
  /* @__PURE__ */et("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const o=/* @__PURE__ */et("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */Qe("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
@@ -345,14 +354,14 @@ return Qe("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
345
354
  /* @__PURE__ */et("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===n?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[o,
346
355
  /* @__PURE__ */et("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[o,
347
356
  /* @__PURE__ */et("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[o,
348
- /* @__PURE__ */et("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Ri({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
349
- return et("mask",{id:Ei(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */et("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function Wi({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
350
- return Qe("defs",{children:[t.map((t,a)=>/* @__PURE__ */et(Oi,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */et(Ri,{id:e,direction:l}),a&&/* @__PURE__ */Qe("filter",{id:Fi(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
357
+ /* @__PURE__ */et("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function eo({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
358
+ return et("mask",{id:Gi(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */et("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function to({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
359
+ return Qe("defs",{children:[t.map((t,a)=>/* @__PURE__ */et(Qi,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */et(eo,{id:e,direction:l}),a&&/* @__PURE__ */Qe("filter",{id:Yi(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
351
360
  /* @__PURE__ */et("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
352
361
  /* @__PURE__ */Qe("feMerge",{children:[
353
362
  /* @__PURE__ */et("feMergeNode",{in:"blur"}),
354
- /* @__PURE__ */et("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */et(Ki,{id:Bi(e),variant:i})]})}function Ki({id:e,variant:t}){/* @__PURE__ */
355
- return et("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */et("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var _i={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},qi=(e,t=60)=>({animationDelay:e*t+"ms"}),Hi={receipt:/* @__PURE__ */Qe(tt,{children:[
363
+ /* @__PURE__ */et("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */et(ro,{id:Xi(e),variant:i})]})}function ro({id:e,variant:t}){/* @__PURE__ */
364
+ return et("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */et("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */et("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var no={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},ao=(e,t=60)=>({animationDelay:e*t+"ms"}),lo={receipt:/* @__PURE__ */Qe(tt,{children:[
356
365
  /* @__PURE__ */et("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
357
366
  /* @__PURE__ */et("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */et("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */Qe(tt,{children:[
358
367
  /* @__PURE__ */et("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
@@ -362,57 +371,57 @@ return et("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSp
362
371
  /* @__PURE__ */et("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
363
372
  /* @__PURE__ */et("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */Qe(tt,{children:[
364
373
  /* @__PURE__ */et("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
365
- /* @__PURE__ */et("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function Ui({name:e}){/* @__PURE__ */
366
- return et("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:Hi[e]})}function Vi(){/* @__PURE__ */
374
+ /* @__PURE__ */et("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function io({name:e}){/* @__PURE__ */
375
+ return et("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:lo[e]})}function oo(){/* @__PURE__ */
367
376
  return Qe("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
368
377
  /* @__PURE__ */et("path",{d:"M4.2 2.2v11.6"}),
369
- /* @__PURE__ */et("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function Yi(){/* @__PURE__ */
370
- return et("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */et("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Gi=1e-6;function Xi(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?o:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Gi||(a+=r-n[e],n[e]=r);if(a<=Gi)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Gi&&(l+=n[e]-r);if(l<=Gi)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Gi||(n[e]-=i*(n[e]-r)/l);return n}(f,u,s),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function Ji(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Zi="mixed";function Qi(e,t){return 5.6*Math.max(e.length,t.length)+8}var eo=(e,t,r)=>Math.min(Math.max(e,t),r),to=e=>-(Math.cos(Math.PI*e)-1)/2;function ro(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*to(t);return{px:r,ms:e.msByPx(r)}}var no={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function ao(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var lo=e=>5.6*e.length,io={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},oo={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function so(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:io[t].glyph??(r?"flag":void 0)}function co(e,t,r=!1){const n=io[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function uo(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var ho="undefined"==typeof document?_e:Ze;function mo(e,t){const[r,n]=Oe(0);return ho(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function po(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),o=i-l,s=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,x=s.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=x[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*x[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(y),gaps:e.gaps.map(e=>({...e,fromPx:y(e.fromPx),toPx:y(e.toPx),px:y(e.toPx)-y(e.fromPx)})),xByMs:t=>y(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+x[r]))return a[r]+(x[r]>0?(e-t)/x[r]*(a[r+1]-a[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function go(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function fo({marks:e,innerRef:t}){/* @__PURE__ */
378
+ /* @__PURE__ */et("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function so(){/* @__PURE__ */
379
+ return et("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */et("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var co=1e-6;function uo(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?o:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-co||(a+=r-n[e],n[e]=r);if(a<=co)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+co&&(l+=n[e]-r);if(l<=co)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+co||(n[e]-=i*(n[e]-r)/l);return n}(f,u,s),y=b.reduce((e,t,r)=>u[r]?e:e+t,0),x=b.map((e,t)=>u[t]?e:y>0?e*m/y:e),v=[0];for(let e=0;e<x.length;e++)v.push(v[e]+x[e]);v[v.length-1]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function ho(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var mo="mixed";function po(e,t){return 5.6*Math.max(e.length,t.length)+8}var go=(e,t,r)=>Math.min(Math.max(e,t),r),fo=e=>-(Math.cos(Math.PI*e)-1)/2;function bo(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*fo(t);return{px:r,ms:e.msByPx(r)}}var yo={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function xo(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var vo=e=>5.6*e.length,wo={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},No={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function ko(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:wo[t].glyph??(r?"flag":void 0)}function $o(e,t,r=!1){const n=wo[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function Mo(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Co="undefined"==typeof document?_e:Je;function Lo(e,t){const[r,n]=Oe(0);return Co(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function Do(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),o=i-l,s=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,y=s.map(e=>c>0?e*d/c:0),x=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=y[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*y[r]:0)}return b};return{anchorsMs:e.anchorsMs,xs:e.xs.map(x),gaps:e.gaps.map(e=>({...e,fromPx:x(e.fromPx),toPx:x(e.toPx),px:x(e.toPx)-x(e.fromPx)})),xByMs:t=>x(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+y[r]))return a[r]+(y[r]>0?(e-t)/y[r]*(a[r+1]-a[r]):0);t+=y[r]}return i})(t)),inCut:e.inCut}}function So(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function Ao({marks:e,innerRef:t}){/* @__PURE__ */
371
380
  return et("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */Qe("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
372
381
  /* @__PURE__ */et("span",{className:"rosh-tl-name",children:e.label}),
373
- /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function bo({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=be().timeline,i=De(fe()),o=n.ruler,s=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Ai){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Ai)-t<14||s.push(
374
- /* @__PURE__ */et("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${o}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=lo(l.days(Math.round(e.gapMs/Ai)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
382
+ /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Po({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=fe().timeline,i=De(be()),o=n.ruler,s=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*qi){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*qi)-t<14||s.push(
383
+ /* @__PURE__ */et("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${o}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=vo(l.days(Math.round(e.gapMs/qi)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
375
384
  /* @__PURE__ */et("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${o}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(s.push(
376
- /* @__PURE__ */et("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+lo(r))||(c.push(
385
+ /* @__PURE__ */et("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+vo(r))||(c.push(
377
386
  /* @__PURE__ */et("span",{className:"rosh-tl-month"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${o+9}px`,...a?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
378
- return Qe("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[s,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Ai));/* @__PURE__ */
387
+ return Qe("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[s,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/qi));/* @__PURE__ */
379
388
  return Qe("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${o}px`,...a?{animationDelay:"420ms"}:{}},children:[
380
389
  /* @__PURE__ */Qe("span",{className:"rosh-tl-cutglyph",children:[
381
390
  /* @__PURE__ */et("i",{}),
382
391
  /* @__PURE__ */et("i",{})]}),
383
- /* @__PURE__ */et("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function xo({pending:e,reveal:t}){const r=be().timeline,[n,a]=Oe(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
392
+ /* @__PURE__ */et("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function jo({pending:e,reveal:t}){const r=fe().timeline,[n,a]=Oe(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
384
393
  return Qe("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
385
394
  /* @__PURE__ */et("p",{className:"rosh-tl-pending-head",children:r.notReached}),
386
395
  /* @__PURE__ */et("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */Qe("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
387
- /* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&io[e.kind].diamond?" is-diamond":"")}),
388
- /* @__PURE__ */Qe("span",{children:[0===n&&/* @__PURE__ */et("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */et("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function yo({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=be().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/Ai):0;/* @__PURE__ */
396
+ /* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&wo[e.kind].diamond?" is-diamond":"")}),
397
+ /* @__PURE__ */Qe("span",{children:[0===n&&/* @__PURE__ */et("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */et("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function zo({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=fe().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/qi):0;/* @__PURE__ */
389
398
  return Qe("div",{"data-timeline-part":"vertical",children:[
390
- /* @__PURE__ */et("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=co(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
391
- return Qe("li",{className:a?"rosh-tl-fade":void 0,style:a?qi(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
399
+ /* @__PURE__ */et("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=$o(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
400
+ return Qe("li",{className:a?"rosh-tl-fade":void 0,style:a?ao(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
392
401
  /* @__PURE__ */et("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
393
- /* @__PURE__ */Qe("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?qi(t,i):{}},children:[s&&/* @__PURE__ */et(Ui,{name:s}),"current"===e.role&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
402
+ /* @__PURE__ */Qe("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?ao(t,i):{}},children:[s&&/* @__PURE__ */et(io,{name:s}),"current"===e.role&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
394
403
  /* @__PURE__ */Qe("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
395
404
  /* @__PURE__ */et("span",{className:"rosh-tl-name",children:e.label}),
396
405
  /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */Qe("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
397
406
  /* @__PURE__ */et("i",{className:"rosh-tl-vline is-dash"}),
398
- /* @__PURE__ */et("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */et(xo,{pending:t,reveal:a})]})}function vo({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
407
+ /* @__PURE__ */et("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */et(jo,{pending:t,reveal:a})]})}function Fo({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
399
408
  return Qe("div",{"aria-hidden":"true",children:[
400
409
  /* @__PURE__ */et("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */et("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${n?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),a))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */Qe("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
401
410
  /* @__PURE__ */et("i",{}),
402
- /* @__PURE__ */et("i",{})]},`railcut-${e.fromMs}`))]})}function wo({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,o=a?" rosh-tl-fade":"",s=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
411
+ /* @__PURE__ */et("i",{})]},`railcut-${e.fromMs}`))]})}function Eo({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,o=a?" rosh-tl-fade":"",s=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
403
412
  return Qe("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
404
- /* @__PURE__ */et("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */et("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */et("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function No({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=be().timeline;/* @__PURE__ */
413
+ /* @__PURE__ */et("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */et("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */et("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function Io({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=fe().timeline;/* @__PURE__ */
405
414
  return Qe("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
406
415
  /* @__PURE__ */et("div",{className:"rosh-tl-todayline"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...a?{animationDelay:"420ms"}:{}}}),
407
- /* @__PURE__ */et("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${Ji(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function ko({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=lo(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */et("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */et("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function $o({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
416
+ /* @__PURE__ */et("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${ho(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Bo({nodes:e,geo:t,reveal:r}){const n=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=vo(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */et("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */et("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function To({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
408
417
  return Qe("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
409
418
  /* @__PURE__ */et("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
410
- /* @__PURE__ */Qe("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Mo({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=be().timeline,o=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),s=e.find(e=>e.key===a)??e.find(e=>o(e,n))??null;if(!s)return null;const c=s.mark,d=c?c.label:`×${s.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(s.members),h=c?c.widthPx:Qi(d,u),m=c?.onOpen;/* @__PURE__ */
411
- return Qe("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${Ji(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */et("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */et("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
412
- /* @__PURE__ */et("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Co({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(lo(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,o=a.gapPx??6,s=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:s},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<s;e++)if(d[e].every(e=>a>e.right+o||c+o<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,Ai),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=Ji(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),N=e=>0===e?r.laneA:r.laneB,k=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
413
- return Qe(tt,{children:[x.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*s+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
419
+ /* @__PURE__ */Qe("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Oo({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=fe().timeline,o=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),s=e.find(e=>e.key===a)??e.find(e=>o(e,n))??null;if(!s)return null;const c=s.mark,d=c?c.label:`×${s.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(s.members),h=c?c.widthPx:po(d,u),m=c?.onOpen;/* @__PURE__ */
420
+ return Qe("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${ho(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */et("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */et("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
421
+ /* @__PURE__ */et("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Ro({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const y=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(y.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(vo(a))+28}),n===c)for(const r of e.members)y.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;y.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),y.sort((e,t)=>e.x-t.x);const x=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,o=a.gapPx??6,s=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:s},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<s;e++)if(d[e].every(e=>a>e.right+o||c+o<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...y.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,qi),{laneCount:2}),v=new Map(x.map(e=>[e.key,e.lane]));for(const e of y)e.lane=v.get(e.key)??-1,e.left=ho(e.x,e.widthPx,t);const w=y.find(e=>e.key===(h??p)),N=e=>0===e?r.laneA:r.laneB,k=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
422
+ return Qe(tt,{children:[y.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*s+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
414
423
  return Qe("div",{children:[
415
- /* @__PURE__ */Qe("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${io[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:io[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
424
+ /* @__PURE__ */Qe("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${wo[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:wo[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
416
425
  /* @__PURE__ */et("i",{"aria-hidden":"true"}),e.text]}),
417
426
  /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${k(t)}px`}})]},e.key)}const a=e.group.mark;if(e.lane<0)return a.key===i?/* @__PURE__ */Qe("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
418
427
  /* @__PURE__ */et("span",{className:"rosh-tl-name",children:a.label}),
@@ -424,24 +433,24 @@ return Qe("div",{children:[
424
433
  /* @__PURE__ */et("p",{className:"rosh-tl-popover-head",children:w.text}),
425
434
  /* @__PURE__ */et("ol",{children:w.group.members.map(e=>/* @__PURE__ */Qe("li",{children:[
426
435
  /* @__PURE__ */et("span",{children:e.label}),
427
- /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Lo({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:o,layerRef:s,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=be().timeline,p=fe(),g=Re(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,x=go(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=s.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},N=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},$=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?eo((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},M=e.valueText?e.valueText(b):ji(b,p),C=Math.max(1,Math.round((i-l)/Ai));/* @__PURE__ */
436
+ /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Wo({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:o,layerRef:s,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=fe().timeline,p=be(),g=Re(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,y=So(e.stops),x=y?y.indexOf(t):-1,v=e=>{const r=s.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},N=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},$=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?go((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},M=e.valueText?e.valueText(b):Ui(b,p),C=Math.max(1,Math.round((i-l)/qi));/* @__PURE__ */
428
437
  return Qe(tt,{children:[
429
438
  /* @__PURE__ */et("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
430
- /* @__PURE__ */et("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Ji(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):ji(b,p)}),
431
- /* @__PURE__ */et("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/Ai),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*Ai;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Do(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function So({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:x,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=ce(Date.now,null),$=ce(ao,!1),M=o??k,C=Re(null),L=be().timeline,D=fe(),S=e=>ji(e,D),A=Re(null),P=Re(null),j=Re(null),z=Re(/* @__PURE__ */new Map),F=Re(void 0),E=Re(void 0),B=Re(null),[I,T]=Oe({}),[O,R]=Oe(null),[W,K]=Oe(null),[q,H]=Oe(null),[U,V]=Oe(null),[Y,G]=Oe(null),[X,J]=Oe(null),Z=We(),Q=We(),ee=mo(C,!0),re=ee>0?ee-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=mo(A,!ne),le=ae>0?ae:600,ie=no[s],oe=N&&l.length>0,se=oe?Math.max(0,le-36):le,de=r=>r>=e-Ai&&r<=t+Ai,ue=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),he="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],me=Xi([e,...[...ue.map(e=>e.ms),...he].filter(r=>r>e&&r<t),t],se,"compressed"===(pe=r)?{}:"spread"===pe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var pe;const ge=me.xByMs,xe=ue.filter(e=>!e.provisional),ye=g??(xe.length>0?xe[xe.length-1].key:null),ve=ue.map((e,t)=>{const r=e.date??S(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?oo[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ge(e.ms),baseX:ge(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:so(e,a,0===t&&"default"===a),role:e.key===ye?"current":n?"dot":"key",widthPx:N?Math.max(16,lo(e.caption??"")+6):I[e.key]||Qi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=S(t);return{key:r,ms:t,x:ge(t),baseX:ge(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??io[e.kind].glyph,role:"key",widthPx:I[r]||Qi(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Ne=oe?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ai,x:le,baseX:le,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!oe?[{key:w.key,ms:t,x:se,baseX:se,kind:"default",label:w.label,dateText:w.dateText??S(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??L.start(S(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(lo(Me)):96,Le="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}($e):[],De=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:Zi,members:t})}n=a}return r}($e),Se=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ae=/* @__PURE__ */new Map;for(const e of De)if("cluster"===e.type)for(const t of e.members)Ae.set(t.key,Se(e));const Pe=q??U??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Pe)??De.find(e=>"cluster"===e.type&&Se(e)===Pe),ze=e=>({x:e.baseX,widthPx:e.widthPx}),Fe=je&&"cluster"===je.type?je.members.map(ze):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(ze):[],Ee=Fe.length>1?po(me,Fe,se):me,Be=Ee!==me;if(Be)for(const e of $e)e.isCap||(e.x=Ee.xByMs(e.ms));const Ie=$e.some(e=>e.x<14),Ke=Be&&je?Pe:null,qe=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),He=ne?$e.map(qe):De.flatMap(e=>{if("item"===e.type)return[qe(e.mark)];const t=Se(e);if(t===Ke&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(qe);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ue=/* @__PURE__ */new Map;for(const e of He)for(const t of e.members)Ue.set(t.key,e.key);const Ve=De.find(e=>"cluster"===e.type&&Se(e)===Ke),Ye=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Ge=Re(Ke),[Xe,Je]=Oe(!1);_e(()=>{if(Ge.current===Ke)return;Ge.current=Ke,Je(!0);const e=setTimeout(()=>Je(!1),240);return()=>clearTimeout(e)},[Ke]);const Ze=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");ho(()=>{const e=P.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}T(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[Ze]);const rt=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Oe(rt),lt=b&&nt===rt;_e(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=go(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ve.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:eo(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Ee,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Oe(null),pt=Re(null),gt=Re({segments:ut,value:ct,playback:h});_e(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Re(null),bt=Te(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=Te(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;_e(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(ro(t,0))):xt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:ro(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:ro(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=ro(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:to(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(y??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Te(()=>{clearTimeout(F.current),clearTimeout(E.current),R(null),K(null),H(null),V(null),G(null)},[]);_e(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),_e(()=>{const e=B.current;e&&(B.current=null,z.current.get(e)?.focus())});const Ct=null!==W||null!==q||null!==U||null!==Y;_e(()=>{if(Ct)return te(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Te((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,le-r)):t;const a=e.parentElement;if(r>0&&a){const t=_(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[le]),Dt=He.find(e=>e.key===W)??null,St=Dt?Dt.x:0;ho(()=>{Lt(j.current,St)},[Lt,W,St]);const At=ct??void 0,Pt=Re(null);_e(()=>{if(void 0===At)return;const e=Ee.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=z.current.get(Ue.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[At]);const jt=He.map(e=>e.key),zt=ye?Ue.get(ye)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),J(jt[r]),z.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(E.current),It=e=>{Bt(),G(e)},Tt=()=>{clearTimeout(E.current),E.current=setTimeout(()=>G(null),260)},Ot=e=>{Ke&&Ae.get(e)===Ke?Bt():(Bt(),G(null))},Rt=e=>{clearTimeout(F.current),R(e),K(e),v?.((e=>{const t=He.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{R(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>K(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":uo(e),"aria-describedby":W===e.key?Z:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(uo))),"aria-describedby":W===e.key?Z:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{e.openable?It(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);It(e.key);const r=e.members[0];J(r.key),B.current=r.key}};var t,r},qt="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
432
- return et("div",{ref:C,children:/* @__PURE__ */et(yo,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:ye,todayMs:M,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Et})});const Ht=(e,t)=>null==e||!1===e?null:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:ie.rail-3+"px"},children:e});/* @__PURE__ */
439
+ /* @__PURE__ */et("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${ho(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):Ui(b,p)}),
440
+ /* @__PURE__ */et("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":y&&y.length>0?y.length-1:C,"aria-valuenow":y&&y.length>0?Math.max(0,x):Math.round((t-l)/qi),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*qi;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Ko(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function _o({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:y,highlightKeys:x=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=ce(Date.now,null),$=ce(xo,!1),M=o??k,C=Re(null),L=fe().timeline,D=be(),S=e=>Ui(e,D),A=Re(null),P=Re(null),j=Re(null),z=Re(/* @__PURE__ */new Map),F=Re(void 0),E=Re(void 0),I=Re(null),[B,T]=Oe({}),[O,R]=Oe(null),[W,K]=Oe(null),[q,H]=Oe(null),[U,V]=Oe(null),[Y,G]=Oe(null),[X,Z]=Oe(null),J=We(),Q=We(),ee=Lo(C,!0),re=ee>0?ee-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=Lo(A,!ne),le=ae>0?ae:600,ie=yo[s],oe=N&&l.length>0,se=oe?Math.max(0,le-36):le,de=r=>r>=e-qi&&r<=t+qi,ue=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),he="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],me=uo([e,...[...ue.map(e=>e.ms),...he].filter(r=>r>e&&r<t),t],se,"compressed"===(pe=r)?{}:"spread"===pe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var pe;const ge=me.xByMs,ye=ue.filter(e=>!e.provisional),xe=g??(ye.length>0?ye[ye.length-1].key:null),ve=ue.map((e,t)=>{const r=e.date??S(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?No[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:ge(e.ms),baseX:ge(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:ko(e,a,0===t&&"default"===a),role:e.key===xe?"current":n?"dot":"key",widthPx:N?Math.max(16,vo(e.caption??"")+6):B[e.key]||po(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=S(t);return{key:r,ms:t,x:ge(t),baseX:ge(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??wo[e.kind].glyph,role:"key",widthPx:B[r]||po(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Ne=oe?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+qi,x:le,baseX:le,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!oe?[{key:w.key,ms:t,x:se,baseX:se,kind:"default",label:w.label,dateText:w.dateText??S(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??L.start(S(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(vo(Me)):96,Le="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}($e):[],De=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:mo,members:t})}n=a}return r}($e),Se=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ae=/* @__PURE__ */new Map;for(const e of De)if("cluster"===e.type)for(const t of e.members)Ae.set(t.key,Se(e));const Pe=q??U??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Pe)??De.find(e=>"cluster"===e.type&&Se(e)===Pe),ze=e=>({x:e.baseX,widthPx:e.widthPx}),Fe=je&&"cluster"===je.type?je.members.map(ze):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(ze):[],Ee=Fe.length>1?Do(me,Fe,se):me,Ie=Ee!==me;if(Ie)for(const e of $e)e.isCap||(e.x=Ee.xByMs(e.ms));const Be=$e.some(e=>e.x<14),Ke=Ie&&je?Pe:null,qe=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),He=ne?$e.map(qe):De.flatMap(e=>{if("item"===e.type)return[qe(e.mark)];const t=Se(e);if(t===Ke&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(qe);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ue=/* @__PURE__ */new Map;for(const e of He)for(const t of e.members)Ue.set(t.key,e.key);const Ve=De.find(e=>"cluster"===e.type&&Se(e)===Ke),Ye=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Ge=Re(Ke),[Xe,Ze]=Oe(!1);_e(()=>{if(Ge.current===Ke)return;Ge.current=Ke,Ze(!0);const e=setTimeout(()=>Ze(!1),240);return()=>clearTimeout(e)},[Ke]);const Je=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Co(()=>{const e=P.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}T(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[Je]);const rt=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Oe(rt),lt=b&&nt===rt;_e(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=So(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ve.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:go(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Ee,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Oe(null),pt=Re(null),gt=Re({segments:ut,value:ct,playback:h});_e(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Re(null),bt=Te(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),yt=Te(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;_e(()=>{if(!xt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(bo(t,0))):yt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:bo(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:bo(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=bo(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:fo(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):yt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[xt,yt,bt]);const vt=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(x??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Te(()=>{clearTimeout(F.current),clearTimeout(E.current),R(null),K(null),H(null),V(null),G(null)},[]);_e(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),_e(()=>{const e=I.current;e&&(I.current=null,z.current.get(e)?.focus())});const Ct=null!==W||null!==q||null!==U||null!==Y;_e(()=>{if(Ct)return te(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Te((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,le-r)):t;const a=e.parentElement;if(r>0&&a){const t=_(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[le]),Dt=He.find(e=>e.key===W)??null,St=Dt?Dt.x:0;Co(()=>{Lt(j.current,St)},[Lt,W,St]);const At=ct??void 0,Pt=Re(null);_e(()=>{if(void 0===At)return;const e=Ee.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=z.current.get(Ue.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[At]);const jt=He.map(e=>e.key),zt=xe?Ue.get(xe)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Z(jt[r]),z.current.get(jt[r])?.focus())},It=()=>clearTimeout(E.current),Bt=e=>{It(),G(e)},Tt=()=>{clearTimeout(E.current),E.current=setTimeout(()=>G(null),260)},Ot=e=>{Ke&&Ae.get(e)===Ke?It():(It(),G(null))},Rt=e=>{clearTimeout(F.current),R(e),K(e),v?.((e=>{const t=He.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{R(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>K(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Mo(e),"aria-describedby":W===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Z(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(Mo))),"aria-describedby":W===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{e.openable?Bt(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{It(),Rt(e.key),Z(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Bt(e.key);const r=e.members[0];Z(r.key),I.current=r.key}};var t,r},qt="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
441
+ return et("div",{ref:C,children:/* @__PURE__ */et(zo,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:xe,todayMs:M,reveal:lt,ariaLabel:y,step:it,nodeProps:Kt,onKeyDown:Et})});const Ht=(e,t)=>null==e||!1===e?null:/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:ie.rail-3+"px"},children:e});/* @__PURE__ */
433
442
  return Qe("div",{ref:C,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
434
443
  /* @__PURE__ */Qe("div",{className:"flex items-stretch gap-3",children:[N&&Ht(Me,!1),
435
- /* @__PURE__ */et("div",{className:"rosh-tl-stage",style:{height:`${Do(ie,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */Qe("div",{ref:A,className:`rosh-tl-layer${Xe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ye)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ye.from&&r<=Ye.to?Bt():Tt()},onMouseLeave:Tt,children:[!N&&/* @__PURE__ */et(fo,{marks:$e,innerRef:P}),
436
- /* @__PURE__ */et(vo,{axis:Ee,geo:ie,fillTo:wt,reveal:lt,trackPx:se,tweened:!!u}),oe&&
444
+ /* @__PURE__ */et("div",{className:"rosh-tl-stage",style:{height:`${Ko(ie,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */Qe("div",{ref:A,className:`rosh-tl-layer${Xe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ye)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ye.from&&r<=Ye.to?It():Tt()},onMouseLeave:Tt,children:[!N&&/* @__PURE__ */et(Ao,{marks:$e,innerRef:P}),
445
+ /* @__PURE__ */et(Fo,{axis:Ee,geo:ie,fillTo:wt,reveal:lt,trackPx:se,tweened:!!u}),oe&&
437
446
  /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${se}px`,width:le-se+"px",top:ie.rail+3-1+"px"}}),$t&&/* @__PURE__ */et("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:ie.rail-7+"px",height:"20px"}}),
438
- /* @__PURE__ */et(bo,{startMs:e,endMs:t,axis:Ee,geo:ie,reveal:lt}),
439
- /* @__PURE__ */et(wo,{geo:ie,caption:N?null:Me,endCaption:N?null:m?.end,around:Ie,reveal:lt,trackPx:le}),N&&/* @__PURE__ */et(ko,{nodes:He,geo:ie,reveal:lt}),null!==M&&M>e&&M<=t+Ai&&/* @__PURE__ */et(No,{x:Ee.xByMs(Math.min(M,t)),geo:ie,trackPx:le,label:S(M),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */et($o,{phase:e,geo:ie,xOf:Ee.xByMs},e.key)),
440
- /* @__PURE__ */et("ol",{className:"rosh-tl-nodes","aria-label":x,onKeyDown:Et,children:He.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${ie.rail+3}px`,a=lt?qi(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
441
- return et("li",{children:/* @__PURE__ */et("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===Zi,i=co(t?"default":e.kind,"key"),o=t?void 0:io[e.kind]?.glyph;/* @__PURE__ */
442
- return Qe("li",{...r(ye)?{"aria-current":"step"}:{},children:[
443
- /* @__PURE__ */Qe("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */et(Ui,{name:o}),t&&/* @__PURE__ */Qe("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Qe("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=co(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
444
- return et("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ */Qe("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */et(Ui,{name:s}),"current"===i.role&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */et(Co,{groups:Le,trackPx:le,geo:ie,startMs:e,endMs:t,currentKey:ye,hoveredKey:O,reveal:lt,step:it,zoomedKey:Ke,popId:Q,aimBubble:Lt,startCaptionPx:Ce,openCluster:q,setOpenCluster:H,previewCluster:U,setPreviewCluster:V,setZoomKey:G}):"active"===s?/* @__PURE__ */et(Mo,{nodes:He,trackPx:le,geo:ie,activeKey:c,hoveredKey:O,currentKey:ye}):null,Dt&&/* @__PURE__ */et("div",{ref:j,id:Z,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${ie.rail+6+6}px`},onMouseEnter:()=>{Bt(),Rt(Dt.key)},onMouseLeave:()=>{Tt(),Wt(Dt.key)},onFocus:()=>{Bt(),Rt(Dt.key)},onBlur:()=>{Tt(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */Qe(tt,{children:[
447
+ /* @__PURE__ */et(Po,{startMs:e,endMs:t,axis:Ee,geo:ie,reveal:lt}),
448
+ /* @__PURE__ */et(Eo,{geo:ie,caption:N?null:Me,endCaption:N?null:m?.end,around:Be,reveal:lt,trackPx:le}),N&&/* @__PURE__ */et(Bo,{nodes:He,geo:ie,reveal:lt}),null!==M&&M>e&&M<=t+qi&&/* @__PURE__ */et(Io,{x:Ee.xByMs(Math.min(M,t)),geo:ie,trackPx:le,label:S(M),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */et(To,{phase:e,geo:ie,xOf:Ee.xByMs},e.key)),
449
+ /* @__PURE__ */et("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Et,children:He.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${ie.rail+3}px`,a=lt?ao(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
450
+ return et("li",{children:/* @__PURE__ */et("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===mo,i=$o(t?"default":e.kind,"key"),o=t?void 0:wo[e.kind]?.glyph;/* @__PURE__ */
451
+ return Qe("li",{...r(xe)?{"aria-current":"step"}:{},children:[
452
+ /* @__PURE__ */Qe("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */et(io,{name:o}),t&&/* @__PURE__ */Qe("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Qe("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=$o(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
453
+ return et("li",{...i.key===xe?{"aria-current":"step"}:{},children:/* @__PURE__ */Qe("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */et(io,{name:s}),"current"===i.role&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */et(Ro,{groups:Le,trackPx:le,geo:ie,startMs:e,endMs:t,currentKey:xe,hoveredKey:O,reveal:lt,step:it,zoomedKey:Ke,popId:Q,aimBubble:Lt,startCaptionPx:Ce,openCluster:q,setOpenCluster:H,previewCluster:U,setPreviewCluster:V,setZoomKey:G}):"active"===s?/* @__PURE__ */et(Oo,{nodes:He,trackPx:le,geo:ie,activeKey:c,hoveredKey:O,currentKey:xe}):null,Dt&&/* @__PURE__ */et("div",{ref:j,id:J,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${ie.rail+6+6}px`},onMouseEnter:()=>{It(),Rt(Dt.key)},onMouseLeave:()=>{Tt(),Wt(Dt.key)},onFocus:()=>{It(),Rt(Dt.key)},onBlur:()=>{Tt(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */Qe(tt,{children:[
445
454
  /* @__PURE__ */et("span",{className:"rosh-tl-name",children:Dt.mark.label}),
446
455
  /* @__PURE__ */et("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */et("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */et("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */et("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:L.openButton})]}):
447
456
  /* @__PURE__ */Qe("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
@@ -450,31 +459,31 @@ return et("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ *
450
459
  /* @__PURE__ */Qe("p",{className:"rosh-tl-foldrow",children:[
451
460
  /* @__PURE__ */et("span",{children:e.label}),
452
461
  /* @__PURE__ */et("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */et("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */et("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
453
- /* @__PURE__ */et(Lo,{thumb:u,value:ct,snap:st,axis:Ee,geo:ie,startMs:e,endMs:t,trackPx:le,layerRef:A,glide:ht,onScrub:h?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ht(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */et(xo,{pending:l,reveal:lt})]})}function Ao({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */et("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
462
+ /* @__PURE__ */et(Wo,{thumb:u,value:ct,snap:st,axis:Ee,geo:ie,startMs:e,endMs:t,trackPx:le,layerRef:A,glide:ht,onScrub:h?yt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ht(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */et(jo,{pending:l,reveal:lt})]})}function qo({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */et("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
454
463
  return Qe("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
455
464
  /* @__PURE__ */Qe("div",{className:"rosh-tl-head",children:[
456
465
  /* @__PURE__ */Qe("div",{className:"rosh-tl-head-main text-gray-800",children:[e&&/* @__PURE__ */et("span",{className:"rosh-tl-ico","aria-hidden":"true",children:e}),
457
466
  /* @__PURE__ */et("h4",{className:"rosh-tl-title",children:t}),o.length>0&&/* @__PURE__ */et("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
458
- /* @__PURE__ */Qe(Ge,{children:[t>0&&/* @__PURE__ */et("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */et("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */et("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Po({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=ce(Date.now,null),h=[],m=[],p=be().timeline,g=fe();for(const e of n){const t=Pi(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Pi(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*Ai,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<Ai&&(x=b+Ai));const v=h.length>0?Math.max(0,Math.round((x-b)/Ai)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(ji(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=y&&/* @__PURE__ */et("div",{className:"select-none",children:/* @__PURE__ */et(So,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
459
- return et("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */et(Ao,{icon:/* @__PURE__ */et(Vi,{}),heading:t??e,subject:r,meta:N,children:L})})}var jo=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),zo=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Fo(e){if(e.order_qty<=0)return 0;let t=0;for(const r of zo)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Eo(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Fo(t),0)/t.length}function Bo(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=Oe(null),h=be().production;_e(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Oe(!1),g=Re(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};_e(()=>()=>f(),[]),_e(()=>{f()},[i]);const b=t.map(e=>Pi(e.date)).filter(e=>null!=e),x=ce(Date.now,null)??Math.max(0,...b,...c.map(e=>Pi(e.date)??0),Pi(r??null)??0,Pi(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=Pi(r??null)??y,N=Pi(n??null)??0,k=jo.has((a||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Pi(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+Ai];return k||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/Ai)),L=Pi(o??null)??v??w,D=Math.min(Math.max(d??L,w),M),S=t.find(e=>{const t=Pi(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=Pi(t[e].date);if(null!=r&&r>D){A=t[e];break}}const P=(()=>{if(S||!A||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),j=S??P,z=S?Pi(S.date):P?w:null,F=A?Pi(A.date):null,E=!!(j&&A&&null!=z&&null!=F&&D>z&&D<F);let B,I;if(E&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const n={};for(const e of A?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=Pi(j?.est_completion_date),i=Pi(A?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||A?.est_completion_date||null,B={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},I=j}else if(B=j??t[t.length-1]??null,B){const e=t.findIndex(e=>e.id===B.id);I=e>=0&&e<t.length-1?t[e+1]:null}else I=null;const T={};for(const e of I?.items??[])T[e.part_number]=e;const O=!(!i||B?.id===i),R=i?Math.min(Pi(o??null)??M,M):M,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:M,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:j,nextAfter:A,displayed:B,prevReport:I,prevByPN:T,isInterpolated:E,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*Ai,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Pi(n??null)}}function Io({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=be().production,x=fe(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),N=y.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
460
- return et("div",{className:"select-none",children:/* @__PURE__ */et(So,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${ji(e,x)}`:ji(e,x)}},ariaLabel:b.label(ji(e,x),ji(t,x))})})}function To({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[n,a]=Oe(!1),l=Re(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>Pi(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=be().production,D=fe(),S=i??L.heading,A=e=>ji(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?Eo(v):0,B=h.find(e=>e.id===k),I=B?s(B):$,T=
467
+ /* @__PURE__ */Qe(Ge,{children:[t>0&&/* @__PURE__ */et("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */et("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */et("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Ho({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=ce(Date.now,null),h=[],m=[],p=fe().timeline,g=be();for(const e of n){const t=Hi(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Hi(l??null);let b,y,x=!0;0===h.length?(y=f??u??0,b=y-30*qi,x=null!==f||null!==u):(b=h[0].ms,y=f??h[h.length-1].ms,y-b<qi&&(y=b+qi));const v=h.length>0?Math.max(0,Math.round((y-b)/qi)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(Ui(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=x&&/* @__PURE__ */et("div",{className:"select-none",children:/* @__PURE__ */et(_o,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:y,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
468
+ return et("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */et(qo,{icon:/* @__PURE__ */et(oo,{}),heading:t??e,subject:r,meta:N,children:L})})}var Uo=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Vo=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Yo(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Vo)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Go(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Yo(t),0)/t.length}function Xo(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=Oe(null),h=fe().production;_e(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Oe(!1),g=Re(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};_e(()=>()=>f(),[]),_e(()=>{f()},[i]);const b=t.map(e=>Hi(e.date)).filter(e=>null!=e),y=ce(Date.now,null)??Math.max(0,...b,...c.map(e=>Hi(e.date)??0),Hi(r??null)??0,Hi(n??null)??0),x=b.length?Math.min(...b):y,v=b.length?Math.max(...b):y,w=Hi(r??null)??x,N=Hi(n??null)??0,k=Uo.has((a||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Hi(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+qi];return k||e.push(y),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/qi)),L=Hi(o??null)??v??w,D=Math.min(Math.max(d??L,w),M),S=t.find(e=>{const t=Hi(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=Hi(t[e].date);if(null!=r&&r>D){A=t[e];break}}const P=(()=>{if(S||!A||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),j=S??P,z=S?Hi(S.date):P?w:null,F=A?Hi(A.date):null,E=!!(j&&A&&null!=z&&null!=F&&D>z&&D<F);let I,B;if(E&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const n={};for(const e of A?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=Hi(j?.est_completion_date),i=Hi(A?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||A?.est_completion_date||null,I={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},B=j}else if(I=j??t[t.length-1]??null,I){const e=t.findIndex(e=>e.id===I.id);B=e>=0&&e<t.length-1?t[e+1]:null}else B=null;const T={};for(const e of B?.items??[])T[e.part_number]=e;const O=!(!i||I?.id===i),R=i?Math.min(Hi(o??null)??M,M):M,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:M,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:j,nextAfter:A,displayed:I,prevReport:B,prevByPN:T,isInterpolated:E,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*qi,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Hi(n??null)}}function Zo({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=fe().production,y=be(),x=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=x.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:s?()=>s(e.id):void 0})),w=new Map(x.map(({report:e,ms:t})=>[e.id,t])),N=x.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
469
+ return et("div",{className:"select-none",children:/* @__PURE__ */et(_o,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>x.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Ui(e,y)}`:Ui(e,y)}},ariaLabel:b.label(Ui(e,y),Ui(t,y))})})}function Jo({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:y,setScrubMs:x,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[n,a]=Oe(!1),l=Re(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>Hi(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),x,u),L=fe().production,D=be(),S=i??L.heading,A=e=>Ui(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?Go(v):0,I=h.find(e=>e.id===k),B=I?s(I):$,T=
461
470
  /* @__PURE__ */Qe("button",{type:"button",onClick:C.toggle,"aria-pressed":C.playing,title:C.playing?L.pause:L.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[C.playing?/* @__PURE__ */et(ue,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */et(ue,{name:"play","aria-hidden":"true"}),
462
- /* @__PURE__ */et("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??I)?/* @__PURE__ */et("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(I))}):null,[R,W]=ve(L.showing),K=e=>/* @__PURE__ */et("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */Qe(tt,{children:[e&&R,
471
+ /* @__PURE__ */et("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??B)?/* @__PURE__ */et("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(B))}):null,[R,W]=ve(L.showing),K=e=>/* @__PURE__ */et("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */Qe(tt,{children:[e&&R,
463
472
  /* @__PURE__ */et("b",{className:"font-medium",children:s(v)}),e&&W,
464
473
  /* @__PURE__ */Qe("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",L.overall(Math.round(E))," · ",L.inStock(F)]})]}):/* @__PURE__ */et("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=M&&M>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:A(M)}:null;/* @__PURE__ */
465
474
  return Qe("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
466
- /* @__PURE__ */et(Io,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
475
+ /* @__PURE__ */et(Zo,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}}),
467
476
  /* @__PURE__ */Qe("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[T,O,K(!1)]})]})}/* @__PURE__ */
468
- return et("div",{className:"shrink-0",children:/* @__PURE__ */et(Ao,{icon:/* @__PURE__ */et(Yi,{}),heading:S,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */Qe(tt,{children:[O,T]}),footer:/* @__PURE__ */Qe(tt,{children:[K(!0),
477
+ return et("div",{className:"shrink-0",children:/* @__PURE__ */et(qo,{icon:/* @__PURE__ */et(so,{}),heading:S,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */Qe(tt,{children:[O,T]}),footer:/* @__PURE__ */Qe(tt,{children:[K(!0),
469
478
  /* @__PURE__ */Qe("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
470
479
  /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
471
- /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(Ui,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
472
- /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(Ui,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
473
- /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(Ui,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */et(Io,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var Oo=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Ro({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=be().containers,m=s?e.filter(s):e,p=e=>Oo(i(e)),g=e=>Oo(o(e)),f=m.some(e=>null!=o(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+Oo(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+Oo(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,$=r??(e=>k(e)*p(e)),M=n??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+$(t),0),L=m.reduce((e,t)=>e+M(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,S=D<=34.65?"20ft":"40ft",A="20ft"===S?33:67,P=D>0?Math.max(1,Math.ceil(D/A)):0,j=P*A,z=D>0&&D>=.95*j&&D<=1.1*j;if(0===m.length)return null;const F=(e,t)=>A>0?Math.max(0,Math.min((e-t*A)/A*100,100)):0;/* @__PURE__ */
480
+ /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(io,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
481
+ /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(io,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */Qe("span",{className:"border-gray-200 text-gray-500",children:[
482
+ /* @__PURE__ */et("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */et(io,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */et(Zo,{startMs:g,endMs:f,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}})})})}var Qo=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function es({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=fe().containers,m=s?e.filter(s):e,p=e=>Qo(i(e)),g=e=>Qo(o(e)),f=m.some(e=>null!=o(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,y=m.reduce((e,t)=>e+Qo(b(t)),0),x=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+Qo(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,$=r??(e=>k(e)*p(e)),M=n??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+$(t),0),L=m.reduce((e,t)=>e+M(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,S=D<=34.65?"20ft":"40ft",A="20ft"===S?33:67,P=D>0?Math.max(1,Math.ceil(D/A)):0,j=P*A,z=D>0&&D>=.95*j&&D<=1.1*j;if(0===m.length)return null;const F=(e,t)=>A>0?Math.max(0,Math.min((e-t*A)/A*100,100)):0;/* @__PURE__ */
474
483
  return Qe("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
475
484
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
476
- /* @__PURE__ */Qe("span",{children:[`${h.items(m.length)} · ${h.pieces(x)}`,f&&w!==N&&/* @__PURE__ */et("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&y>0&&/* @__PURE__ */Qe("span",{className:"flex items-center gap-1 text-green-600",children:[
477
- /* @__PURE__ */et("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */Qe("div",{className:"space-y-2",children:[Array.from({length:P}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
485
+ /* @__PURE__ */Qe("span",{children:[`${h.items(m.length)} · ${h.pieces(y)}`,f&&w!==N&&/* @__PURE__ */et("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&x>0&&/* @__PURE__ */Qe("span",{className:"flex items-center gap-1 text-green-600",children:[
486
+ /* @__PURE__ */et("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),D>0?/* @__PURE__ */Qe("div",{className:"space-y-2",children:[Array.from({length:P}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
478
487
  return Qe("div",{className:"flex items-center gap-2",children:[
479
488
  /* @__PURE__ */et("span",{className:"text-2xs text-gray-400 w-8 shrink-0",children:S}),
480
489
  /* @__PURE__ */Qe("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
@@ -487,27 +496,27 @@ return Qe("div",{className:"flex items-center gap-2",children:[
487
496
  /* @__PURE__ */et("span",{className:"text-gray-400",children:"/"}),
488
497
  /* @__PURE__ */Qe("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
489
498
  /* @__PURE__ */et("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */et("b",{className:"text-gray-700",children:h.volume(D)})]}),
490
- /* @__PURE__ */Qe("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",P," × ",S]})]})]}):/* @__PURE__ */et("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Wo=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,Ko=e=>b(e.trim());function _o(e){const t=[];let r,n=0,a=0;for(Wo.lastIndex=0;null!==(r=Wo.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
499
+ /* @__PURE__ */Qe("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",P," × ",S]})]})]}):/* @__PURE__ */et("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var ts=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,rs=e=>b(e.trim());function ns(e){const t=[];let r,n=0,a=0;for(ts.lastIndex=0;null!==(r=ts.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
491
500
  /* @__PURE__ */Qe("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
492
- /* @__PURE__ */et("a",{href:Ko(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
501
+ /* @__PURE__ */et("a",{href:rs(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
493
502
  /* @__PURE__ */et("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
494
- /* @__PURE__ */et("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */et("em",{children:r[7]},a++)),n=Wo.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function qo({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=be().markdown;/* @__PURE__ */
503
+ /* @__PURE__ */et("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */et("em",{children:r[7]},a++)),n=ts.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function as({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=fe().markdown;/* @__PURE__ */
495
504
  return Qe("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-3 text-gray-500",children:[
496
505
  /* @__PURE__ */et(ue,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),
497
506
  /* @__PURE__ */Qe("span",{className:"text-xs",children:[
498
- /* @__PURE__ */et("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function Ho(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var Uo=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function Vo(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
499
- return et(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:_o(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
500
- return et("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=Uo(e[0]),n=e.slice(2).map(Uo);/* @__PURE__ */
507
+ /* @__PURE__ */et("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function ls(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var is=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function os(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
508
+ return et(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:ns(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
509
+ return et("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=is(e[0]),n=e.slice(2).map(is);/* @__PURE__ */
501
510
  return et("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */Qe("table",{className:"w-full border-collapse text-sm",children:[
502
- /* @__PURE__ */et("thead",{children:/* @__PURE__ */et("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */et("th",{className:"border-b border-gray-200 px-3 py-2 text-left font-semibold text-gray-700",children:_o(e)},t))})}),
503
- /* @__PURE__ */et("tbody",{children:n.map((e,t)=>/* @__PURE__ */et("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */et("td",{className:"border-t border-gray-100 px-3 h-8 align-top text-gray-700",children:_o(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
504
- return et("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:_o(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
505
- return et(qo,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=Ho(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
506
- return et("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */et("li",{children:_o(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=Ho(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
507
- return et("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */et("li",{className:"pl-1",children:_o(e)},t))},t)}/* @__PURE__ */
508
- return et("p",{children:_o(r.join(" "))},t)}var Yo=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function Go(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=Yo.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,o,s]=l,c=[];for(e+=1;e<t.length;e+=1){const r=Yo.exec(t[e]);if(null!==r&&r[2][0]===o[0]&&r[2].length>=o.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:s.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function Xo({children:e,className:t}){/* @__PURE__ */
509
- return et("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:Go(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
510
- return et("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */et("code",{children:t})},r)}(e.fence,t):Vo(e.text,t))})}var Jo=({open:e})=>/* @__PURE__ */et(ue,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function Zo({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:l,onEdit:i,renderBody:o,emptyMessage:s}){const c=be(),[d,u]=Oe(""),[h,m]=Oe(null),[p,g]=Oe({}),f=d.trim().toLowerCase(),b=Ke(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),x=e=>!f||e.title.toLowerCase().includes(f)||e.body.toLowerCase().includes(f)||e.category_label.toLowerCase().includes(f),y=Ke(()=>b.map(e=>({...e,docs:e.docs.filter(x)})).filter(e=>e.docs.length>0),[b,f]),v=Ke(()=>y.flatMap(e=>e.docs),[y]),w=(h?v.find(e=>e.slug===h):void 0)??v[0]??null,N=e=>!!f||(p[e]??e===w?.category);/* @__PURE__ */
511
+ /* @__PURE__ */et("thead",{children:/* @__PURE__ */et("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */et("th",{className:"border-b border-gray-200 px-3 py-2 text-left font-semibold text-gray-700",children:ns(e)},t))})}),
512
+ /* @__PURE__ */et("tbody",{children:n.map((e,t)=>/* @__PURE__ */et("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */et("td",{className:"border-t border-gray-100 px-3 h-8 align-top text-gray-700",children:ns(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
513
+ return et("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:ns(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
514
+ return et(as,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=ls(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
515
+ return et("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */et("li",{children:ns(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=ls(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
516
+ return et("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */et("li",{className:"pl-1",children:ns(e)},t))},t)}/* @__PURE__ */
517
+ return et("p",{children:ns(r.join(" "))},t)}var ss=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function cs(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=ss.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,o,s]=l,c=[];for(e+=1;e<t.length;e+=1){const r=ss.exec(t[e]);if(null!==r&&r[2][0]===o[0]&&r[2].length>=o.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:s.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function ds({children:e,className:t}){/* @__PURE__ */
518
+ return et("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:cs(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
519
+ return et("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */et("code",{children:t})},r)}(e.fence,t):os(e.text,t))})}var us=({open:e})=>/* @__PURE__ */et(ue,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function hs({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:l,onEdit:i,renderBody:o,emptyMessage:s}){const c=fe(),[d,u]=Oe(""),[h,m]=Oe(null),[p,g]=Oe({}),f=d.trim().toLowerCase(),b=Ke(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),y=e=>!f||e.title.toLowerCase().includes(f)||e.body.toLowerCase().includes(f)||e.category_label.toLowerCase().includes(f),x=Ke(()=>b.map(e=>({...e,docs:e.docs.filter(y)})).filter(e=>e.docs.length>0),[b,f]),v=Ke(()=>x.flatMap(e=>e.docs),[x]),w=(h?v.find(e=>e.slug===h):void 0)??v[0]??null,N=e=>!!f||(p[e]??e===w?.category);/* @__PURE__ */
511
520
  return Qe("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
512
521
  /* @__PURE__ */Qe("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
513
522
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -515,10 +524,10 @@ return Qe("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
515
524
  /* @__PURE__ */et("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */Qe("div",{className:"relative",children:[
516
525
  /* @__PURE__ */et(ue,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${a}`,"aria-hidden":"true"}),
517
526
  /* @__PURE__ */et("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:c.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
518
- /* @__PURE__ */et("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */et(Be,{size:"sm",padding:"py-6",label:c.help.loading}):0===y.length?/* @__PURE__ */et("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:f?c.help.noResults:s??c.help.empty}):y.map(e=>{const t=N(e.key);/* @__PURE__ */
527
+ /* @__PURE__ */et("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */et(Ie,{size:"sm",padding:"py-6",label:c.help.loading}):0===x.length?/* @__PURE__ */et("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:f?c.help.noResults:s??c.help.empty}):x.map(e=>{const t=N(e.key);/* @__PURE__ */
519
528
  return Qe("div",{className:"py-0.5",children:[
520
529
  /* @__PURE__ */Qe("button",{type:"button",onClick:()=>{return t=e.key,g(e=>({...e,[t]:!N(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
521
- /* @__PURE__ */et(Jo,{open:t}),
530
+ /* @__PURE__ */et(us,{open:t}),
522
531
  /* @__PURE__ */et("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=w?.slug===e.slug;/* @__PURE__ */
523
532
  return Qe("button",{type:"button",onClick:()=>m(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
524
533
  /* @__PURE__ */et("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */et("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:c.help.draft})]},e.slug)})]},e.key)})})]}),
@@ -527,66 +536,66 @@ return Qe("button",{type:"button",onClick:()=>m(e.slug),className:"w-full text-l
527
536
  /* @__PURE__ */Qe("div",{className:"min-w-0",children:[
528
537
  /* @__PURE__ */et("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:w.title}),
529
538
  /* @__PURE__ */Qe("p",{className:"text-xs text-gray-500 mt-0.5",children:[w.category_label,!1===w.is_published&&/* @__PURE__ */Qe("span",{className:"ml-2 text-amber-600",children:["· ",c.help.draft]})]})]}),n&&i&&/* @__PURE__ */et("button",{type:"button",onClick:()=>i(w),className:"shrink-0 text-sm text-blue-600 hover:underline",children:c.help.edit})]}),
530
- /* @__PURE__ */et("div",{className:"flex-1 overflow-auto px-5 py-4",children:o?o(w):w.body?/* @__PURE__ */et(Xo,{children:w.body}):/* @__PURE__ */et("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */et("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */et(Be,{size:"sm",padding:"",label:c.help.loading}):/* @__PURE__ */et("p",{className:"text-sm text-gray-500",children:c.help.pickArticle})})})]})}var Qo={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function es({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=v(n??"");/* @__PURE__ */
531
- return Qe("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${Qo[r]} ${o}`,children:[e,n&&/* @__PURE__ */et("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:s})]})}function ts(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function rs({children:e,count:t}){return null==t?/* @__PURE__ */et("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */Qe("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
539
+ /* @__PURE__ */et("div",{className:"flex-1 overflow-auto px-5 py-4",children:o?o(w):w.body?/* @__PURE__ */et(ds,{children:w.body}):/* @__PURE__ */et("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */et("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */et(Ie,{size:"sm",padding:"",label:c.help.loading}):/* @__PURE__ */et("p",{className:"text-sm text-gray-500",children:c.help.pickArticle})})})]})}var ms={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function ps({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=v(n??"");/* @__PURE__ */
540
+ return Qe("button",{type:l,onClick:t,disabled:a,title:i,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${ms[r]} ${o}`,children:[e,n&&/* @__PURE__ */et("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:s})]})}function gs(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function fs({children:e,count:t}){return null==t?/* @__PURE__ */et("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */Qe("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
532
541
  /* @__PURE__ */et("span",{className:"min-w-0 truncate",children:e}),
533
- /* @__PURE__ */et("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function ns(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function as({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Ni(i,"SidebarNavItem"),c=be().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */Qe(tt,{children:[null!=a&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:a}),s&&
542
+ /* @__PURE__ */et("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function bs(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function ys({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Ii(i,"SidebarNavItem"),c=fe().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */Qe(tt,{children:[null!=a&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:a}),s&&
534
543
  /* @__PURE__ */et("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
535
- /* @__PURE__ */et("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */et("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */et("span",{className:ts(r),children:t}),null!=l&&/* @__PURE__ */et("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
536
- return et("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */et("span",{className:ns(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function ls({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=We(),[i,o]=de(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),s=!i&&He.toArray(r).some(e=>Ue(e)&&!0===e.props.active);/* @__PURE__ */
544
+ /* @__PURE__ */et("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */et("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */et("span",{className:gs(r),children:t}),null!=l&&/* @__PURE__ */et("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
545
+ return et("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */et("span",{className:bs(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function xs({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=We(),[i,o]=de(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),s=!i&&He.toArray(r).some(e=>Ue(e)&&!0===e.props.active);/* @__PURE__ */
537
546
  return Qe("div",{children:[
538
547
  /* @__PURE__ */Qe("button",{type:"button",onClick:()=>{const e=!i;if(o(e),a)try{window.localStorage.setItem(a,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
539
548
  /* @__PURE__ */et("span",{className:"min-w-0 truncate",title:e,children:e}),
540
- /* @__PURE__ */et(ue,{name:"chevron-down",className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),strokeWidth:2.6,"aria-hidden":"true"}),null!=t&&t>0&&/* @__PURE__ */et("span",{className:ts(s),children:t})]}),
541
- /* @__PURE__ */et("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function is({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
549
+ /* @__PURE__ */et(ue,{name:"chevron-down",className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),strokeWidth:2.6,"aria-hidden":"true"}),null!=t&&t>0&&/* @__PURE__ */et("span",{className:gs(s),children:t})]}),
550
+ /* @__PURE__ */et("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function vs({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
542
551
  return Qe("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */et("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
543
552
  /* @__PURE__ */et("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
544
553
  return Qe("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */et("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
545
- /* @__PURE__ */et("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */et("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */et("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */et("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var os=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function ss({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=se(),s=Re(null),c=Re(e);c.current=e;const d=Re(t);d.current=t;const u=Te(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??os)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*H)}px`;const i=K({trigger:t,menu:{width:e.offsetWidth,height:e.offsetHeight},bounds:a,align:n,side:r});l.left=`${i.left}px`,l.top=`${i.top}px`,e.dataset.side=i.side},[n,r]);ie(()=>{o&&u()}),_e(()=>{if(!o)return;const e=X(()=>c.current(),u),t=s.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>u());return r.observe(t),()=>{e(),r.disconnect()}},[o,u]);return o&&e()?rt(
546
- /* @__PURE__ */et("div",{ref:s,role:"group","aria-label":a,"data-floating-bar":"",onMouseDown:e=>{const t=e.target;t?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||e.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${i}`.trim(),style:{...ee(),position:"fixed",left:0,top:0,zIndex:ne.popup},children:l}),document.body):null}function cs(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function ds({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Re(null),[c,d]=Oe(null),u=Re(t);u.current=t,ie(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=J({point:e,menu:r,bounds:_(n??null)});d(e=>e&&e.left===a.left&&e.top===a.top&&e.maxHeight===a.maxHeight?e:{left:a.left,top:a.top,maxHeight:a.maxHeight,scroll:r.height>a.maxHeight})},[e.x,e.y,n]);const h=Re(null),m=Re(!1);_e(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),_e(()=>{c&&!m.current&&o&&(m.current=!0,cs(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),_e(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=cs(s.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),_e(()=>te(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),_e(()=>{const e=()=>u.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const p=Te(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=cs(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
547
- return et(S,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */et(E.Provider,{value:!0,children:/* @__PURE__ */et("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function us(){const[e,t]=Oe(null),r=Te(()=>t(null),[]),n=Te((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(B(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=Te(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var hs="Alt+ArrowUp Alt+ArrowDown";function ms(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var ps=/* @__PURE__ */Qe("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
554
+ /* @__PURE__ */et("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */et("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */et("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */et("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var ws=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function Ns({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=se(),s=Re(null),c=Re(e);c.current=e;const d=Re(t);d.current=t;const u=Te(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??ws)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*H)}px`;const i=K({trigger:t,menu:{width:e.offsetWidth,height:e.offsetHeight},bounds:a,align:n,side:r});l.left=`${i.left}px`,l.top=`${i.top}px`,e.dataset.side=i.side},[n,r]);ie(()=>{o&&u()}),_e(()=>{if(!o)return;const e=X(()=>c.current(),u),t=s.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>u());return r.observe(t),()=>{e(),r.disconnect()}},[o,u]);return o&&e()?rt(
555
+ /* @__PURE__ */et("div",{ref:s,role:"group","aria-label":a,"data-floating-bar":"",onMouseDown:e=>{const t=e.target;t?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||e.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${i}`.trim(),style:{...ee(),position:"fixed",left:0,top:0,zIndex:ne.popup},children:l}),document.body):null}function ks(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function $s({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Re(null),[c,d]=Oe(null),u=Re(t);u.current=t,ie(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=Z({point:e,menu:r,bounds:_(n??null)});d(e=>e&&e.left===a.left&&e.top===a.top&&e.maxHeight===a.maxHeight?e:{left:a.left,top:a.top,maxHeight:a.maxHeight,scroll:r.height>a.maxHeight})},[e.x,e.y,n]);const h=Re(null),m=Re(!1);_e(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),_e(()=>{c&&!m.current&&o&&(m.current=!0,ks(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),_e(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=ks(s.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o]),_e(()=>te(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),_e(()=>{const e=()=>u.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const p=Te(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=ks(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
556
+ return et(S,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */et(E.Provider,{value:!0,children:/* @__PURE__ */et("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Ms(){const[e,t]=Oe(null),r=Te(()=>t(null),[]),n=Te((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(I(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=Te(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var Cs="Alt+ArrowUp Alt+ArrowDown";function Ls(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var Ds=/* @__PURE__ */Qe("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
548
557
  /* @__PURE__ */et("circle",{cx:"2",cy:"3",r:"1.1"}),
549
558
  /* @__PURE__ */et("circle",{cx:"2",cy:"7",r:"1.1"}),
550
- /* @__PURE__ */et("circle",{cx:"2",cy:"11",r:"1.1"})]});function gs({hint:e,dragging:t,revealClassName:r,marker:n}){const a=be().tree;/* @__PURE__ */
551
- return et(O,{content:e??a.dragHint,side:"left",delay:700,className:"absolute inset-y-0 left-0 inline-flex transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */et("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-full w-2 items-center justify-center text-[color:var(--ink-faintest)]",children:ps})})}function fs({id:e}){/* @__PURE__ */
552
- return et("span",{id:e,hidden:!0,children:be().tree.moveHint})}var bs='[role="treeitem"]';function xs(e){return[...e.querySelectorAll(bs)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function ys({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Re(null);ie(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(bs)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??xs(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Te(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(bs);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=xs(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(bs))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
553
- return et("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function vs({children:e,hidden:t,className:r=""}){/* @__PURE__ */
554
- return et("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var ws=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal","bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600"].join(" ");function Ns({children:e,count:r,expanded:n,onToggle:a}){const l=void 0!==n,i=
555
- /* @__PURE__ */et("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */et(t,{children:e})}),o=null!=r&&!1!==r&&/* @__PURE__ */et("span",{"data-tree-count":"",className:ws,children:r}),s="text-xs font-semibold uppercase tracking-wide text-gray-500";return l?/* @__PURE__ */et("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */Qe("button",{type:"button","aria-expanded":n,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",s].join(" "),children:[
556
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:ks(!!n)}),i,o]})}):/* @__PURE__ */Qe("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${s}`,children:[
557
- /* @__PURE__ */et("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,o]})}var ks=e=>/* @__PURE__ */et(ue,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),$s={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Ms({label:e,level:r=1,icon:n,preview:a,selected:l=!1,expanded:i,onToggle:o,onSelect:s,muted:c=!1,badge:d,actions:u,actionsPinned:h=!1,actionsOverlay:m=!0,rename:p,drop:g,dragging:f=!1,draggable:b=!1,dragHint:x,onMove:y,rowProps:v,className:w=""}){const N=void 0!==i,k=We(),$=[v?.["aria-describedby"],y?k:void 0].filter(Boolean).join(" ")||void 0,M=l?"bg-blue-50 text-blue-700":"into"===g?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
558
- return Qe("div",{...v,role:"treeitem","aria-level":r,"aria-selected":l,"aria-expanded":N?i:void 0,tabIndex:l?0:-1,"aria-keyshortcuts":v?.["aria-keyshortcuts"]??(y?hs:void 0),"aria-describedby":$,"data-drop":g,"data-draggable":b||void 0,onKeyDown:e=>{if(v?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=ms(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&N&&!i&&o||"ArrowLeft"===e.key&&N&&i&&o)&&(e.preventDefault(),o()):(e.preventDefault(),s())},onClick:e=>{v?.onClick?.(e),e.defaultPrevented||s?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",b?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",M,"into"===g?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",f?"opacity-40":"",w].filter(Boolean).join(" "),children:["before"===g&&/* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===g&&/* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),b&&
559
- /* @__PURE__ */et(gs,{marker:"tree",hint:x,dragging:f,revealClassName:"group-hover/treerow:opacity-100"}),
560
- /* @__PURE__ */et("span",N?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),o?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:ks(!!i)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=n&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(c?"text-gray-400":""),children:n}),
559
+ /* @__PURE__ */et("circle",{cx:"2",cy:"11",r:"1.1"})]});function Ss({hint:e,dragging:t,revealClassName:r,marker:n}){const a=fe().tree;/* @__PURE__ */
560
+ return et(O,{content:e??a.dragHint,side:"left",delay:700,className:"absolute inset-y-0 left-0 inline-flex transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */et("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-full w-2 items-center justify-center text-[color:var(--ink-faintest)]",children:Ds})})}function As({id:e}){/* @__PURE__ */
561
+ return et("span",{id:e,hidden:!0,children:fe().tree.moveHint})}var Ps='[role="treeitem"]';function js(e){return[...e.querySelectorAll(Ps)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function zs({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Re(null);ie(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Ps)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??js(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Te(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Ps);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=js(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(Ps))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
562
+ return et("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function Fs({children:e,hidden:t,className:r=""}){/* @__PURE__ */
563
+ return et("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var Es=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal","bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600"].join(" ");function Is({children:e,count:r,expanded:n,onToggle:a}){const l=void 0!==n,i=
564
+ /* @__PURE__ */et("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */et(t,{children:e})}),o=null!=r&&!1!==r&&/* @__PURE__ */et("span",{"data-tree-count":"",className:Es,children:r}),s="text-xs font-semibold uppercase tracking-wide text-gray-500";return l?/* @__PURE__ */et("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */Qe("button",{type:"button","aria-expanded":n,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",s].join(" "),children:[
565
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:Bs(!!n)}),i,o]})}):/* @__PURE__ */Qe("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${s}`,children:[
566
+ /* @__PURE__ */et("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,o]})}var Bs=e=>/* @__PURE__ */et(ue,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),Ts={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Os({label:e,level:r=1,icon:n,preview:a,selected:l=!1,expanded:i,onToggle:o,onSelect:s,muted:c=!1,badge:d,actions:u,actionsPinned:h=!1,actionsOverlay:m=!0,rename:p,drop:g,dragging:f=!1,draggable:b=!1,dragHint:y,onMove:x,rowProps:v,className:w=""}){const N=void 0!==i,k=We(),$=[v?.["aria-describedby"],x?k:void 0].filter(Boolean).join(" ")||void 0,M=l?"bg-blue-50 text-blue-700":"into"===g?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
567
+ return Qe("div",{...v,role:"treeitem","aria-level":r,"aria-selected":l,"aria-expanded":N?i:void 0,tabIndex:l?0:-1,"aria-keyshortcuts":v?.["aria-keyshortcuts"]??(x?Cs:void 0),"aria-describedby":$,"data-drop":g,"data-draggable":b||void 0,onKeyDown:e=>{if(v?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=Ls(e);t&&x?(e.preventDefault(),x(t)):"Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&N&&!i&&o||"ArrowLeft"===e.key&&N&&i&&o)&&(e.preventDefault(),o()):(e.preventDefault(),s())},onClick:e=>{v?.onClick?.(e),e.defaultPrevented||s?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",b?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",M,"into"===g?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",f?"opacity-40":"",w].filter(Boolean).join(" "),children:["before"===g&&/* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===g&&/* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),b&&
568
+ /* @__PURE__ */et(Ss,{marker:"tree",hint:y,dragging:f,revealClassName:"group-hover/treerow:opacity-100"}),
569
+ /* @__PURE__ */et("span",N?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),o?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:Bs(!!i)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=n&&/* @__PURE__ */et("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(c?"text-gray-400":""),children:n}),
561
570
  /* @__PURE__ */Qe("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[p??
562
- /* @__PURE__ */et("span",{className:`flex min-w-0 ${l?"font-semibold":"font-medium"} ${c?"text-gray-400 line-through":""}`,children:/* @__PURE__ */Qe(t,{children:[e,null!=a&&/* @__PURE__ */et("span",{className:"ml-2 font-normal text-gray-500",children:a})]})}),null!=d&&!1!==d&&/* @__PURE__ */et("span",{"data-tree-count":"",className:ws,children:d}),null!=u&&!m&&/* @__PURE__ */et("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(h||c?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:u})]}),null!=u&&m&&
563
- /* @__PURE__ */Qe("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:$s,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(h||c||l?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
571
+ /* @__PURE__ */et("span",{className:`flex min-w-0 ${l?"font-semibold":"font-medium"} ${c?"text-gray-400 line-through":""}`,children:/* @__PURE__ */Qe(t,{children:[e,null!=a&&/* @__PURE__ */et("span",{className:"ml-2 font-normal text-gray-500",children:a})]})}),null!=d&&!1!==d&&/* @__PURE__ */et("span",{"data-tree-count":"",className:Es,children:d}),null!=u&&!m&&/* @__PURE__ */et("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(h||c?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:u})]}),null!=u&&m&&
572
+ /* @__PURE__ */Qe("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Ts,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(h||c||l?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
564
573
  /* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
565
574
  /* @__PURE__ */et("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
566
- /* @__PURE__ */et("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:u})]}),y&&/* @__PURE__ */et(fs,{id:k})]})}function Cs({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=be().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
575
+ /* @__PURE__ */et("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:u})]}),x&&/* @__PURE__ */et(As,{id:k})]})}function Rs({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=fe().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
567
576
  return et("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */Qe("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
568
- /* @__PURE__ */et("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */et("span",{className:i,children:l})})}function Ls({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=be().tree,l=t??a.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
577
+ /* @__PURE__ */et("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */et("span",{className:i,children:l})})}function Ws({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=fe().tree,l=t??a.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
569
578
  return Qe("div",{...n,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${n?.className??""}`.trim(),children:[
570
579
  /* @__PURE__ */et("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
571
- /* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */et(O,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */et("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */et(ue,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var Ds=qe("compact");function Ss({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
572
- return et(Ds.Provider,{value:n,children:/* @__PURE__ */et("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function As({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=Ye(Ds),p=Re(null),g=We(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;ie(()=>{const e=p.current;if(!e||void 0!==b)return;const t=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(t=>t!==e);c&&!t?e.tabIndex=0:e.removeAttribute("tabindex")});/* @__PURE__ */
580
+ /* @__PURE__ */et("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */et(O,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */et("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */et(ue,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var Ks=qe("compact");function _s({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
581
+ return et(Ks.Provider,{value:n,children:/* @__PURE__ */et("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function qs({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=Ye(Ks),p=Re(null),g=We(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;ie(()=>{const e=p.current;if(!e||void 0!==b)return;const t=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(t=>t!==e);c&&!t?e.tabIndex=0:e.removeAttribute("tabindex")});/* @__PURE__ */
573
582
  return Qe("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */et("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${("comfortable"===m?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"})[s]}`}),
574
- /* @__PURE__ */Qe("div",{...d,ref:e=>{var t,r;p.current=e,r=e,"function"==typeof(t=u)?t(r):t&&(t.current=r)},"data-list-row":"","data-active":n||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?hs:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=ms(e);t&&!e.target.closest?.("select")&&(e.preventDefault(),c(t))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md pl-3 text-sm",l?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=t&&!1!==t?"":"pr-2",n?"bg-gray-100":a?"":"hover:bg-gray-100",o?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */et(gs,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
575
- /* @__PURE__ */et("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */et("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */et(fs,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */et("div",{"data-list-below":"",children:r})]})}var Ps=qe({labels:"none",shown:"none"}),js="button[data-icon-rail-button]:not([disabled])";function zs(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function Fs({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=Re(null),s="none"!==a&&l,[c,d]=Oe(null),u="none"===a?"none":s?c??"none":"all",h=Re(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,...zs(e,t,r.length)}))},ie(()=>{h.current()}),_e(()=>{const e=o.current?.parentElement;if(!s||!e)return;let t=!0;const r=()=>{t&&h.current()},n="undefined"==typeof ResizeObserver?void 0:ResizeObserver,a=n?new n(r):null;return a?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,a?.disconnect()}},[s]);const m=Re(null),p=Re(i);p.current=i,_e(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),ie(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(js)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
576
- return et("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(js)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */et(Ps.Provider,{value:{labels:a,shown:u},children:r})})}function Es({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const s=!0===r,{labels:c,shown:d}=Ye(Ps),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */et(ql,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&s),p=/* @__PURE__ */et("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */Qe(tt,{children:[
583
+ /* @__PURE__ */Qe("div",{...d,ref:e=>{var t,r;p.current=e,r=e,"function"==typeof(t=u)?t(r):t&&(t.current=r)},"data-list-row":"","data-active":n||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?Cs:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=Ls(e);t&&!e.target.closest?.("select")&&(e.preventDefault(),c(t))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md pl-3 text-sm",l?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=t&&!1!==t?"":"pr-2",n?"bg-gray-100":a?"":"hover:bg-gray-100",o?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */et(Ss,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
584
+ /* @__PURE__ */et("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:e}),null!=t&&!1!==t&&/* @__PURE__ */et("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */et(As,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */et("div",{"data-list-below":"",children:r})]})}var Hs=qe({labels:"none",shown:"none"}),Us="button[data-icon-rail-button]:not([disabled])";function Vs(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function Ys({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=Re(null),s="none"!==a&&l,[c,d]=Oe(null),u="none"===a?"none":s?c??"none":"all",h=Re(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,...Vs(e,t,r.length)}))},ie(()=>{h.current()}),_e(()=>{const e=o.current?.parentElement;if(!s||!e)return;let t=!0;const r=()=>{t&&h.current()},n="undefined"==typeof ResizeObserver?void 0:ResizeObserver,a=n?new n(r):null;return a?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,a?.disconnect()}},[s]);const m=Re(null),p=Re(i);p.current=i,_e(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),ie(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(Us)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
585
+ return et("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(Us)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */et(Hs.Provider,{value:{labels:a,shown:u},children:r})})}function Gs({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const s=!0===r,{labels:c,shown:d}=Ye(Hs),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */et(ai,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&s),p=/* @__PURE__ */et("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */Qe(tt,{children:[
577
586
  /* @__PURE__ */et("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
578
587
  /* @__PURE__ */et("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
579
- return et(O,{content:e,side:i,children:p})}var Bs=6e4;function Is({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Oe(null);return _e(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),o=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&o&&o!==e&&a(o)}catch{}};i();const o=setInterval(()=>{i()},r),s=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",s),()=>{l=!0,clearInterval(o),document.removeEventListener("visibilitychange",s)}},[e,t,r,n]),n}function Ts({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Is({currentVersion:e,versionUrl:t,pollMs:r}),o=be();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
580
- return et("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Qe(ri,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */et(T,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
588
+ return et(O,{content:e,side:i,children:p})}var Xs=6e4;function Zs({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Oe(null);return _e(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),o=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&o&&o!==e&&a(o)}catch{}};i();const o=setInterval(()=>{i()},r),s=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",s),()=>{l=!0,clearInterval(o),document.removeEventListener("visibilitychange",s)}},[e,t,r,n]),n}function Js({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Zs({currentVersion:e,versionUrl:t,pollMs:r}),o=fe();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
589
+ return et("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Qe(fi,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */et(T,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
581
590
  /* @__PURE__ */et("span",{className:"font-medium",children:n??o.update.available}),
582
- /* @__PURE__ */Qe("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Os={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Rs={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Ws({onClose:e}){const t=be().dialog;/* @__PURE__ */
583
- return et("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function Ks({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=Re(null),g=We(),f=We(),b=We();if(I(e),M(p,e,c),C(e),_e(()=>{if(e)return te(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
591
+ /* @__PURE__ */Qe("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Qs={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},ec={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function tc({onClose:e}){const t=fe().dialog;/* @__PURE__ */
592
+ return et("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */et(ue,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function rc({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=Re(null),g=We(),f=We(),b=We();if(B(e),M(p,e,c),C(e),_e(()=>{if(e)return te(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const y="bottom"===r,x=y?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
584
593
  return Qe("div",{className:"fixed inset-0",style:{zIndex:ne.overlay},role:"presentation",children:[
585
594
  /* @__PURE__ */et("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
586
- /* @__PURE__ */Qe("div",{ref:p,...L({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?f:o?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${Os[n]}`,Rs[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */Qe("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
595
+ /* @__PURE__ */Qe("div",{ref:p,...L({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?f:o?g:void 0),style:x,className:["fixed flex flex-col bg-white shadow-xl",y?"":`w-full max-w-full ${Qs[n]}`,ec[r],y?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */Qe("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
587
596
  /* @__PURE__ */Qe("div",{className:"min-w-0",children:[
588
- /* @__PURE__ */et("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */et("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */et(Ws,{onClose:t})]}):!s&&/* @__PURE__ */et("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */et(Ws,{onClose:t})}),
589
- /* @__PURE__ */Qe("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */et("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */et("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function _s({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=be().kanban,f=fe(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=Oe(null),[N,k]=Oe(null),$=Ke(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),M=()=>{w(null),k(null)},C=Re(null),L=Re(/* @__PURE__ */new Map);ie(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[$,v]);return s?/* @__PURE__ */et(Be,{size:"sm",padding:"p-4",label:b}):0!==e.length||u?/* @__PURE__ */et("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */et("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=$[e.value]??[],r=null!==N&&N.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||N.index!==o&&N.index!==o+1)?N.index:-1;/* @__PURE__ */
597
+ /* @__PURE__ */et("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */et("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */et(tc,{onClose:t})]}):!s&&/* @__PURE__ */et("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */et(tc,{onClose:t})}),
598
+ /* @__PURE__ */Qe("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */et("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */et("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function nc({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=fe().kanban,f=be(),b=c??g.loading,y=h??g.dropHere,x=p??g.addItem,[v,w]=Oe(null),[N,k]=Oe(null),$=Ke(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),M=()=>{w(null),k(null)},C=Re(null),L=Re(/* @__PURE__ */new Map);ie(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[$,v]);return s?/* @__PURE__ */et(Ie,{size:"sm",padding:"p-4",label:b}):0!==e.length||u?/* @__PURE__ */et("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */et("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=$[e.value]??[],r=null!==N&&N.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||N.index!==o&&N.index!==o+1)?N.index:-1;/* @__PURE__ */
590
599
  return Qe("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&N&&N.col===e){const t=($[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||N.index!==t&&N.index!==t+1){const n=r&&N.index>t?N.index-1:N.index;a(v,e,n)}}M()})(e.value)},children:[
591
600
  /* @__PURE__ */Qe("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
592
601
  /* @__PURE__ */Qe("span",{className:"flex items-center gap-2",children:[
@@ -594,81 +603,81 @@ return Qe("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray
594
603
  /* @__PURE__ */et("span",{className:"text-xs opacity-70",children:we(t.length,f)})]}),
595
604
  /* @__PURE__ */Qe("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>k(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const o=n(r),c=o===v;/* @__PURE__ */
596
605
  return Qe(Ge,{children:[s===a&&/* @__PURE__ */et("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
597
- /* @__PURE__ */et("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */et("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */et("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:x})]}),m&&/* @__PURE__ */et("div",{className:"p-2 pt-0",children:/* @__PURE__ */Qe("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
598
- /* @__PURE__ */et("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */et(tt,{children:d??/* @__PURE__ */et("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var qs="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function Hs({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=be().pagination,o=fe();if(t<=1)return null;const s=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
599
- return Qe("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */et("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${qs} text-gray-600 hover:bg-gray-100`,children:"«"}),
600
- /* @__PURE__ */et("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${qs} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */et("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */et("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${qs} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:we(t,o)},t)),
601
- /* @__PURE__ */et("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${qs} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */et("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${qs} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Us(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var Vs=e=>Array.isArray(e.columns),Ys=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Gs="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",Xs={sm:"px-2 py-2",md:"px-3 py-2"},Js={left:"text-left",right:"text-right",center:"text-center"};function Zs({direction:e}){/* @__PURE__ */
606
+ /* @__PURE__ */et("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;k(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:M,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */et("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */et("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:y})]}),m&&/* @__PURE__ */et("div",{className:"p-2 pt-0",children:/* @__PURE__ */Qe("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
607
+ /* @__PURE__ */et("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),x]})})]},e.value)})})}):/* @__PURE__ */et(tt,{children:d??/* @__PURE__ */et("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var ac="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function lc({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=fe().pagination,o=be();if(t<=1)return null;const s=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
608
+ return Qe("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */et("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${ac} text-gray-600 hover:bg-gray-100`,children:"«"}),
609
+ /* @__PURE__ */et("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${ac} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */et("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */et("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${ac} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:we(t,o)},t)),
610
+ /* @__PURE__ */et("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${ac} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */et("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${ac} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function ic(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var oc=e=>Array.isArray(e.columns),sc=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",cc="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",dc={sm:"px-2 py-2",md:"px-3 py-2"},uc={left:"text-left",right:"text-right",center:"text-center"};function hc({direction:e}){/* @__PURE__ */
602
611
  return Qe("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
603
612
  /* @__PURE__ */et("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */et("path",{d:"M4 0L8 5H0z"})}),
604
- /* @__PURE__ */et("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */et("path",{d:"M4 5L0 0h8z"})})]})}function Qs(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function ec({columns:e,data:n,rowKey:a,sort:l=null,onSortChange:i,pagination:o,caption:s,loading:c=!1,bordered:d=!1,size:u="md",minWidth:h,rowClassName:m,onRow:p,rowHref:g,onRowPress:f,linkAs:b,emptyText:x,selection:y,footer:v,virtualized:w,stackOnNarrow:N=!1,stackBelow:k,className:$=""}){const M=be(),C=x??M.table.empty,L=(e,t)=>"function"==typeof a?a(e,t):String(e[a]),D=N&&!w,S=D?e:e.flatMap(e=>{if(!Vs(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>D?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,z]=Oe(0),F=w?.overscan??6,E=w?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/w.rowHeight)-F);z(e=>e===t?e:t)}:void 0,B=w?Math.ceil(w.height/w.rowHeight)+2*F:n.length,I=w?Math.min(j,Math.max(0,n.length-B)):0,T=Math.min(n.length,I+B),O=w?I*w.rowHeight:0,R=w?(n.length-T)*w.rowHeight:0,W=Re(null),[K,_]=Oe(0);ie(()=>{if(!w)return;const e=W.current?.offsetHeight??0;_(t=>t===e?t:e)});const q=e=>e.sortField??e.key,H=e=>l&&l.field===q(e)?l.direction:null,U=S.flatMap(e=>Vs(e)?e.columns:[e]),V=S.some(Vs),Y=/* @__PURE__ */new Map;if(D)for(const e of S)if(Vs(e))for(const t of e.columns)Y.set(t,P(e.title,e.label));const G=e=>{const t=P(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(y?.selected??[]),J=y?n.map((e,t)=>L(e,t)):[],Z=J.length>0&&J.every(e=>X.has(e)),Q=J.some(e=>X.has(e)),ee=y?36:0,te=U.length+(y?1:0),re=U.some(e=>"left"===e.fixed),ne=D&&!y&&U.some(e=>e.cardCorner),ae=b??"a",le=`${Xs[u]} ${"sm"===u?"text-xs":"text-sm"}`,oe=(e,t)=>e.ellipsis?/* @__PURE__ */et("span",{className:"block w-0 min-w-full",children:t}):t,se=(e,n,a,l=0)=>{const o=H(e),s=Js[e.align??(e.numeric?"right":"left")],c="left"===e.fixed,d=!(!e.sortable||!i);/* @__PURE__ */
605
- return et("th",{scope:"col",...A("columnheader"),rowSpan:a>1?a:void 0,"aria-sort":"asc"===o?"ascending":"desc"===o?"descending":d?"none":void 0,style:{width:e.width,...c?{left:(de[n]??0)+ee}:{},...w?{top:l}:{}},className:[le,s,r,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs",c?w?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":w?"sticky z-10 bg-gray-50":"",D&&d?"rosh-dt-sort":"",D?Ys(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:oe(e,d?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>(e=>{if(!i)return;const t=q(e),r=H(e),n=e.sortFirst??"asc";i(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":D?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${s}`,children:[
613
+ /* @__PURE__ */et("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */et("path",{d:"M4 5L0 0h8z"})})]})}function mc(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function pc({columns:e,data:n,rowKey:a,sort:l=null,onSortChange:i,pagination:o,caption:s,loading:c=!1,bordered:d=!1,size:u="md",minWidth:h,rowClassName:m,onRow:p,rowHref:g,onRowPress:f,linkAs:b,emptyText:y,selection:x,footer:v,virtualized:w,stackOnNarrow:N=!1,stackBelow:k,className:$=""}){const M=fe(),C=y??M.table.empty,L=(e,t)=>"function"==typeof a?a(e,t):String(e[a]),D=N&&!w,S=D?e:e.flatMap(e=>{if(!oc(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>D?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,z]=Oe(0),F=w?.overscan??6,E=w?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/w.rowHeight)-F);z(e=>e===t?e:t)}:void 0,I=w?Math.ceil(w.height/w.rowHeight)+2*F:n.length,B=w?Math.min(j,Math.max(0,n.length-I)):0,T=Math.min(n.length,B+I),O=w?B*w.rowHeight:0,R=w?(n.length-T)*w.rowHeight:0,W=Re(null),[K,_]=Oe(0);ie(()=>{if(!w)return;const e=W.current?.offsetHeight??0;_(t=>t===e?t:e)});const q=e=>e.sortField??e.key,H=e=>l&&l.field===q(e)?l.direction:null,U=S.flatMap(e=>oc(e)?e.columns:[e]),V=S.some(oc),Y=/* @__PURE__ */new Map;if(D)for(const e of S)if(oc(e))for(const t of e.columns)Y.set(t,P(e.title,e.label));const G=e=>{const t=P(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(x?.selected??[]),Z=x?n.map((e,t)=>L(e,t)):[],J=Z.length>0&&Z.every(e=>X.has(e)),Q=Z.some(e=>X.has(e)),ee=x?36:0,te=U.length+(x?1:0),re=U.some(e=>"left"===e.fixed),ne=D&&!x&&U.some(e=>e.cardCorner),ae=b??"a",le=`${dc[u]} ${"sm"===u?"text-xs":"text-sm"}`,oe=(e,t)=>e.ellipsis?/* @__PURE__ */et("span",{className:"block w-0 min-w-full",children:t}):t,se=(e,n,a,l=0)=>{const o=H(e),s=uc[e.align??(e.numeric?"right":"left")],c="left"===e.fixed,d=!(!e.sortable||!i);/* @__PURE__ */
614
+ return et("th",{scope:"col",...A("columnheader"),rowSpan:a>1?a:void 0,"aria-sort":"asc"===o?"ascending":"desc"===o?"descending":d?"none":void 0,style:{width:e.width,...c?{left:(de[n]??0)+ee}:{},...w?{top:l}:{}},className:[le,s,r,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs",c?w?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":w?"sticky z-10 bg-gray-50":"",D&&d?"rosh-dt-sort":"",D?sc(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:oe(e,d?/* @__PURE__ */Qe("button",{type:"button",onClick:()=>(e=>{if(!i)return;const t=q(e),r=H(e),n=e.sortFirst??"asc";i(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":D?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${s}`,children:[
606
615
  /* @__PURE__ */et(t,{children:e.title}),
607
- /* @__PURE__ */et(Zs,{direction:o})]}):/* @__PURE__ */et(t,{children:e.title}))},e.key)};let ce=0;const de=U.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */Qe(tt,{children:[
616
+ /* @__PURE__ */et(hc,{direction:o})]}):/* @__PURE__ */et(t,{children:e.title}))},e.key)};let ce=0;const de=U.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */Qe(tt,{children:[
608
617
  /* @__PURE__ */Qe("div",{onScroll:E,style:w?{maxHeight:w.height}:void 0,className:`relative overflow-x-auto ${w?"overflow-y-auto":""} ${d?"rounded-lg border border-gray-200":""}${D?" rosh-dt-scroll":""}`.trim(),children:[c&&
609
618
  /* @__PURE__ */Qe("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
610
619
  /* @__PURE__ */et(Ee,{className:"h-6 w-6"}),
611
620
  /* @__PURE__ */et("span",{className:"sr-only",children:M.table.loading})]}),
612
621
  /* @__PURE__ */Qe("table",{...A("table"),className:(D?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:h?{minWidth:h}:void 0,children:[s&&/* @__PURE__ */et("caption",{className:"sr-only",children:s}),
613
622
  /* @__PURE__ */Qe("thead",{...A("rowgroup"),className:D?"rosh-dt-head":void 0,children:[
614
- /* @__PURE__ */Qe("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[y&&/* @__PURE__ */et("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...w?{top:0}:{}},className:[le,r,re||w?"sticky z-20 bg-gray-50":"",re?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */et(Lt,{"aria-label":M.table.selectAll,checked:Z,indeterminate:Q&&!Z,onChange:()=>{if(!y)return;const e=new Set(J);y.onChange(Z?y.selected.filter(t=>!e.has(t)):[...y.selected,...J.filter(e=>!X.has(e))])}})}),S.map((e,n)=>Vs(e)?/* @__PURE__ */et("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:w?{top:0}:void 0,className:[le,"text-center",r,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs","border-b border-gray-200",w?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */et(t,{children:e.title})},e.key??`group-${n}`):se(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */et("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:S.flatMap(e=>Vs(e)?e.columns:[]).map(e=>se(e,U.indexOf(e),1,K))})]}),
615
- /* @__PURE__ */et("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==n.length||c?/* @__PURE__ */Qe(tt,{children:[O>0&&/* @__PURE__ */et("tr",{"aria-hidden":"true",children:/* @__PURE__ */et("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),n.slice(I,T).map((e,t)=>{const r=I+t,n=p?.(e,r),a=!!n?.current,l=g?.(e,r),i=void 0===l&&f?()=>f(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[Gs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */et(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */et("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=U.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=U.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=U.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const u=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
616
- return Qe("tr",{...Us(n),...A("row"),style:w?{height:w.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:u(n?.onFocus),onBlur:u(n?.onBlur),"aria-current":a&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[D?y?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",D&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",m?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[y&&(()=>{const t=L(e,r);/* @__PURE__ */
617
- return et("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */et(Lt,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{y&&y.onChange(X.has(e)?y.selected.filter(t=>t!==e):[...y.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=D&&!a&&"wide"!==e.only;/* @__PURE__ */
618
- return et("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",D?Ys(e):"",le,Js[e.align??(e.numeric?"right":"left")],D?"":Qs(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:D?
619
- /* @__PURE__ */et("span",{className:["rosh-dt-value",Qs(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},L(e,r))}),R>0&&/* @__PURE__ */et("tr",{"aria-hidden":"true",children:/* @__PURE__ */et("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */et("tr",{...A("row"),className:D?"rosh-dt-empty":void 0,children:/* @__PURE__ */et("td",{...A("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:C})})})]}),v]}),o&&o.pageCount>1&&/* @__PURE__ */et("div",{className:D?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */et(Hs,{page:o.page,pageCount:o.pageCount,onPageChange:o.onPageChange})})]});/* @__PURE__ */
620
- return et("div",D?void 0!==k&&k>0&&40!==k?{className:`rosh-dt-at ${$}`.trim(),children:/* @__PURE__ */et("div",{className:"rosh-dt-stack",style:{width:40/k*100+"%"},children:/* @__PURE__ */et("div",{className:"rosh-dt-fit",style:{width:k/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${$}`.trim(),children:ue}:{className:$,children:ue})}function tc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=be().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
623
+ /* @__PURE__ */Qe("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[x&&/* @__PURE__ */et("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...w?{top:0}:{}},className:[le,r,re||w?"sticky z-20 bg-gray-50":"",re?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */et(Lt,{"aria-label":M.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!x)return;const e=new Set(Z);x.onChange(J?x.selected.filter(t=>!e.has(t)):[...x.selected,...Z.filter(e=>!X.has(e))])}})}),S.map((e,n)=>oc(e)?/* @__PURE__ */et("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:w?{top:0}:void 0,className:[le,"text-center",r,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs","border-b border-gray-200",w?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */et(t,{children:e.title})},e.key??`group-${n}`):se(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */et("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:S.flatMap(e=>oc(e)?e.columns:[]).map(e=>se(e,U.indexOf(e),1,K))})]}),
624
+ /* @__PURE__ */et("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==n.length||c?/* @__PURE__ */Qe(tt,{children:[O>0&&/* @__PURE__ */et("tr",{"aria-hidden":"true",children:/* @__PURE__ */et("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),n.slice(B,T).map((e,t)=>{const r=B+t,n=p?.(e,r),a=!!n?.current,l=g?.(e,r),i=void 0===l&&f?()=>f(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[cc,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */et(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */et("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=U.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=U.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=U.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const u=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
625
+ return Qe("tr",{...ic(n),...A("row"),style:w?{height:w.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:u(n?.onFocus),onBlur:u(n?.onBlur),"aria-current":a&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[D?x?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",D&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",m?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[x&&(()=>{const t=L(e,r);/* @__PURE__ */
626
+ return et("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */et(Lt,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{x&&x.onChange(X.has(e)?x.selected.filter(t=>t!==e):[...x.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=D&&!a&&"wide"!==e.only;/* @__PURE__ */
627
+ return et("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",D?sc(e):"",le,uc[e.align??(e.numeric?"right":"left")],D?"":mc(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:D?
628
+ /* @__PURE__ */et("span",{className:["rosh-dt-value",mc(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},L(e,r))}),R>0&&/* @__PURE__ */et("tr",{"aria-hidden":"true",children:/* @__PURE__ */et("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */et("tr",{...A("row"),className:D?"rosh-dt-empty":void 0,children:/* @__PURE__ */et("td",{...A("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:C})})})]}),v]}),o&&o.pageCount>1&&/* @__PURE__ */et("div",{className:D?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */et(lc,{page:o.page,pageCount:o.pageCount,onPageChange:o.onPageChange})})]});/* @__PURE__ */
629
+ return et("div",D?void 0!==k&&k>0&&40!==k?{className:`rosh-dt-at ${$}`.trim(),children:/* @__PURE__ */et("div",{className:"rosh-dt-stack",style:{width:40/k*100+"%"},children:/* @__PURE__ */et("div",{className:"rosh-dt-fit",style:{width:k/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${$}`.trim(),children:ue}:{className:$,children:ue})}function gc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=fe().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
621
630
  return Qe(tt,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?/* @__PURE__ */Qe(tt,{children:[" · ",
622
631
  /* @__PURE__ */Qe("span",{className:"inline-flex items-center gap-1",role:"status",children:[
623
- /* @__PURE__ */et(Ee,{}),o.loadingMore]})]}):""]})}function rc({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=be().list;/* @__PURE__ */
632
+ /* @__PURE__ */et(Ee,{}),o.loadingMore]})]}):""]})}function fc({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=fe().list;/* @__PURE__ */
624
633
  return Qe("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
625
634
  /* @__PURE__ */et(ue,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
626
635
  /* @__PURE__ */et("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
627
- /* @__PURE__ */et("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */et("div",{className:"mt-4",children:/* @__PURE__ */et(T,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function nc({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
636
+ /* @__PURE__ */et("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */et("div",{className:"mt-4",children:/* @__PURE__ */et(T,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function bc({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
628
637
  return Qe("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */et("path",{d:f,fill:a,stroke:"none"}),
629
- /* @__PURE__ */et("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */et("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var ac=8,lc=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],ic={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},oc={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function sc(e){return lc[e]??oc.muted}function cc(e,t,r){return t||(r?ic[r]:sc(e))}function dc(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function uc(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function hc(e,t,r,n){return r||n?cc(e,r,n):e<t?sc(e):oc.muted}function mc(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function pc(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function gc(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function fc(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function bc(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function xc(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function yc(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function vc(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function wc(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Nc(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function kc(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function $c(e,t=720){const[r,n]=Oe(t);return _e(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Mc(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Cc({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const x=be().charts,y=fe(),v=s??(e=>we(e,y)),w=b??x.noData,N=Re(null),k=$c(N),$=n??k,[M,C]=Oe(null),L=We();if(_e(()=>{if(null!==M)return te(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
630
- return et("div",{className:f,ref:N,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?bc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,P=void 0!==l&&void 0===i?bc(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=A?A.lo:l??Math.min(0,...D),z=A?A.hi:P?P.hi:i??fc(Math.max(...D,0)),F=A?A.ticks:P?[j,...P.ticks.filter(e=>e>j)]:mc([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:kc(F.map(v),48)+(c?10:0)},B=E.left,I=Math.max(B+1,$-E.right),T=E.top,O=r-E.bottom,R=mc([j,z],{from:O,to:T}),W=pc(e.length,{from:B,to:I},a),K=(I-B)/Math.max(1,e.length),_=K>=48,q=_?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),H=Math.max(2,Math.floor((K-6)/6.6)),U=e=>_&&e.length>H?`${e.slice(0,H-1).trimEnd()}…`:e;/* @__PURE__ */
638
+ /* @__PURE__ */et("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */et("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var yc=8,xc=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],vc={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},wc={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Nc(e){return xc[e]??wc.muted}function kc(e,t,r){return t||(r?vc[r]:Nc(e))}function $c(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function Mc(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function Cc(e,t,r,n){return r||n?kc(e,r,n):e<t?Nc(e):wc.muted}function Lc(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Dc(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function Sc(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Ac(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function Pc(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function jc(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function zc(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Fc(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Ec(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Ic(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function Bc(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function Tc(e,t=720){const[r,n]=Oe(t);return _e(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Oc(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Rc({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const y=fe().charts,x=be(),v=s??(e=>we(e,x)),w=b??y.noData,N=Re(null),k=Tc(N),$=n??k,[M,C]=Oe(null),L=We();if(_e(()=>{if(null!==M)return te(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
639
+ return et("div",{className:f,ref:N,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?Pc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,P=void 0!==l&&void 0===i?Pc(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=A?A.lo:l??Math.min(0,...D),z=A?A.hi:P?P.hi:i??Ac(Math.max(...D,0)),F=A?A.ticks:P?[j,...P.ticks.filter(e=>e>j)]:Lc([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:Bc(F.map(v),48)+(c?10:0)},I=E.left,B=Math.max(I+1,$-E.right),T=E.top,O=r-E.bottom,R=Lc([j,z],{from:O,to:T}),W=Dc(e.length,{from:I,to:B},a),K=(B-I)/Math.max(1,e.length),_=K>=48,q=_?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),H=Math.max(2,Math.floor((K-6)/6.6)),U=e=>_&&e.length>H?`${e.slice(0,H-1).trimEnd()}…`:e;/* @__PURE__ */
631
640
  return Qe("div",{className:`relative ${f??""}`,ref:N,children:[
632
641
  /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${$} ${r}`,role:"img","aria-label":g,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:t=>{if(p&&null!==M&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void p(M);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;C(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
633
- /* @__PURE__ */et("defs",{children:/* @__PURE__ */et("clipPath",{id:L,children:/* @__PURE__ */et("rect",{x:B,y:T,width:I-B,height:O-T})})}),F.map(e=>/* @__PURE__ */et("line",{x1:B,y1:R(e),x2:I,y2:R(e),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
634
- /* @__PURE__ */et("line",{x1:B,y1:R(Math.max(j,0)),x2:I,y2:R(Math.max(j,0)),stroke:oc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */et("text",{x:B-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */et("text",{x:14,y:(T+O)/2,transform:`rotate(-90 14 ${(T+O)/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:c}),
635
- /* @__PURE__ */et("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%q===0?/* @__PURE__ */et("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:U(e)},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */et("rect",{x:W.center(r)-(I-B)/e.length/2,y:T,width:(I-B)/e.length,height:O-T,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
636
- /* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(W.center(M),W.bandwidth,$),children:m(M)})]})}function Lc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=be().charts,o=a??i.loading,s=`${We()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
642
+ /* @__PURE__ */et("defs",{children:/* @__PURE__ */et("clipPath",{id:L,children:/* @__PURE__ */et("rect",{x:I,y:T,width:B-I,height:O-T})})}),F.map(e=>/* @__PURE__ */et("line",{x1:I,y1:R(e),x2:B,y2:R(e),stroke:wc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
643
+ /* @__PURE__ */et("line",{x1:I,y1:R(Math.max(j,0)),x2:B,y2:R(Math.max(j,0)),stroke:wc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */et("text",{x:I-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */et("text",{x:14,y:(T+O)/2,transform:`rotate(-90 14 ${(T+O)/2})`,textAnchor:"middle",fontSize:11,fill:wc.label,children:c}),
644
+ /* @__PURE__ */et("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:I,right:B,top:T,bottom:O,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:I,right:B,top:T,bottom:O,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%q===0?/* @__PURE__ */et("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:U(e)},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */et("rect",{x:W.center(r)-(B-I)/e.length/2,y:T,width:(B-I)/e.length,height:O-T,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
645
+ /* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 z-10",style:Oc(W.center(M),W.bandwidth,$),children:m(M)})]})}function Wc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=fe().charts,o=a??i.loading,s=`${We()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
637
646
  return et("div",{className:l,children:/* @__PURE__ */Qe("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
638
647
  /* @__PURE__ */et("defs",{children:/* @__PURE__ */Qe("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
639
- /* @__PURE__ */et("stop",{offset:"0%",stopColor:oc.surface,stopOpacity:"0"}),
640
- /* @__PURE__ */et("stop",{offset:"45%",stopColor:oc.surface,stopOpacity:"0.55"}),
641
- /* @__PURE__ */et("stop",{offset:"55%",stopColor:oc.surface,stopOpacity:"0.55"}),
642
- /* @__PURE__ */et("stop",{offset:"100%",stopColor:oc.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
643
- return et("line",{x1:c,y1:r,x2:d,y2:r,stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */et("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:oc.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
644
- return et("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:oc.grid},t)}):/* @__PURE__ */et("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:oc.grid}),
645
- /* @__PURE__ */et("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var Dc=qe({highlighted:null,setHighlighted:()=>{}});function Sc({children:e}){const[t,r]=Oe(null),n=Ke(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
646
- return et(Dc.Provider,{value:n,children:e})}function Ac(){return Ye(Dc)}function Pc(e,t,r=.22){return null===t?null:t===e?1:r}function jc(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function zc({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
647
- return Qe("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white ring-1 ring-black/5"} ${l??""}`,style:i?Z():{boxShadow:"var(--elevation-popup)"},children:[t&&/* @__PURE__ */et("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
648
+ /* @__PURE__ */et("stop",{offset:"0%",stopColor:wc.surface,stopOpacity:"0"}),
649
+ /* @__PURE__ */et("stop",{offset:"45%",stopColor:wc.surface,stopOpacity:"0.55"}),
650
+ /* @__PURE__ */et("stop",{offset:"55%",stopColor:wc.surface,stopOpacity:"0.55"}),
651
+ /* @__PURE__ */et("stop",{offset:"100%",stopColor:wc.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
652
+ return et("line",{x1:c,y1:r,x2:d,y2:r,stroke:wc.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */et("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:wc.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
653
+ return et("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:wc.grid},t)}):/* @__PURE__ */et("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:wc.grid}),
654
+ /* @__PURE__ */et("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var Kc=qe({highlighted:null,setHighlighted:()=>{}});function _c({children:e}){const[t,r]=Oe(null),n=Ke(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
655
+ return et(Kc.Provider,{value:n,children:e})}function qc(){return Ye(Kc)}function Hc(e,t,r=.22){return null===t?null:t===e?1:r}function Uc(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Vc({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
656
+ return Qe("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white ring-1 ring-black/5"} ${l??""}`,style:i?J():{boxShadow:"var(--elevation-popup)"},children:[t&&/* @__PURE__ */et("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
648
657
  /* @__PURE__ */et("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */Qe("li",{className:"flex items-center gap-3",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
649
- /* @__PURE__ */et("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??oc.muted}}),
658
+ /* @__PURE__ */et("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??wc.muted}}),
650
659
  /* @__PURE__ */et("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
651
- /* @__PURE__ */et("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */et("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Fc({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none",valueLabels:x=!1,onSelect:y,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=We(),{highlighted:C}=Ac(),L=be().charts,D=fe(),S=o??(e=>we(e,D)),A=w??S;if(h)/* @__PURE__ */return et(Lc,{height:a,width:l,variant:"bars",className:c});const P=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?ic[n]:cc(e.slot,e.color,e.tone)},j=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),z=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},F=t.map((e,t)=>j.reduce((e,r)=>e+z(r,t),0)),E=t.map((e,t)=>j.reduce((e,r)=>e+Math.max(0,z(r,t)),0)),B=t.map((e,t)=>j.reduce((e,r)=>e+Math.min(0,z(r,t)),0)),I=r&&"percent"===n,T=(e,t)=>F[t]>0?e/F[t]:null,O=I?[1]:r?[...E,...B]:j.flatMap(e=>e.data.filter(Number.isFinite)),R=(e,t)=>{const r=e.bandwidth/Math.max(1,j.length),n=j.length>1?Math.min(k,.25*r):0;return{offset:t*r+n/2,width:Math.max(1,r-n)}},W=$&&!r?({x:e,y:r})=>{const n=Math.min(r.domain[1],Math.max(r.domain[0],0));return t.map((t,a)=>j.map((t,l)=>{const i=t.data[a];if(!Number.isFinite(i))return null;const o=Math.min(r.domain[1],Math.max(r.domain[0],i)),{offset:s,width:c}=R(e,l),d=e(a)+s+c/2,u=Math.min(r(o),r(n)),h=Math.max(r(o),r(n));if(c<13)return null;const m=Math.floor((h-u-12)/6.6),p=m>=Math.min(4,t.label.length),g=p&&t.label.length>m?`${t.label.slice(0,m-1).trimEnd()}…`:t.label,f=p?h-6:u-4;/* @__PURE__ */
652
- return et("text",{"data-series-label":"true",x:d,y:f,transform:`rotate(-90 ${d} ${f})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?oc.surface:oc.label,children:g},`n${t.key}-${a}`)}))}:null;/* @__PURE__ */
653
- return et(Cc,{labels:t,values:O,height:a,width:l,max:I?1:i,min:I?void 0:v,formatValue:I?e=>ke(Math.round(100*e),0,D):S,yAxisLabel:s,className:c,emptyLabel:d,onSelect:y,ariaLabel:L.acrossCategories(j.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */et(zc,{title:N?.[e]??t[e],rows:j.map(t=>({key:t.key,label:t.label,color:P(t,e),value:Number.isFinite(t.data[e])?I?`${ke(100*(T(t.data[e],e)??0),1,D)} · ${A(t.data[e])}`:A(t.data[e]):void 0})),footnote:I?L.inCategory(A(F[e])):void 0}),overlay:x&&!I||W?({x:e,y:n})=>/* @__PURE__ */Qe("g",{pointerEvents:"none",children:[W?.({x:e,y:n}),x&&!I&&t.map((t,a)=>{if(r){if(!j.some(e=>Number.isFinite(e.data[a])))return null;const t=j.reduce((e,t)=>e+z(t,a),0),r=t>=0?E[a]:B[a];/* @__PURE__ */
654
- return et("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`v${a}`)}return j.map((t,r)=>{const l=t.data[a];if(!Number.isFinite(l))return null;const i=l,{offset:o,width:s}=R(e,r);/* @__PURE__ */
655
- return et("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=jc(r?F:j[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
660
+ /* @__PURE__ */et("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */et("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Yc({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=We(),{highlighted:C}=qc(),L=fe().charts,D=be(),S=o??(e=>we(e,D)),A=w??S;if(h)/* @__PURE__ */return et(Wc,{height:a,width:l,variant:"bars",className:c});const P=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?vc[n]:kc(e.slot,e.color,e.tone)},j=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),z=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},F=t.map((e,t)=>j.reduce((e,r)=>e+z(r,t),0)),E=t.map((e,t)=>j.reduce((e,r)=>e+Math.max(0,z(r,t)),0)),I=t.map((e,t)=>j.reduce((e,r)=>e+Math.min(0,z(r,t)),0)),B=r&&"percent"===n,T=(e,t)=>F[t]>0?e/F[t]:null,O=B?[1]:r?[...E,...I]:j.flatMap(e=>e.data.filter(Number.isFinite)),R=(e,t)=>{const r=e.bandwidth/Math.max(1,j.length),n=j.length>1?Math.min(k,.25*r):0;return{offset:t*r+n/2,width:Math.max(1,r-n)}},W=$&&!r?({x:e,y:r})=>{const n=Math.min(r.domain[1],Math.max(r.domain[0],0));return t.map((t,a)=>j.map((t,l)=>{const i=t.data[a];if(!Number.isFinite(i))return null;const o=Math.min(r.domain[1],Math.max(r.domain[0],i)),{offset:s,width:c}=R(e,l),d=e(a)+s+c/2,u=Math.min(r(o),r(n)),h=Math.max(r(o),r(n));if(c<13)return null;const m=Math.floor((h-u-12)/6.6),p=m>=Math.min(4,t.label.length),g=p&&t.label.length>m?`${t.label.slice(0,m-1).trimEnd()}…`:t.label,f=p?h-6:u-4;/* @__PURE__ */
661
+ return et("text",{"data-series-label":"true",x:d,y:f,transform:`rotate(-90 ${d} ${f})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?wc.surface:wc.label,children:g},`n${t.key}-${a}`)}))}:null;/* @__PURE__ */
662
+ return et(Rc,{labels:t,values:O,height:a,width:l,max:B?1:i,min:B?void 0:v,formatValue:B?e=>ke(Math.round(100*e),0,D):S,yAxisLabel:s,className:c,emptyLabel:d,onSelect:x,ariaLabel:L.acrossCategories(j.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */et(Vc,{title:N?.[e]??t[e],rows:j.map(t=>({key:t.key,label:t.label,color:P(t,e),value:Number.isFinite(t.data[e])?B?`${ke(100*(T(t.data[e],e)??0),1,D)} · ${A(t.data[e])}`:A(t.data[e]):void 0})),footnote:B?L.inCategory(A(F[e])):void 0}),overlay:y&&!B||W?({x:e,y:n})=>/* @__PURE__ */Qe("g",{pointerEvents:"none",children:[W?.({x:e,y:n}),y&&!B&&t.map((t,a)=>{if(r){if(!j.some(e=>Number.isFinite(e.data[a])))return null;const t=j.reduce((e,t)=>e+z(t,a),0),r=t>=0?E[a]:I[a];/* @__PURE__ */
663
+ return et("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`v${a}`)}return j.map((t,r)=>{const l=t.data[a];if(!Number.isFinite(l))return null;const i=l,{offset:o,width:s}=R(e,r);/* @__PURE__ */
664
+ return et("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:S(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=Uc(r?F:j[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
656
665
  return Qe("g",{children:[
657
- /* @__PURE__ */et(Wi,{id:M,glow:p}),t.map((t,a)=>{let l=0,i=0;const o=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return j.map((t,c)=>{const d=t.data[a];if(!Number.isFinite(d))return null;const h=I?T(d,a):d;if(null===h)return null;const f=P(t,a),b=R(e,c),x=r?e(a):e(a)+b.offset,y=r?Math.max(1,e.bandwidth):b.width;let v,w,N=!0;if(r){const e=h>=0?l:i,t=e+h;h>=0?l=t:i=t,v=n(Math.max(e,t)),w=n(Math.min(e,t)),N=0===e}else v=Math.min(n(h),o),w=Math.max(n(h),o);const k=Math.max(0,w-v-(r&&!N?2:0)),$=null===s||s===a,L=$?f:g?oc.muted:f,D=Pc(t.key,C);/* @__PURE__ */
658
- return et("rect",{x:x,y:v,width:y,height:k,rx:u,fill:L,fillOpacity:D??($?1:g?.32:.45),filter:p&&s===a?`url(#${Fi(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${_i.rise}`:""),style:m?qi(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */et("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:oc.axis,strokeWidth:1})]})}})}var Ec=e=>e.toFixed(2);function Bc(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Ec(e)},${Ec(t)}`).join(" ")}function Ic(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Ec(e.start)},${Ec(e.y)}`,t+=` L${Ec(e.end)},${Ec(e.y)}`}),t}function Tc(e){if(e.length<3)return Bc(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Ec(e[0][0])},${Ec(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Ec(e[n][0]+t)},${Ec(e[n][1]+a[n]*t)} ${Ec(e[n+1][0]-t)},${Ec(e[n+1][1]-a[n+1]*t)} ${Ec(e[n+1][0])},${Ec(e[n+1][1])}`}return l}function Oc(e,t=0){if(e.length<3)return Bc(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${Ec(e[0][0])},${Ec(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${Ec(c)},${Ec(d)} ${Ec(u)},${Ec(h)} ${Ec(a[0])},${Ec(a[1])}`}return o}function Rc(e){if(e.length<2)return Bc(e);let t=`M${Ec(e[0][0])},${Ec(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${Ec(o)},${Ec(a)} ${Ec(o)},${Ec(i)} ${Ec(l)},${Ec(i)}`}return t}function Wc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Ec(e[0][0])},${Ec(e[0][1])}`:"monotone"===t?Tc(e):"spline"===t?Oc(e,r):"bump"===t?Rc(e):Bc(e)}function Kc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Ec(a[0])},${Ec(r)} L${Ec(n[0])},${Ec(r)} Z`}function _c(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Ec(e)},${Ec(t)}`).join(" L")} Z`}function qc(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function Hc(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Hc(e,t,r,n,a,l)} ${Hc(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${Ec(e)},${Ec(t)} L${Ec(c)},${Ec(d)} A${Ec(n)},${Ec(n)} 0 ${o} 1 ${Ec(u)},${Ec(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Ec(c)},${Ec(d)} A${Ec(n)},${Ec(n)} 0 ${o} 1 ${Ec(u)},${Ec(h)} L${Ec(m)},${Ec(p)} A${Ec(r)},${Ec(r)} 0 ${o} 0 ${Ec(g)},${Ec(f)} Z`}function Uc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=be().charts,g=fe(),f=o??(e=>we(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=We(),[v,w]=Oe(null),{highlighted:N}=Ac(),k=Re(null),$=$c(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const C=[...M].sort((e,t)=>t.value-e.value),L=C.slice(0,l),D=C.slice(l),S=D.length>0?[...L,{key:"__other__",label:b,value:D.reduce((e,t)=>e+t.value,0),slot:-1,color:oc.muted}]:L,A=e=>cc(e.slot,e.color,e.tone),P=S.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...S.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,E=z?Math.max(120,Math.min(r,$-2*F)):r,B=E+2*F,I=F+E/2,T=E/2,O=E/2-12,R=n??("ring"===t?.58*O:0),W=vc(S.length,a),K=Math.max(...S.map(e=>e.value)),_=e=>R+(O-R)*Math.sqrt(Math.max(0,e)/K);let q=-Math.PI/2;const H=(()=>{if(!z)return[];let e=-Math.PI/2;const r=S.map((r,n)=>{const l="rose"===t?vc(S.length,a).step:r.value/P*Math.PI*2,i="rose"===t?vc(S.length,a).center(n):e+l/2;e+=l;const o="rose"===t?_(r.value):O;return{key:r.key,label:r.label,share:r.value/P,right:Math.cos(i)>=0,anchor:[I+o*Math.cos(i),T+o*Math.sin(i)],y:T+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((E-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?E-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),U=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?S[v]:void 0;/* @__PURE__ */
666
+ /* @__PURE__ */et(to,{id:M,glow:p}),t.map((t,a)=>{let l=0,i=0;const o=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return j.map((t,c)=>{const d=t.data[a];if(!Number.isFinite(d))return null;const h=B?T(d,a):d;if(null===h)return null;const f=P(t,a),b=R(e,c),y=r?e(a):e(a)+b.offset,x=r?Math.max(1,e.bandwidth):b.width;let v,w,N=!0;if(r){const e=h>=0?l:i,t=e+h;h>=0?l=t:i=t,v=n(Math.max(e,t)),w=n(Math.min(e,t)),N=0===e}else v=Math.min(n(h),o),w=Math.max(n(h),o);const k=Math.max(0,w-v-(r&&!N?2:0)),$=null===s||s===a,L=$?f:g?wc.muted:f,D=Hc(t.key,C);/* @__PURE__ */
667
+ return et("rect",{x:y,y:v,width:x,height:k,rx:u,fill:L,fillOpacity:D??($?1:g?.32:.45),filter:p&&s===a?`url(#${Yi(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${no.rise}`:""),style:m?ao(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */et("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:wc.axis,strokeWidth:1})]})}})}var Gc=e=>e.toFixed(2);function Xc(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Gc(e)},${Gc(t)}`).join(" ")}function Zc(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Gc(e.start)},${Gc(e.y)}`,t+=` L${Gc(e.end)},${Gc(e.y)}`}),t}function Jc(e){if(e.length<3)return Xc(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Gc(e[0][0])},${Gc(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Gc(e[n][0]+t)},${Gc(e[n][1]+a[n]*t)} ${Gc(e[n+1][0]-t)},${Gc(e[n+1][1]-a[n+1]*t)} ${Gc(e[n+1][0])},${Gc(e[n+1][1])}`}return l}function Qc(e,t=0){if(e.length<3)return Xc(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${Gc(e[0][0])},${Gc(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${Gc(c)},${Gc(d)} ${Gc(u)},${Gc(h)} ${Gc(a[0])},${Gc(a[1])}`}return o}function ed(e){if(e.length<2)return Xc(e);let t=`M${Gc(e[0][0])},${Gc(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${Gc(o)},${Gc(a)} ${Gc(o)},${Gc(i)} ${Gc(l)},${Gc(i)}`}return t}function td(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Gc(e[0][0])},${Gc(e[0][1])}`:"monotone"===t?Jc(e):"spline"===t?Qc(e,r):"bump"===t?ed(e):Xc(e)}function rd(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Gc(a[0])},${Gc(r)} L${Gc(n[0])},${Gc(r)} Z`}function nd(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Gc(e)},${Gc(t)}`).join(" L")} Z`}function ad(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function ld(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${ld(e,t,r,n,a,l)} ${ld(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${Gc(e)},${Gc(t)} L${Gc(c)},${Gc(d)} A${Gc(n)},${Gc(n)} 0 ${o} 1 ${Gc(u)},${Gc(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Gc(c)},${Gc(d)} A${Gc(n)},${Gc(n)} 0 ${o} 1 ${Gc(u)},${Gc(h)} L${Gc(m)},${Gc(p)} A${Gc(r)},${Gc(r)} 0 ${o} 0 ${Gc(g)},${Gc(f)} Z`}function id({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=fe().charts,g=be(),f=o??(e=>we(e,g)),b=i??p.other,y=m??p.nothingToBreakDown,x=We(),[v,w]=Oe(null),{highlighted:N}=qc(),k=Re(null),$=Tc(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${h??""}`,children:y});const C=[...M].sort((e,t)=>t.value-e.value),L=C.slice(0,l),D=C.slice(l),S=D.length>0?[...L,{key:"__other__",label:b,value:D.reduce((e,t)=>e+t.value,0),slot:-1,color:wc.muted}]:L,A=e=>kc(e.slot,e.color,e.tone),P=S.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...S.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,E=z?Math.max(120,Math.min(r,$-2*F)):r,I=E+2*F,B=F+E/2,T=E/2,O=E/2-12,R=n??("ring"===t?.58*O:0),W=Fc(S.length,a),K=Math.max(...S.map(e=>e.value)),_=e=>R+(O-R)*Math.sqrt(Math.max(0,e)/K);let q=-Math.PI/2;const H=(()=>{if(!z)return[];let e=-Math.PI/2;const r=S.map((r,n)=>{const l="rose"===t?Fc(S.length,a).step:r.value/P*Math.PI*2,i="rose"===t?Fc(S.length,a).center(n):e+l/2;e+=l;const o="rose"===t?_(r.value):O;return{key:r.key,label:r.label,share:r.value/P,right:Math.cos(i)>=0,anchor:[B+o*Math.cos(i),T+o*Math.sin(i)],y:T+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((E-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?E-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),U=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?S[v]:void 0;/* @__PURE__ */
659
668
  return Qe("div",{className:`relative ${h??""}`,ref:k,children:[
660
- /* @__PURE__ */Qe("svg",{width:"100%",height:E,viewBox:`0 0 ${B} ${E}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
661
- /* @__PURE__ */et("title",{id:y,children:p.breakdown(f(P),S.length)}),S.map((e,r)=>{const n=A(e),l="rose"===t?W(r):q,i="rose"===t?W.step:e.value/P*Math.PI*2-a;"rose"!==t&&(q+=e.value/P*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?_(e.value):O;/* @__PURE__ */
662
- return et("path",{d:Hc(I,T,R,s,l,o),fill:n,fillOpacity:U(r,e.key)?.4:1,stroke:oc.surface,strokeWidth:1,className:c?_i.sweep:void 0,style:c?qi(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),H.map(e=>{const t=e.right?B-6:6,r=e.right?I+O+14:I-O-14;/* @__PURE__ */
669
+ /* @__PURE__ */Qe("svg",{width:"100%",height:E,viewBox:`0 0 ${I} ${E}`,role:"img","aria-labelledby":x,onMouseLeave:()=>w(null),children:[
670
+ /* @__PURE__ */et("title",{id:x,children:p.breakdown(f(P),S.length)}),S.map((e,r)=>{const n=A(e),l="rose"===t?W(r):q,i="rose"===t?W.step:e.value/P*Math.PI*2-a;"rose"!==t&&(q+=e.value/P*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?_(e.value):O;/* @__PURE__ */
671
+ return et("path",{d:ld(B,T,R,s,l,o),fill:n,fillOpacity:U(r,e.key)?.4:1,stroke:wc.surface,strokeWidth:1,className:c?no.sweep:void 0,style:c?ao(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),H.map(e=>{const t=e.right?I-6:6,r=e.right?B+O+14:B-O-14;/* @__PURE__ */
663
672
  return Qe("g",{children:[
664
- /* @__PURE__ */et("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:oc.grid,strokeWidth:1}),
665
- /* @__PURE__ */et("text",{x:t,y:e.y-2,fontSize:11,fill:oc.label,textAnchor:e.right?"end":"start",children:e.label}),
666
- /* @__PURE__ */et("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:oc.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:ke(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */et("text",{x:I,y:T+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:oc.label,children:s})]}),V&&null!==v&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:V.label,rows:[{key:"value",label:p.value,color:A(V),value:f(V.value)},{key:"share",label:p.share,color:oc.muted,value:ke(V.value/P*100,1,g)}]})}),
673
+ /* @__PURE__ */et("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:wc.grid,strokeWidth:1}),
674
+ /* @__PURE__ */et("text",{x:t,y:e.y-2,fontSize:11,fill:wc.label,textAnchor:e.right?"end":"start",children:e.label}),
675
+ /* @__PURE__ */et("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:wc.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:ke(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */et("text",{x:B,y:T+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:wc.label,children:s})]}),V&&null!==v&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:V.label,rows:[{key:"value",label:p.value,color:A(V),value:f(V.value)},{key:"share",label:p.share,color:wc.muted,value:ke(V.value/P*100,1,g)}]})}),
667
676
  /* @__PURE__ */et("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:S.map((e,t)=>/* @__PURE__ */Qe("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
668
677
  /* @__PURE__ */et("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:A(e)}}),
669
678
  /* @__PURE__ */et("span",{className:"flex-1 truncate",children:e.label}),
670
- /* @__PURE__ */et("span",{className:"tabular-nums text-gray-800",children:ke(e.value/P*100,1,g)})]},e.key))})]})}var Vc={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Yc=[12,18,14,22,19,27,24,31,28,35,30,38],Gc=["J","F","M","A","M","J","J","A","S","O","N","D"],Xc=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],Jc=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function Zc(){/* @__PURE__ */
671
- return et(qt,{groups:Vc,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-6xl space-y-6",children:[
679
+ /* @__PURE__ */et("span",{className:"tabular-nums text-gray-800",children:ke(e.value/P*100,1,g)})]},e.key))})]})}var od={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},sd=[12,18,14,22,19,27,24,31,28,35,30,38],cd=["J","F","M","A","M","J","J","A","S","O","N","D"],dd=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],ud=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function hd(){/* @__PURE__ */
680
+ return et(qt,{groups:od,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-6xl space-y-6",children:[
672
681
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-4",children:[
673
682
  /* @__PURE__ */Qe("div",{children:[
674
683
  /* @__PURE__ */et("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
@@ -677,34 +686,34 @@ return et(qt,{groups:Vc,children:/* @__PURE__ */et("div",{className:"h-full over
677
686
  /* @__PURE__ */et(T,{variant:"secondary",size:"sm",children:"Export"}),
678
687
  /* @__PURE__ */et(T,{size:"sm",children:"New report"})]})]}),
679
688
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
680
- /* @__PURE__ */et(nl,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
681
- /* @__PURE__ */et(nl,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
682
- /* @__PURE__ */et(nl,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
683
- /* @__PURE__ */et(nl,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
689
+ /* @__PURE__ */et(bl,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
690
+ /* @__PURE__ */et(bl,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
691
+ /* @__PURE__ */et(bl,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
692
+ /* @__PURE__ */et(bl,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
684
693
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
685
- /* @__PURE__ */et(rl,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */et(Fc,{labels:Gc,height:200,series:[{key:"revenue",label:"Revenue",data:Yc}],formatValue:e=>`$${e}k`})}),
686
- /* @__PURE__ */et(rl,{header:"Traffic sources",children:/* @__PURE__ */et(Uc,{variant:"ring",size:180,segments:Xc,centerLabel:"100%"})})]}),
687
- /* @__PURE__ */et(rl,{header:"Recent orders",padded:!1,children:/* @__PURE__ */Qe("table",{className:"w-full text-sm",children:[
694
+ /* @__PURE__ */et(fl,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */et(Yc,{labels:cd,height:200,series:[{key:"revenue",label:"Revenue",data:sd}],formatValue:e=>`$${e}k`})}),
695
+ /* @__PURE__ */et(fl,{header:"Traffic sources",children:/* @__PURE__ */et(id,{variant:"ring",size:180,segments:dd,centerLabel:"100%"})})]}),
696
+ /* @__PURE__ */et(fl,{header:"Recent orders",padded:!1,children:/* @__PURE__ */Qe("table",{className:"w-full text-sm",children:[
688
697
  /* @__PURE__ */et("thead",{children:/* @__PURE__ */Qe("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
689
698
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Order"}),
690
699
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Customer"}),
691
700
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Total"}),
692
701
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Status"})]})}),
693
- /* @__PURE__ */et("tbody",{className:"divide-y divide-gray-100",children:Jc.map(e=>/* @__PURE__ */Qe("tr",{className:"text-gray-700",children:[
702
+ /* @__PURE__ */et("tbody",{className:"divide-y divide-gray-100",children:ud.map(e=>/* @__PURE__ */Qe("tr",{className:"text-gray-700",children:[
694
703
  /* @__PURE__ */et("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
695
704
  /* @__PURE__ */et("td",{className:"px-4 py-2",children:/* @__PURE__ */Qe("span",{className:"flex items-center gap-2",children:[
696
- /* @__PURE__ */et(Jl,{size:"xs",name:e.customer}),e.customer]})}),
705
+ /* @__PURE__ */et(ui,{size:"xs",name:e.customer}),e.customer]})}),
697
706
  /* @__PURE__ */et("td",{className:"px-4 py-2",children:e.total}),
698
707
  /* @__PURE__ */et("td",{className:"px-4 py-2",children:/* @__PURE__ */et(Ut,{status:e.status})})]},e.id))})]})}),
699
708
  /* @__PURE__ */Qe("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
700
- /* @__PURE__ */et("span",{className:"text-emerald-600",children:/* @__PURE__ */et(nc,{data:Yc,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var Qc={active:"success",invited:"queued",suspended:"danger",pending:"pending"},ed=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function td(){const[e,t]=Oe(1),[n,a]=Oe(""),[l,i]=Oe("");/* @__PURE__ */
701
- return et(qt,{groups:Qc,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-5xl space-y-4",children:[
709
+ /* @__PURE__ */et("span",{className:"text-emerald-600",children:/* @__PURE__ */et(bc,{data:sd,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var md={active:"success",invited:"queued",suspended:"danger",pending:"pending"},pd=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function gd(){const[e,t]=Oe(1),[n,a]=Oe(""),[l,i]=Oe("");/* @__PURE__ */
710
+ return et(qt,{groups:md,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-5xl space-y-4",children:[
702
711
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-4",children:[
703
712
  /* @__PURE__ */et("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
704
713
  /* @__PURE__ */et(T,{size:"sm",children:"Invite member"})]}),
705
- /* @__PURE__ */Qe(rl,{padded:!1,children:[
714
+ /* @__PURE__ */Qe(fl,{padded:!1,children:[
706
715
  /* @__PURE__ */Qe("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
707
- /* @__PURE__ */et("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */et(ct,{value:l,onChange:e=>i(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */et(rd,{})})}),
716
+ /* @__PURE__ */et("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */et(ct,{value:l,onChange:e=>i(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */et(fd,{})})}),
708
717
  /* @__PURE__ */et("div",{className:"w-40",children:/* @__PURE__ */et(Mt,{value:n,onChange:a,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
709
718
  /* @__PURE__ */et(T,{variant:"secondary",size:"sm",children:"Filter"})]}),
710
719
  /* @__PURE__ */Qe("table",{className:"w-full text-sm",children:[
@@ -713,7 +722,7 @@ return et(qt,{groups:Qc,children:/* @__PURE__ */et("div",{className:"h-full over
713
722
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Role"}),
714
723
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium`,children:"Status"}),
715
724
  /* @__PURE__ */et("th",{className:`${r} px-4 py-2 font-medium text-right`,children:"Actions"})]})}),
716
- /* @__PURE__ */et("tbody",{className:"divide-y divide-gray-100",children:ed.map(e=>/* @__PURE__ */Qe("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
725
+ /* @__PURE__ */et("tbody",{className:"divide-y divide-gray-100",children:pd.map(e=>/* @__PURE__ */Qe("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
717
726
  /* @__PURE__ */Qe("td",{className:"px-4 py-3",children:[
718
727
  /* @__PURE__ */et("div",{className:"font-medium text-gray-900",children:e.name}),
719
728
  /* @__PURE__ */et("div",{className:"text-xs text-gray-400",children:e.email})]}),
@@ -722,19 +731,19 @@ return et(qt,{groups:Qc,children:/* @__PURE__ */et("div",{className:"h-full over
722
731
  /* @__PURE__ */et("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */et(T,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
723
732
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
724
733
  /* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
725
- /* @__PURE__ */et(Hs,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function rd(){/* @__PURE__ */
726
- return et(ue,{name:"search",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}function nd(){const[e,t]=Oe("pro"),[r,n]=Oe(!0),[a,l]=Oe("us");/* @__PURE__ */
734
+ /* @__PURE__ */et(lc,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function fd(){/* @__PURE__ */
735
+ return et(ue,{name:"search",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}function bd(){const[e,t]=Oe("pro"),[r,n]=Oe(!0),[a,l]=Oe("us");/* @__PURE__ */
727
736
  return et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
728
737
  /* @__PURE__ */Qe("div",{children:[
729
738
  /* @__PURE__ */et("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
730
739
  /* @__PURE__ */et("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
731
- /* @__PURE__ */et(rl,{header:"Profile",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
740
+ /* @__PURE__ */et(fl,{header:"Profile",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
732
741
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
733
742
  /* @__PURE__ */et(At,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */et(ct,{id:"fn",defaultValue:"Alice"})}),
734
743
  /* @__PURE__ */et(At,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */et(ct,{id:"ln",defaultValue:"Nguyen"})})]}),
735
744
  /* @__PURE__ */et(At,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */et(ct,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
736
745
  /* @__PURE__ */et(At,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */et(dt,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
737
- /* @__PURE__ */et(rl,{header:"Preferences",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
746
+ /* @__PURE__ */et(fl,{header:"Preferences",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
738
747
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
739
748
  /* @__PURE__ */et(At,{label:"Country",htmlFor:"country",children:/* @__PURE__ */et(Mt,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
740
749
  /* @__PURE__ */et(At,{label:"Plan",children:/* @__PURE__ */Qe("div",{className:"space-y-2 pt-1",children:[
@@ -744,13 +753,13 @@ return et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
744
753
  /* @__PURE__ */et(Lt,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
745
754
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-end gap-2",children:[
746
755
  /* @__PURE__ */et(T,{variant:"secondary",children:"Cancel"}),
747
- /* @__PURE__ */et(T,{type:"submit",children:"Save changes"})]})]})})}var ad=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function ld(){const[e,t]=Oe(!0),[r,n]=Oe("us"),a=ad.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
756
+ /* @__PURE__ */et(T,{type:"submit",children:"Save changes"})]})]})})}var yd=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function xd(){const[e,t]=Oe(!0),[r,n]=Oe("us"),a=yd.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
748
757
  return et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-5xl space-y-5",children:[
749
758
  /* @__PURE__ */et("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
750
759
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
751
760
  /* @__PURE__ */Qe("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
752
- /* @__PURE__ */et(rl,{header:"Contact",children:/* @__PURE__ */et("div",{className:"space-y-4",children:/* @__PURE__ */et(At,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */et(ct,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
753
- /* @__PURE__ */et(rl,{header:"Shipping address",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
761
+ /* @__PURE__ */et(fl,{header:"Contact",children:/* @__PURE__ */et("div",{className:"space-y-4",children:/* @__PURE__ */et(At,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */et(ct,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
762
+ /* @__PURE__ */et(fl,{header:"Shipping address",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
754
763
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
755
764
  /* @__PURE__ */et(At,{label:"First name",required:!0,children:/* @__PURE__ */et(ct,{placeholder:"Alice"})}),
756
765
  /* @__PURE__ */et(At,{label:"Last name",required:!0,children:/* @__PURE__ */et(ct,{placeholder:"Nguyen"})})]}),
@@ -760,14 +769,14 @@ return et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
760
769
  /* @__PURE__ */et(At,{label:"ZIP",children:/* @__PURE__ */et(ct,{placeholder:"94103"})}),
761
770
  /* @__PURE__ */et(At,{label:"Country",children:/* @__PURE__ */et(Mt,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
762
771
  /* @__PURE__ */et(Lt,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
763
- /* @__PURE__ */et(rl,{header:"Payment",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
772
+ /* @__PURE__ */et(fl,{header:"Payment",children:/* @__PURE__ */Qe("div",{className:"space-y-4",children:[
764
773
  /* @__PURE__ */et(At,{label:"Card number",required:!0,children:/* @__PURE__ */et(ct,{placeholder:"1234 5678 9012 3456"})}),
765
774
  /* @__PURE__ */Qe("div",{className:"grid grid-cols-2 gap-4",children:[
766
775
  /* @__PURE__ */et(At,{label:"Expiry",required:!0,children:/* @__PURE__ */et(ct,{placeholder:"MM / YY"})}),
767
776
  /* @__PURE__ */et(At,{label:"CVC",required:!0,children:/* @__PURE__ */et(ct,{placeholder:"123"})})]})]})})]}),
768
777
  /* @__PURE__ */Qe("div",{className:"space-y-4",children:[
769
- /* @__PURE__ */Qe(rl,{header:"Order summary",children:[
770
- /* @__PURE__ */et("ul",{className:"space-y-2 text-sm",children:ad.map(e=>/* @__PURE__ */Qe("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
778
+ /* @__PURE__ */Qe(fl,{header:"Order summary",children:[
779
+ /* @__PURE__ */et("ul",{className:"space-y-2 text-sm",children:yd.map(e=>/* @__PURE__ */Qe("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
771
780
  /* @__PURE__ */Qe("span",{children:[e.name," ",
772
781
  /* @__PURE__ */Qe("span",{className:"text-gray-400",children:["×",e.qty]})]}),
773
782
  /* @__PURE__ */Qe("span",{children:["$",e.qty*e.price]})]},e.name))}),
@@ -782,11 +791,11 @@ return et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
782
791
  /* @__PURE__ */et("span",{children:"Total"}),
783
792
  /* @__PURE__ */Qe("span",{children:["$",l]})]})]}),
784
793
  /* @__PURE__ */Qe(T,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
785
- /* @__PURE__ */et(ri,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var id=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],od=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function sd(){const[e,t]=Oe(1),r=od.find(t=>t.id===e)??od[0];/* @__PURE__ */
794
+ /* @__PURE__ */et(fi,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var vd=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],wd=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function Nd(){const[e,t]=Oe(1),r=wd.find(t=>t.id===e)??wd[0];/* @__PURE__ */
786
795
  return et("div",{className:"h-full",children:/* @__PURE__ */et(u,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */Qe("div",{className:"flex h-full flex-col p-2",children:[
787
- /* @__PURE__ */et(T,{block:!0,className:"mb-2",children:"Compose"}),id.map((e,t)=>/* @__PURE__ */Qe("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
796
+ /* @__PURE__ */et(T,{block:!0,className:"mb-2",children:"Compose"}),vd.map((e,t)=>/* @__PURE__ */Qe("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
788
797
  /* @__PURE__ */et("span",{children:e.label}),null!=e.count&&/* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */Qe("div",{className:"flex h-full",children:[
789
- /* @__PURE__ */et("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:od.map(r=>/* @__PURE__ */Qe("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
798
+ /* @__PURE__ */et("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:wd.map(r=>/* @__PURE__ */Qe("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
790
799
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2",children:[
791
800
  /* @__PURE__ */et("span",{className:"truncate text-sm "+(r.unread?"font-semibold text-gray-900":"text-gray-700"),children:r.from}),
792
801
  /* @__PURE__ */et("span",{className:"shrink-0 text-2xs text-gray-400",children:r.time})]}),
@@ -799,7 +808,7 @@ return et("div",{className:"h-full",children:/* @__PURE__ */et(u,{side:"left",de
799
808
  /* @__PURE__ */et(T,{variant:"ghost",size:"sm",children:"Archive"}),
800
809
  /* @__PURE__ */et(T,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
801
810
  /* @__PURE__ */Qe("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
802
- /* @__PURE__ */et(Jl,{name:r.from}),
811
+ /* @__PURE__ */et(ui,{name:r.from}),
803
812
  /* @__PURE__ */Qe("div",{className:"min-w-0",children:[
804
813
  /* @__PURE__ */et("div",{className:"text-sm font-medium text-gray-900",children:r.from}),
805
814
  /* @__PURE__ */Qe("div",{className:"text-xs text-gray-400",children:["to me · ",r.time]})]})]}),
@@ -807,232 +816,232 @@ return et("div",{className:"h-full",children:/* @__PURE__ */et(u,{side:"left",de
807
816
  /* @__PURE__ */et("p",{children:"Hi,"}),
808
817
  /* @__PURE__ */Qe("p",{children:[r.preview," The full details are attached — happy to walk through anything on a quick call."]}),
809
818
  /* @__PURE__ */Qe("p",{children:["Best,",
810
- /* @__PURE__ */et("br",{}),r.from]})]})]})]})})})}var cd=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],dd=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function ud(){const[e,t]=Oe(1),r=cd.find(t=>t.id===e)??cd[0];/* @__PURE__ */
811
- return et("div",{className:"h-full",children:/* @__PURE__ */et(u,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */et("div",{className:"h-full overflow-auto",children:cd.map(r=>/* @__PURE__ */Qe("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
812
- /* @__PURE__ */et(Jl,{name:r.name,status:r.status}),
819
+ /* @__PURE__ */et("br",{}),r.from]})]})]})]})})})}var kd=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],$d=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function Md(){const[e,t]=Oe(1),r=kd.find(t=>t.id===e)??kd[0];/* @__PURE__ */
820
+ return et("div",{className:"h-full",children:/* @__PURE__ */et(u,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */et("div",{className:"h-full overflow-auto",children:kd.map(r=>/* @__PURE__ */Qe("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
821
+ /* @__PURE__ */et(ui,{name:r.name,status:r.status}),
813
822
  /* @__PURE__ */Qe("div",{className:"min-w-0 flex-1",children:[
814
823
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2",children:[
815
824
  /* @__PURE__ */et("span",{className:"truncate text-sm font-medium text-gray-900",children:r.name}),
816
825
  /* @__PURE__ */et("span",{className:"shrink-0 text-2xs text-gray-400",children:r.time})]}),
817
826
  /* @__PURE__ */et("div",{className:"truncate text-xs text-gray-500",children:r.last})]})]},r.id))}),children:/* @__PURE__ */Qe("div",{className:"flex h-full flex-col",children:[
818
827
  /* @__PURE__ */Qe("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
819
- /* @__PURE__ */et(Jl,{name:r.name,status:r.status,size:"sm"}),
828
+ /* @__PURE__ */et(ui,{name:r.name,status:r.status,size:"sm"}),
820
829
  /* @__PURE__ */Qe("div",{children:[
821
830
  /* @__PURE__ */et("div",{className:"text-sm font-medium text-gray-900",children:r.name}),
822
831
  /* @__PURE__ */et("div",{className:"text-xs text-gray-400 capitalize",children:r.status})]})]}),
823
- /* @__PURE__ */et("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:dd.map((e,t)=>/* @__PURE__ */et("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */et("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
832
+ /* @__PURE__ */et("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:$d.map((e,t)=>/* @__PURE__ */et("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */et("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
824
833
  /* @__PURE__ */Qe("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
825
834
  /* @__PURE__ */et("div",{className:"flex-1",children:/* @__PURE__ */et(ct,{placeholder:"Type a message…"})}),
826
- /* @__PURE__ */et(T,{type:"submit",children:"Send"})]})]})})})}var hd={featured:"success",new:"active",draft:"draft"},md=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function pd(){const[e,t]=Oe("all"),r="all"===e?md:md.filter(t=>t.tag===e);/* @__PURE__ */
827
- return et(qt,{groups:hd,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-5xl space-y-4",children:[
835
+ /* @__PURE__ */et(T,{type:"submit",children:"Send"})]})]})})})}var Cd={featured:"success",new:"active",draft:"draft"},Ld=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function Dd(){const[e,t]=Oe("all"),r="all"===e?Ld:Ld.filter(t=>t.tag===e);/* @__PURE__ */
836
+ return et(qt,{groups:Cd,children:/* @__PURE__ */et("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"mx-auto max-w-5xl space-y-4",children:[
828
837
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-4",children:[
829
838
  /* @__PURE__ */et("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
830
839
  /* @__PURE__ */et(T,{size:"sm",children:"Upload"})]}),
831
- /* @__PURE__ */et(oi,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
832
- /* @__PURE__ */et("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Qe(rl,{padded:!1,className:"overflow-hidden",children:[
840
+ /* @__PURE__ */et(wi,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
841
+ /* @__PURE__ */et("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Qe(fl,{padded:!1,className:"overflow-hidden",children:[
833
842
  /* @__PURE__ */et("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */et("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */et(Ut,{status:e.tag})})}),
834
843
  /* @__PURE__ */Qe("div",{className:"flex items-center justify-between gap-2 p-3",children:[
835
844
  /* @__PURE__ */et("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
836
- /* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var gd={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function fd({mode:e="login"}){const[t,r]=Oe(!0),n=gd[e];/* @__PURE__ */
845
+ /* @__PURE__ */et("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var Sd={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function Ad({mode:e="login"}){const[t,r]=Oe(!0),n=Sd[e];/* @__PURE__ */
837
846
  return et("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Qe("div",{className:"w-full max-w-sm",children:[
838
847
  /* @__PURE__ */Qe("div",{className:"mb-6 text-center",children:[
839
848
  /* @__PURE__ */et("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
840
849
  /* @__PURE__ */et("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
841
850
  /* @__PURE__ */et("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
842
- /* @__PURE__ */et(rl,{children:/* @__PURE__ */Qe("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */et(At,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */et(ct,{id:"au-name",placeholder:"Alice Nguyen"})}),
851
+ /* @__PURE__ */et(fl,{children:/* @__PURE__ */Qe("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */et(At,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */et(ct,{id:"au-name",placeholder:"Alice Nguyen"})}),
843
852
  /* @__PURE__ */et(At,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */et(ct,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */et(At,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */et(ct,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */Qe("div",{className:"flex items-center justify-between",children:[
844
853
  /* @__PURE__ */et(Lt,{checked:t,onChange:r,label:"Remember me"}),
845
854
  /* @__PURE__ */et("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
846
855
  /* @__PURE__ */et(T,{type:"submit",block:!0,children:n.cta})]})}),
847
856
  /* @__PURE__ */et("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */Qe(tt,"register"===e?{children:["Already have an account? ",
848
857
  /* @__PURE__ */et("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
849
- /* @__PURE__ */et("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var bd={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function xd({code:e=404,actions:t}){const r=bd[e](be().errors);/* @__PURE__ */
858
+ /* @__PURE__ */et("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var Pd={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function jd({code:e=404,actions:t}){const r=Pd[e](fe().errors);/* @__PURE__ */
850
859
  return Qe("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
851
860
  /* @__PURE__ */et("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
852
861
  /* @__PURE__ */et("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
853
- /* @__PURE__ */et("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */et("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function yd({pick:e}){/* @__PURE__ */
854
- return et(tt,{children:e(be().errors)})}var vd=class extends Xe{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),N(e),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
862
+ /* @__PURE__ */et("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */et("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function zd({pick:e}){/* @__PURE__ */
863
+ return et(tt,{children:e(fe().errors)})}var Fd=class extends Xe{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),N(e),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
855
864
  /* @__PURE__ */Qe("div",{className:"flex h-full flex-col",children:[
856
- /* @__PURE__ */et("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */et(xd,{code:500,actions:/* @__PURE__ */Qe(tt,{children:[
857
- /* @__PURE__ */et(T,{onClick:this.reset,children:/* @__PURE__ */et(yd,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Qe("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
858
- /* @__PURE__ */et("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */et(yd,{pick:e=>e.details})}),
859
- /* @__PURE__ */et("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function wd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Nd(e){const t=wd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function kd(){return wd()?.matches??!1}function $d(){return!1}function Md(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Cd(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Ld(e){const t=e||"system";return"system"===t?kd()?"dark":"light":t}function Dd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Md(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Cd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Cd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Cd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Cd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Cd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Cd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Cd(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Sd(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Md(a);l.style.setProperty("--custom-button-hover",Cd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Ad=["square","soft","round"];function Pd(e){return"square"===e||"round"===e?e:"soft"}var jd={pink:"round",grey:"square"};function zd(e,t,r){return r?"square"===t||"round"===t?t:"soft":jd[e]??"soft"}function Fd(e){const t=Pd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function Ed(e){const t="string"==typeof e&&e?e:null;he(t),t&&g(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Bd(e){const t=!!e.accent_color;"corners"in e&&Fd(zd(Ld(e.theme),e.corners,t)),"icon_set"in e&&Ed(f(Ld(e.theme),e.icon_set,t)),document.documentElement.setAttribute("data-theme",Ld(e.theme)),Dd(e.accent_color??null),Sd(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Id(){const{prefs:e}=w(),t=Je(Nd,kd,$d),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s=e.corners,c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r,u=zd(d,s,!!n);_e(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),_e(()=>(Fd(u),()=>document.documentElement.removeAttribute("data-corners")),[u]);const h=f(d,c,!!n);return _e(()=>(Ed(h),()=>Ed(null)),[h]),_e(()=>{Dd(n)},[n]),_e(()=>{Sd(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:u,iconSet:c}}function Td(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Od({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=h(),l=be().language;return n.length<2?null:/* @__PURE__ */Qe("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
865
+ /* @__PURE__ */et("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */et(jd,{code:500,actions:/* @__PURE__ */Qe(tt,{children:[
866
+ /* @__PURE__ */et(T,{onClick:this.reset,children:/* @__PURE__ */et(zd,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Qe("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
867
+ /* @__PURE__ */et("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */et(zd,{pick:e=>e.details})}),
868
+ /* @__PURE__ */et("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function Ed(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Id(e){const t=Ed();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Bd(){return Ed()?.matches??!1}function Td(){return!1}function Od(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Rd(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Wd(e){const t=e||"system";return"system"===t?Bd()?"dark":"light":t}function Kd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Od(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Rd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Rd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Rd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Rd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Rd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Rd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Rd(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function _d(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Od(a);l.style.setProperty("--custom-button-hover",Rd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var qd=["square","soft","round"];function Hd(e){return"square"===e||"round"===e?e:"soft"}var Ud={pink:"round",grey:"square"};function Vd(e,t,r){return r?"square"===t||"round"===t?t:"soft":Ud[e]??"soft"}function Yd(e){const t=Hd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function Gd(e){const t="string"==typeof e&&e?e:null;he(t),t&&g(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Xd(e){const t=!!e.accent_color;"corners"in e&&Yd(Vd(Wd(e.theme),e.corners,t)),"icon_set"in e&&Gd(f(Wd(e.theme),e.icon_set,t)),document.documentElement.setAttribute("data-theme",Wd(e.theme)),Kd(e.accent_color??null),_d(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Zd(){const{prefs:e}=w(),t=Ze(Id,Bd,Td),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s=e.corners,c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r,u=Vd(d,s,!!n);_e(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),_e(()=>(Yd(u),()=>document.documentElement.removeAttribute("data-corners")),[u]);const h=f(d,c,!!n);return _e(()=>(Gd(h),()=>Gd(null)),[h]),_e(()=>{Kd(n)},[n]),_e(()=>{_d(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:u,iconSet:c}}function Jd(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Qd({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=h(),l=fe().language;return n.length<2?null:/* @__PURE__ */Qe("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
860
869
  /* @__PURE__ */et(ue,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
861
- /* @__PURE__ */et("span",{className:"block",style:{width:`${Td(n.map(e=>e.name))}em`},children:/* @__PURE__ */et(Mt,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function Rd({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=h(),l=be().language;return n.length<2?null:/* @__PURE__ */Qe("div",{className:`space-y-4 ${t}`.trim(),children:[
870
+ /* @__PURE__ */et("span",{className:"block",style:{width:`${Jd(n.map(e=>e.name))}em`},children:/* @__PURE__ */et(Mt,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function eu({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=h(),l=fe().language;return n.length<2?null:/* @__PURE__ */Qe("div",{className:`space-y-4 ${t}`.trim(),children:[
862
871
  /* @__PURE__ */Qe("div",{children:[
863
872
  /* @__PURE__ */et("h3",{className:"text-sm font-semibold text-gray-900",children:l.title}),
864
873
  /* @__PURE__ */et("p",{className:"mt-0.5 text-sm text-gray-500",children:e??l.description})]}),
865
- /* @__PURE__ */et(jt,{name:"shell-language",value:r,onChange:e=>{a(e)},hint:l.reloadNote,options:n.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */et("span",{lang:e,children:t})}))})]})}function Wd({label:e="Not available"}){/* @__PURE__ */
866
- return et("span",{className:"text-gray-400",role:"img","aria-label":e,children:Pe})}function Kd({value:e,precise:t,locale:r,className:n}){const a=fe(),l=je(e);if(!l)/* @__PURE__ */return et(Wd,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
867
- return et("time",{dateTime:i,title:Fe(i,{locale:r??a}),className:n,children:ze(l,{precise:t,locale:r??a})})}function _d(e,t=300){const[r,n]=Oe(e);return _e(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function qd(e,t){_e(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function Hd(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function Ud(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const o=t>0?e.value/t*a:0,s=n?{...e,x:r.x,y:r.y+i,width:l,height:o}:{...e,x:r.x+i,y:r.y,width:o,height:l};return i+=o,s}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function Vd(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let o={x:0,y:0,width:t,height:r},s=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(o.width,o.height),r=o.width>=o.height,n=Hd(s.map(e=>e.value),c,t),a=Hd([...s.map(e=>e.value),e.value],c+e.value,t);if(0===s.length||a<=n)s.push(e),c+=e.value,d=d.slice(1);else{const e=Ud(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...Ud(s,c,o,o.width>=o.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}function Yd({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,labelFont:c="sans",className:d,emptyLabel:u}){const h=be().charts,m=fe(),p=r??(e=>we(e,m)),g=u??h.nothingToRank;if(0===e.length)/* @__PURE__ */
868
- return et("p",{className:`text-sm text-gray-500 ${d??""}`,children:g});const f=jc(e.map(e=>e.value),a),b=n??(null===f?void 0:e[f]?.key),x=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),y=sc(0);/* @__PURE__ */
869
- return et("ol",{className:`m-0 list-none p-0 ${d??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===b,n=r?l?ic[l]:sc(1):b?oc.muted:y,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&x>0?Math.max(0,Math.min(1,a/x)):0;/* @__PURE__ */
874
+ /* @__PURE__ */et(jt,{name:"shell-language",value:r,onChange:e=>{a(e)},hint:l.reloadNote,options:n.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */et("span",{lang:e,children:t})}))})]})}function tu({label:e="Not available"}){/* @__PURE__ */
875
+ return et("span",{className:"text-gray-400",role:"img","aria-label":e,children:Pe})}function ru({value:e,precise:t,locale:r,className:n}){const a=be(),l=je(e);if(!l)/* @__PURE__ */return et(tu,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
876
+ return et("time",{dateTime:i,title:Fe(i,{locale:r??a}),className:n,children:ze(l,{precise:t,locale:r??a})})}function nu(e,t=300){const[r,n]=Oe(e);return _e(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function au(e,t){_e(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function lu(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function iu(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const o=t>0?e.value/t*a:0,s=n?{...e,x:r.x,y:r.y+i,width:l,height:o}:{...e,x:r.x+i,y:r.y,width:o,height:l};return i+=o,s}),rest:n?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function ou(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let o={x:0,y:0,width:t,height:r},s=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(o.width,o.height),r=o.width>=o.height,n=lu(s.map(e=>e.value),c,t),a=lu([...s.map(e=>e.value),e.value],c+e.value,t);if(0===s.length||a<=n)s.push(e),c+=e.value,d=d.slice(1);else{const e=iu(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...iu(s,c,o,o.width>=o.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}function su({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,labelFont:c="sans",className:d,emptyLabel:u}){const h=fe().charts,m=be(),p=r??(e=>we(e,m)),g=u??h.nothingToRank;if(0===e.length)/* @__PURE__ */
877
+ return et("p",{className:`text-sm text-gray-500 ${d??""}`,children:g});const f=Uc(e.map(e=>e.value),a),b=n??(null===f?void 0:e[f]?.key),y=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=Nc(0);/* @__PURE__ */
878
+ return et("ol",{className:`m-0 list-none p-0 ${d??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===b,n=r?l?vc[l]:Nc(1):b?wc.muted:x,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&y>0?Math.max(0,Math.min(1,a/y)):0;/* @__PURE__ */
870
879
  return Qe("li",{className:"grid gap-1",children:[
871
880
  /* @__PURE__ */Qe("div",{className:"flex items-baseline justify-between gap-3",children:[
872
881
  /* @__PURE__ */Qe("span",{className:`truncate ${"mono"===c?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:e.label,children:[e.label,r&&/* @__PURE__ */et("span",{className:"sr-only",children:` ${h.emphasised}`})]}),
873
882
  /* @__PURE__ */et("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":p(a)})]}),
874
- /* @__PURE__ */et("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */et("div",{className:`rounded-sm ${s?_i.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?qi(t):{}}})})]},e.key)})})}var Gd=e=>Math.max(0,Math.min(1,e));function Xd({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=be().charts,d=fe(),u=l??(e=>ke(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
883
+ /* @__PURE__ */et("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */et("div",{className:`rounded-sm ${s?no.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?ao(t):{}}})})]},e.key)})})}var cu=e=>Math.max(0,Math.min(1,e));function du({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=fe().charts,d=be(),u=l??(e=>ke(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
875
884
  return Qe("div",{className:o,children:[n&&/* @__PURE__ */et("p",{className:"text-sm font-medium text-gray-700",children:n}),
876
- /* @__PURE__ */et("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=Gd(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=ic[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
885
+ /* @__PURE__ */et("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=cu(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=vc[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
877
886
  return Qe("div",{className:o,children:[
878
887
  /* @__PURE__ */Qe("div",{className:"mb-2 flex items-baseline justify-between gap-3",children:[
879
888
  /* @__PURE__ */et("span",{className:"text-sm font-medium text-gray-700",children:n}),
880
889
  /* @__PURE__ */et("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
881
890
  /* @__PURE__ */Qe("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":n,children:[
882
- /* @__PURE__ */et("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */et("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Gd(e.value)).toFixed(2)}%`,backgroundColor:ic[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */et("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*Gd(r)).toFixed(2)}%`,height:20,backgroundColor:oc.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */et("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var Jd={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function Zd({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=be().charts,d=fe(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?ic[a]:void 0,m=i?ic[i]:cc(0);/* @__PURE__ */
891
+ /* @__PURE__ */et("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */et("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*cu(e.value)).toFixed(2)}%`,backgroundColor:vc[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */et("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*cu(r)).toFixed(2)}%`,height:20,backgroundColor:wc.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */et("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var uu={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function hu({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=fe().charts,d=be(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?vc[a]:void 0,m=i?vc[i]:kc(0);/* @__PURE__ */
883
892
  return Qe("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
884
893
  /* @__PURE__ */et("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
885
894
  /* @__PURE__ */Qe("span",{className:"flex items-baseline gap-2",children:[
886
895
  /* @__PURE__ */et("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */et("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */Qe("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
887
- /* @__PURE__ */et("span",{"aria-hidden":"true",children:Jd[u].glyph})," ",we(Math.abs(n),d),
888
- /* @__PURE__ */Qe("span",{className:"sr-only",children:[" ",c[Jd[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */et(nc,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-2 w-full"}),o&&/* @__PURE__ */et("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function Qd({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
896
+ /* @__PURE__ */et("span",{"aria-hidden":"true",children:uu[u].glyph})," ",we(Math.abs(n),d),
897
+ /* @__PURE__ */Qe("span",{className:"sr-only",children:[" ",c[uu[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */et(bc,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-2 w-full"}),o&&/* @__PURE__ */et("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function mu({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
889
898
  return et("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
890
899
  return et("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
891
900
  return et("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
892
901
  return et("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
893
902
  return et("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
894
903
  return et("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
895
- return et("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function eu({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=Ac();/* @__PURE__ */
904
+ return et("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function pu({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=qc();/* @__PURE__ */
896
905
  return et("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,i)=>{const o=t&&null!==a&&a!==e.key,s=/* @__PURE__ */Qe(tt,{children:[
897
- /* @__PURE__ */et(Qd,{shape:e.swatch??r,colour:cc(i,e.color,e.tone)}),e.label]});/* @__PURE__ */
898
- return et("li",{className:"list-none",children:t||n?/* @__PURE__ */et("button",{type:"button",onClick:n?()=>n(e.key):void 0,"aria-pressed":n?Boolean(e.pressed):void 0,onMouseEnter:t?()=>l(e.key):void 0,onMouseLeave:t?()=>l(null):void 0,onFocus:t?()=>l(e.key):void 0,onBlur:t?()=>l(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(o?"opacity-40":""),children:s}):/* @__PURE__ */et("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function tu({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const g=be().charts;/* @__PURE__ */
899
- return et(Sc,{children:/* @__PURE__ */Qe("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${p??""}`,"aria-busy":l||i||void 0,children:[
906
+ /* @__PURE__ */et(mu,{shape:e.swatch??r,colour:kc(i,e.color,e.tone)}),e.label]});/* @__PURE__ */
907
+ return et("li",{className:"list-none",children:t||n?/* @__PURE__ */et("button",{type:"button",onClick:n?()=>n(e.key):void 0,"aria-pressed":n?Boolean(e.pressed):void 0,onMouseEnter:t?()=>l(e.key):void 0,onMouseLeave:t?()=>l(null):void 0,onFocus:t?()=>l(e.key):void 0,onBlur:t?()=>l(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(o?"opacity-40":""),children:s}):/* @__PURE__ */et("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function gu({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const g=fe().charts;/* @__PURE__ */
908
+ return et(_c,{children:/* @__PURE__ */Qe("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${p??""}`,"aria-busy":l||i||void 0,children:[
900
909
  /* @__PURE__ */Qe("header",{className:"flex items-start justify-between gap-4",children:[
901
910
  /* @__PURE__ */Qe("div",{className:"min-w-0",children:[
902
- /* @__PURE__ */et("h3",{className:"text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */et("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),h&&/* @__PURE__ */et("div",{className:"shrink-0",children:h})]}),i?/* @__PURE__ */et(Lc,{variant:o,height:s}):/* @__PURE__ */et("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:m}),!i&&r&&r.length>1&&/* @__PURE__ */et(eu,{entries:r,interactive:c,fallbackSwatch:d,onClick:u}),!i&&n&&/* @__PURE__ */Qe("details",{className:"border-t border-gray-100 pt-3",children:[
911
+ /* @__PURE__ */et("h3",{className:"text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */et("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),h&&/* @__PURE__ */et("div",{className:"shrink-0",children:h})]}),i?/* @__PURE__ */et(Wc,{variant:o,height:s}):/* @__PURE__ */et("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:m}),!i&&r&&r.length>1&&/* @__PURE__ */et(pu,{entries:r,interactive:c,fallbackSwatch:d,onClick:u}),!i&&n&&/* @__PURE__ */Qe("details",{className:"border-t border-gray-100 pt-3",children:[
903
912
  /* @__PURE__ */et("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??g.showTable}),
904
- /* @__PURE__ */et("div",{className:"mt-3 overflow-x-auto",style:{color:oc.label},children:n})]})]})})}function ru({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,o="border"===n?3:3.5;/* @__PURE__ */
905
- return Qe("g",{children:[a&&/* @__PURE__ */et("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */et("circle",{cx:e,cy:t,r:o+i,fill:oc.surface}),
906
- /* @__PURE__ */et("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?oc.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */et("title",{children:l})})]})}function nu({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=be().charts,c=Re(null),d=e.length-1,[u,h]=r,m=i??cc(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),x=e=>a-e/b*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${x(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=Re(null),$=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},M=e=>t=>{k.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
913
+ /* @__PURE__ */et("div",{className:"mt-3 overflow-x-auto",style:{color:wc.label},children:n})]})]})})}function fu({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,o="border"===n?3:3.5;/* @__PURE__ */
914
+ return Qe("g",{children:[a&&/* @__PURE__ */et("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */et("circle",{cx:e,cy:t,r:o+i,fill:wc.surface}),
915
+ /* @__PURE__ */et("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?wc.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */et("title",{children:l})})]})}function bu({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=fe().charts,c=Re(null),d=e.length-1,[u,h]=r,m=i??kc(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),y=e=>a-e/b*(a-6),x=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=x[x.length-1];n&&n.to===r-1?n.to=r:x.push({from:r,to:r})});const v=x.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${y(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=Re(null),$=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},M=e=>t=>{k.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
907
916
  return et("rect",{x:p(r)-4.5,y:0,width:9,height:a,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?s.windowStart:s.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:N(t),onPointerDown:$(t),onPointerMove:M(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
908
917
  return et("div",{className:o,children:/* @__PURE__ */Qe("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":s.window(e[u],e[h],e.length),children:[
909
- /* @__PURE__ */et("path",{d:v,fill:oc.grid}),
910
- /* @__PURE__ */et("rect",{x:0,y:0,width:p(u),height:a,fill:oc.surface,fillOpacity:.72}),
911
- /* @__PURE__ */et("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:oc.surface,fillOpacity:.72}),
912
- /* @__PURE__ */et("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var au=12,lu=16,iu=26,ou=52,su=e=>"number"==typeof e&&Number.isFinite(e);function cu({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:x=!1,brush:y=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const A=be().charts,P=fe(),j=d??(e=>we(e,P)),z=u??j,F=S??A.noData,E=Re(null),B=$c(E),I=L??B,[T,O]=Oe(null),[R,W]=Oe(null),{highlighted:K}=Ac(),_=We();if(_e(()=>{if(null!==T)return te(e=>"Escape"===e.key&&(O(null),!0))},[T]),N)/* @__PURE__ */
913
- return et("div",{className:D,ref:E,children:/* @__PURE__ */et(Lc,{height:r,width:L??B})});const q=t,H=v??R??[0,Math.max(0,q.length-1)],[U,V]=H,Y=e=>y?e.slice(U,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(su)).map(e=>({...e,data:Y(e.data)}));if(t=Y(q),0===G.length||0===t.length)/* @__PURE__ */
914
- return et("div",{className:D,ref:E,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(su(r.data[t])?r.data[t]:0),0)),J=(e,t)=>X[t]>0?e/X[t]:null,Z=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(su(t.data[r])?t.data[r]:0)),Z.push("percent"===a?e.map((e,t)=>J(e,t)):[...e])}const Q=!!l&&l.length>0,ee=e=>"right"===e.axis,re=!n&&!Q&&void 0===s&&G.some(ee)&&G.some(e=>!ee(e)),ne=re?G.filter(e=>!ee(e)):G,ae=re?G.filter(ee).flatMap(e=>e.data.filter(su)):[],le=n?(Z.at(-1)??[]).filter(su):ne.flatMap(e=>e.data.filter(su)),ie=re?xc([Math.min(0,...le),Math.max(0,...le)],[Math.min(0,...ae),Math.max(0,...ae)],{intervals:c+1,integerLeft:le.every(Number.isInteger),integerRight:ae.every(Number.isInteger)}):null,oe=ie?ie.left:n&&"percent"===a||Q||void 0!==s?null:bc(n?0:Math.min(0,...le),Math.max(0,...le),{intervals:c+1,integer:le.every(Number.isInteger)}),se=oe?oe.lo:0,ce=n&&"percent"===a?1:oe?oe.hi:s??fc(Math.max(...le,0)),de=n&&"percent"===a?e=>ke(Math.round(100*e),0,P):j,ue=Q?l:oe?oe.ticks:mc([se,ce],{from:0,to:1}).ticks(c+1),he=kc(ue.map(de),ou),me=ie?kc(ie.right.ticks.map(j),lu):lu,pe={left:he,right:Math.max(he+1,I-me),top:au,bottom:r-iu},ge=pc(t.length,{from:pe.left,to:pe.right}),xe=Q?gc(l,{from:pe.bottom,to:pe.top}):null,ye=mc([se,ce],{from:pe.bottom,to:pe.top}),ve=ye(Math.max(se,0)),Ne=e=>xe?xe(e):ye(e),$e=ie?mc([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,Me=e=>$e&&ee(e)?$e:Ne,Ce=xe?xe.levels.map(e=>({value:e,y:xe(e)})):ue.map(e=>({value:e,y:ye(e)})),Le=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},De=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(I/96))));/* @__PURE__ */
918
+ /* @__PURE__ */et("path",{d:v,fill:wc.grid}),
919
+ /* @__PURE__ */et("rect",{x:0,y:0,width:p(u),height:a,fill:wc.surface,fillOpacity:.72}),
920
+ /* @__PURE__ */et("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:wc.surface,fillOpacity:.72}),
921
+ /* @__PURE__ */et("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var yu=12,xu=16,vu=26,wu=52,Nu=e=>"number"==typeof e&&Number.isFinite(e);function ku({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const A=fe().charts,P=be(),j=d??(e=>we(e,P)),z=u??j,F=S??A.noData,E=Re(null),I=Tc(E),B=L??I,[T,O]=Oe(null),[R,W]=Oe(null),{highlighted:K}=qc(),_=We();if(_e(()=>{if(null!==T)return te(e=>"Escape"===e.key&&(O(null),!0))},[T]),N)/* @__PURE__ */
922
+ return et("div",{className:D,ref:E,children:/* @__PURE__ */et(Wc,{height:r,width:L??I})});const q=t,H=v??R??[0,Math.max(0,q.length-1)],[U,V]=H,Y=e=>x?e.slice(U,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Nu)).map(e=>({...e,data:Y(e.data)}));if(t=Y(q),0===G.length||0===t.length)/* @__PURE__ */
923
+ return et("div",{className:D,ref:E,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(Nu(r.data[t])?r.data[t]:0),0)),Z=(e,t)=>X[t]>0?e/X[t]:null,J=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(Nu(t.data[r])?t.data[r]:0)),J.push("percent"===a?e.map((e,t)=>Z(e,t)):[...e])}const Q=!!l&&l.length>0,ee=e=>"right"===e.axis,re=!n&&!Q&&void 0===s&&G.some(ee)&&G.some(e=>!ee(e)),ne=re?G.filter(e=>!ee(e)):G,ae=re?G.filter(ee).flatMap(e=>e.data.filter(Nu)):[],le=n?(J.at(-1)??[]).filter(Nu):ne.flatMap(e=>e.data.filter(Nu)),ie=re?jc([Math.min(0,...le),Math.max(0,...le)],[Math.min(0,...ae),Math.max(0,...ae)],{intervals:c+1,integerLeft:le.every(Number.isInteger),integerRight:ae.every(Number.isInteger)}):null,oe=ie?ie.left:n&&"percent"===a||Q||void 0!==s?null:Pc(n?0:Math.min(0,...le),Math.max(0,...le),{intervals:c+1,integer:le.every(Number.isInteger)}),se=oe?oe.lo:0,ce=n&&"percent"===a?1:oe?oe.hi:s??Ac(Math.max(...le,0)),de=n&&"percent"===a?e=>ke(Math.round(100*e),0,P):j,ue=Q?l:oe?oe.ticks:Lc([se,ce],{from:0,to:1}).ticks(c+1),he=Bc(ue.map(de),wu),me=ie?Bc(ie.right.ticks.map(j),xu):xu,pe={left:he,right:Math.max(he+1,B-me),top:yu,bottom:r-vu},ge=Dc(t.length,{from:pe.left,to:pe.right}),ye=Q?Sc(l,{from:pe.bottom,to:pe.top}):null,xe=Lc([se,ce],{from:pe.bottom,to:pe.top}),ve=xe(Math.max(se,0)),Ne=e=>ye?ye(e):xe(e),$e=ie?Lc([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,Me=e=>$e&&ee(e)?$e:Ne,Ce=ye?ye.levels.map(e=>({value:e,y:ye(e)})):ue.map(e=>({value:e,y:xe(e)})),Le=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},De=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(B/96))));/* @__PURE__ */
915
924
  return Qe("div",{className:`relative ${D??""}`,ref:E,children:[
916
- /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${I} ${r}`,role:"img","aria-label":A.overIntervals(G.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{"ArrowRight"===e.key&&Le(1)(e),"ArrowLeft"===e.key&&Le(-1)(e)},children:[
925
+ /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":A.overIntervals(G.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{"ArrowRight"===e.key&&Le(1)(e),"ArrowLeft"===e.key&&Le(-1)(e)},children:[
917
926
  /* @__PURE__ */et("defs",{children:/* @__PURE__ */et("clipPath",{id:_,children:/* @__PURE__ */et("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
918
- /* @__PURE__ */et(Wi,{id:_,fills:G.map((e,t)=>({color:cc(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),Ce.map(e=>/* @__PURE__ */et("line",{x1:pe.left,y1:e.y,x2:pe.right,y2:e.y,stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
919
- /* @__PURE__ */et("line",{x1:pe.left,y1:ve,x2:pe.right,y2:ve,stroke:oc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Ce.map(e=>/* @__PURE__ */et("text",{x:pe.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e.value)},`ytick-${e.value}`)),ie&&Ce.map((e,t)=>/* @__PURE__ */et("text",{x:pe.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(ie.right.ticks[t])},`ytick-r-${e.value}`)),m&&/* @__PURE__ */et("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:m}),
920
- /* @__PURE__ */et("g",{clipPath:`url(#${_})`,mask:k&&$?`url(#${Ei(_)})`:void 0,children:G.map((e,r)=>{const a=cc(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Pc(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:ge(r),end:ge.end(r),value:e.data[r]})).filter(e=>su(e.value)).map(t=>({start:t.start,end:t.end,y:Me(e)(t.value)}));/* @__PURE__ */
921
- return et("path",{d:Ic(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?Z[r]?.[a]:e.data[a];return su(l)?[ge.center(a),Me(e)(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*ge.bandwidth),i="solid"===e.fillVariant,o=Me(e);/* @__PURE__ */
922
- return et("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?Z[r]?.[s]:e.data[s];if(!su(c))return null;const d=o(c);/* @__PURE__ */
923
- return et("rect",{x:ge.center(s)-l/2,y:Math.min(d,ve),width:l,height:Math.abs(ve-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?_i.rise:void 0,style:k?qi(s,26):void 0},s)})},e.key)}const d=Wc(c,i,o),u=n&&r>0?t.map((e,t)=>[ge.center(t),Ne(Z[r-1]?.[t]??0)-2]):null,h=u?_c(d,u):Kc(d,c,ve);/* @__PURE__ */
927
+ /* @__PURE__ */et(to,{id:_,fills:G.map((e,t)=>({color:kc(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),Ce.map(e=>/* @__PURE__ */et("line",{x1:pe.left,y1:e.y,x2:pe.right,y2:e.y,stroke:wc.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
928
+ /* @__PURE__ */et("line",{x1:pe.left,y1:ve,x2:pe.right,y2:ve,stroke:wc.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Ce.map(e=>/* @__PURE__ */et("text",{x:pe.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e.value)},`ytick-${e.value}`)),ie&&Ce.map((e,t)=>/* @__PURE__ */et("text",{x:pe.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(ie.right.ticks[t])},`ytick-r-${e.value}`)),m&&/* @__PURE__ */et("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:wc.label,children:m}),
929
+ /* @__PURE__ */et("g",{clipPath:`url(#${_})`,mask:k&&$?`url(#${Gi(_)})`:void 0,children:G.map((e,r)=>{const a=kc(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Hc(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:ge(r),end:ge.end(r),value:e.data[r]})).filter(e=>Nu(e.value)).map(t=>({start:t.start,end:t.end,y:Me(e)(t.value)}));/* @__PURE__ */
930
+ return et("path",{d:Zc(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?J[r]?.[a]:e.data[a];return Nu(l)?[ge.center(a),Me(e)(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*ge.bandwidth),i="solid"===e.fillVariant,o=Me(e);/* @__PURE__ */
931
+ return et("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?J[r]?.[s]:e.data[s];if(!Nu(c))return null;const d=o(c);/* @__PURE__ */
932
+ return et("rect",{x:ge.center(s)-l/2,y:Math.min(d,ve),width:l,height:Math.abs(ve-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?no.rise:void 0,style:k?ao(s,26):void 0},s)})},e.key)}const d=td(c,i,o),u=n&&r>0?t.map((e,t)=>[ge.center(t),Ne(J[r-1]?.[t]??0)-2]):null,h=u?nd(d,u):rd(d,c,ve);/* @__PURE__ */
924
933
  return Qe("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
925
- /* @__PURE__ */et("path",{d:h,fill:Ii(_,r,e.fillVariant??M,a),stroke:"none"}),
926
- /* @__PURE__ */et("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Ti(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?_i.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??ic[e.tone??"critical"],n=Ne(e.value);/* @__PURE__ */
934
+ /* @__PURE__ */et("path",{d:h,fill:Zi(_,r,e.fillVariant??M,a),stroke:"none"}),
935
+ /* @__PURE__ */et("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Ji(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?no.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??vc[e.tone??"critical"],n=Ne(e.value);/* @__PURE__ */
927
936
  return Qe("g",{children:[
928
- /* @__PURE__ */et("line",{x1:pe.left,y1:n,x2:pe.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */et("text",{x:pe.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=f??(g?"last":"none"),l=cc(e.slot,e.color,e.tone),i=[...e.data].map(su).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>su(n?Z[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
929
- return Qe("g",{children:[o.map(a=>{const o=n?Z[r]?.[a]:e.data[a];return su(o)?/* @__PURE__ */et(ru,{cx:ge.center(a),cy:Me(e)(o),color:l,variant:b,pulse:x&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&su(n?Z[r]?.[i]:e.data[i])&&/* @__PURE__ */et("text",{x:ge.center(i)-10,y:Me(e)(n?Z[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?Z[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%De===0?/* @__PURE__ */et("text",{x:ge.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==T&&/* @__PURE__ */et("line",{x1:ge.center(T),y1:pe.top,x2:ge.center(T),y2:pe.bottom,stroke:oc.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */et("rect",{x:ge(t),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),y&&q.length>2&&/* @__PURE__ */et(nu,{className:"mt-1",labels:q,width:I,data:e[0]?.data??[],range:H,onRangeChange:e=>{w?w(e):W(e)}}),null!==T&&
930
- /* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 z-10",style:Mc(ge.center(T),ge.bandwidth,I),children:/* @__PURE__ */et(zc,{title:h?.[T]??t[T],rows:G.map((e,t)=>({key:e.key,label:e.label,color:cc(e.slot,e.color,e.tone),value:su(e.data[T])?n&&"percent"===a?`${ke(100*(J(e.data[T],T)??0),1,P)} · ${z(e.data[T])}`:z(e.data[T]):void 0})),footnote:n&&"percent"===a?A.inBucket(z(X[T])):void 0})})]})}var du=3;function uu({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=be().charts,g=fe(),f=l??(e=>we(e,g)),b=i??(e=>we(e,g)),x=m??p.noObservations,y=Re(null),v=$c(y),w=r??v,N=We(),[k,$]=Oe(null);_e(()=>{if(null!==k)return te(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,o)&&M(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
931
- return et("div",{className:h,ref:y,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const S=L.flatMap(e=>e.points),A=S.some(e=>null!=e.size),P=14,j=20,z=34,F=52,E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,fc(Math.max(...e))];return"log"===r?yc(i,n):mc(i,n)},B=E(S.map(e=>e.y),s,d,{from:t-z,to:P}),I=kc(B.ticks(5).map(b),F),T=Math.max(I+1,w-j),O=E(S.map(e=>e.x),o,c,{from:I,to:T}),R=wc([0,Math.max(...S.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=k?L[k.s]:void 0,K=k&&W?W.points[k.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
932
- return Qe("div",{className:`relative ${h??""}`,ref:y,children:[
937
+ /* @__PURE__ */et("line",{x1:pe.left,y1:n,x2:pe.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */et("text",{x:pe.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=f??(g?"last":"none"),l=kc(e.slot,e.color,e.tone),i=[...e.data].map(Nu).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>Nu(n?J[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
938
+ return Qe("g",{children:[o.map(a=>{const o=n?J[r]?.[a]:e.data[a];return Nu(o)?/* @__PURE__ */et(fu,{cx:ge.center(a),cy:Me(e)(o),color:l,variant:b,pulse:y&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&Nu(n?J[r]?.[i]:e.data[i])&&/* @__PURE__ */et("text",{x:ge.center(i)-10,y:Me(e)(n?J[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?J[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%De===0?/* @__PURE__ */et("text",{x:ge.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==T&&/* @__PURE__ */et("line",{x1:ge.center(T),y1:pe.top,x2:ge.center(T),y2:pe.bottom,stroke:wc.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */et("rect",{x:ge(t),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),x&&q.length>2&&/* @__PURE__ */et(bu,{className:"mt-1",labels:q,width:B,data:e[0]?.data??[],range:H,onRangeChange:e=>{w?w(e):W(e)}}),null!==T&&
939
+ /* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 z-10",style:Oc(ge.center(T),ge.bandwidth,B),children:/* @__PURE__ */et(Vc,{title:h?.[T]??t[T],rows:G.map((e,t)=>({key:e.key,label:e.label,color:kc(e.slot,e.color,e.tone),value:Nu(e.data[T])?n&&"percent"===a?`${ke(100*(Z(e.data[T],T)??0),1,P)} · ${z(e.data[T])}`:z(e.data[T]):void 0})),footnote:n&&"percent"===a?A.inBucket(z(X[T])):void 0})})]})}var $u=3;function Mu({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=fe().charts,g=be(),f=l??(e=>we(e,g)),b=i??(e=>we(e,g)),y=m??p.noObservations,x=Re(null),v=Tc(x),w=r??v,N=We(),[k,$]=Oe(null);_e(()=>{if(null!==k)return te(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,o)&&M(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
940
+ return et("div",{className:h,ref:x,children:/* @__PURE__ */et("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const S=L.flatMap(e=>e.points),A=S.some(e=>null!=e.size),P=14,j=20,z=34,F=52,E=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,Ac(Math.max(...e))];return"log"===r?zc(i,n):Lc(i,n)},I=E(S.map(e=>e.y),s,d,{from:t-z,to:P}),B=Bc(I.ticks(5).map(b),F),T=Math.max(B+1,w-j),O=E(S.map(e=>e.x),o,c,{from:B,to:T}),R=Ec([0,Math.max(...S.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=k?L[k.s]:void 0,K=k&&W?W.points[k.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
941
+ return Qe("div",{className:`relative ${h??""}`,ref:x,children:[
933
942
  /* @__PURE__ */Qe("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(D>0?`. ${p.outsideRange(D)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?_.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(_[Math.min(_.length-1,Math.max(0,r+t))])},children:[
934
- /* @__PURE__ */et("defs",{children:/* @__PURE__ */et("clipPath",{id:N,children:/* @__PURE__ */et("rect",{x:I-u[1],y:P-u[1],width:T-I+2*u[1],height:t-z-P+2*u[1]})})}),B.ticks(5).map(e=>/* @__PURE__ */Qe("g",{children:[
935
- /* @__PURE__ */et("line",{x1:I,y1:B(e),x2:T,y2:B(e),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
936
- /* @__PURE__ */et("text",{x:I-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */et("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */et("text",{x:(I+T)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:oc.label,children:n}),a&&/* @__PURE__ */et("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:oc.label,children:a}),
937
- /* @__PURE__ */et("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=hc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */et("circle",{cx:O(n.x),cy:B(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:oc.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&W&&K&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:K.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:hc(W.slot,3,W.color,W.tone),value:f(K.x)},{key:"y",label:a??p.yAxis,color:hc(W.slot,3,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:oc.muted,value:we(K.size,g)}]:[]],footnote:K.label?W.label:void 0})})]})}function hu({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=be().charts,b=fe(),x=s??(e=>we(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=cc(0,d,u);/* @__PURE__ */
938
- return et(Cc,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */et(zc,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */et("g",{children:e.map((e,r)=>/* @__PURE__ */et("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */Qe("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
943
+ /* @__PURE__ */et("defs",{children:/* @__PURE__ */et("clipPath",{id:N,children:/* @__PURE__ */et("rect",{x:B-u[1],y:P-u[1],width:T-B+2*u[1],height:t-z-P+2*u[1]})})}),I.ticks(5).map(e=>/* @__PURE__ */Qe("g",{children:[
944
+ /* @__PURE__ */et("line",{x1:B,y1:I(e),x2:T,y2:I(e),stroke:wc.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
945
+ /* @__PURE__ */et("text",{x:B-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */et("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */et("text",{x:(B+T)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:wc.label,children:n}),a&&/* @__PURE__ */et("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:wc.label,children:a}),
946
+ /* @__PURE__ */et("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=Cc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */et("circle",{cx:O(n.x),cy:I(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:wc.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&W&&K&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:K.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:Cc(W.slot,3,W.color,W.tone),value:f(K.x)},{key:"y",label:a??p.yAxis,color:Cc(W.slot,3,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:wc.muted,value:we(K.size,g)}]:[]],footnote:K.label?W.label:void 0})})]})}function Cu({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=fe().charts,b=be(),y=s??(e=>we(e,b)),x=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=kc(0,d,u);/* @__PURE__ */
947
+ return et(Rc,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:y,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(x,t.length),tooltip:r=>/* @__PURE__ */et(Vc,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:y(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:y(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */et("g",{children:e.map((e,r)=>/* @__PURE__ */et("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */Qe("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
939
948
  return Qe(tt,{children:[
940
- /* @__PURE__ */et("path",{d:_c(Wc(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
941
- /* @__PURE__ */et("path",{d:Wc(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
942
- /* @__PURE__ */et("path",{d:Wc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */et("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:oc.axis,strokeWidth:1})]})})}function mu({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=be().charts,d=fe(),u=n??(e=>we(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
943
- return et(Cc,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?ic.neutral:t.value>=0?ic.good:ic.critical;/* @__PURE__ */
944
- return et(zc,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:ic.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */Qe("g",{children:[s&&m.slice(0,-1).map((r,n)=>
945
- /* @__PURE__ */et("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:oc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?ic.neutral:n.value>=0?ic.good:ic.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
946
- return et("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function pu({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=be().charts,p=fe(),g=o??(e=>Number.isInteger(e)?we(e,p):Ne(e,1,p)),f=s??(e=>we(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??Nc(e??[],t),v=cc(0,l,i),w=y.map(e=>g(e.from)),N=y.map(e=>e.count);/* @__PURE__ */
947
- return et(Cc,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */et(zc,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */et("g",{children:y.map((a,l)=>/* @__PURE__ */et("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function gu({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=be().charts,u=fe(),h=l??(e=>we(e,u)),m=o??d.distribution,p=cc(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
948
- return et(Cc,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
949
- return et(zc,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */et("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
949
+ /* @__PURE__ */et("path",{d:nd(td(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
950
+ /* @__PURE__ */et("path",{d:td(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
951
+ /* @__PURE__ */et("path",{d:td(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */et("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:wc.axis,strokeWidth:1})]})})}function Lu({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=fe().charts,d=be(),u=n??(e=>we(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
952
+ return et(Rc,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?vc.neutral:t.value>=0?vc.good:vc.critical;/* @__PURE__ */
953
+ return et(Vc,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:vc.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */Qe("g",{children:[s&&m.slice(0,-1).map((r,n)=>
954
+ /* @__PURE__ */et("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:wc.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?vc.neutral:n.value>=0?vc.good:vc.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
955
+ return et("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function Du({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=fe().charts,p=be(),g=o??(e=>Number.isInteger(e)?we(e,p):Ne(e,1,p)),f=s??(e=>we(e,p)),b=c??m.countAxis,y=d??m.distribution,x=r??Ic(e??[],t),v=kc(0,l,i),w=x.map(e=>g(e.from)),N=x.map(e=>e.count);/* @__PURE__ */
956
+ return et(Rc,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(y,x.length,(e??[]).length),tooltip:e=>/* @__PURE__ */et(Vc,{title:`${g(x[e].from)} – ${g(x[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(x[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */et("g",{children:x.map((a,l)=>/* @__PURE__ */et("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function Su({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=fe().charts,u=be(),h=l??(e=>we(e,u)),m=o??d.distribution,p=kc(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
957
+ return et(Rc,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
958
+ return et(Vc,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */et("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
950
959
  return Qe("g",{opacity:null!==n&&n!==a?.45:1,children:[
951
960
  /* @__PURE__ */et("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
952
961
  /* @__PURE__ */et("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
953
962
  /* @__PURE__ */et("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
954
963
  /* @__PURE__ */et("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
955
964
  /* @__PURE__ */et("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
956
- /* @__PURE__ */et("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */et("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:oc.surface,strokeWidth:1.5},t))]},a)})})})}function fu({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=be().charts,d=fe(),u=a??(e=>Number.isInteger(e)?we(e,d):Ne(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
957
- return et(Cc,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ic.good:ic.critical;/* @__PURE__ */
958
- return et(zc,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */et("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?ic.good:ic.critical,s=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
965
+ /* @__PURE__ */et("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */et("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:wc.surface,strokeWidth:1.5},t))]},a)})})})}function Au({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=fe().charts,d=be(),u=a??(e=>Number.isInteger(e)?we(e,d):Ne(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
966
+ return et(Rc,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?vc.good:vc.critical;/* @__PURE__ */
967
+ return et(Vc,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */et("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?vc.good:vc.critical,s=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
959
968
  return Qe("g",{opacity:d?.45:1,children:[
960
969
  /* @__PURE__ */et("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */et("rect",{x:s-c/2,y:u,width:c,height:h,rx:1,fill:i?o:"transparent",fillOpacity:i?.85:1,stroke:o,strokeWidth:1.5}):/* @__PURE__ */Qe(tt,{children:[
961
970
  /* @__PURE__ */et("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
962
- /* @__PURE__ */et("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function bu({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=be().charts,p=fe(),g=o??(e=>we(e,p)),f=s??m.intensity,b=d??m.noActivity,x=Re(null),y=$c(x),v=a??y,w=We(),[N,k]=Oe(null);if(_e(()=>{if(null!==N)return te(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
963
- return et("div",{className:c,ref:x,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??cc(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${oc.surface})`};/* @__PURE__ */
964
- return Qe("div",{className:`relative ${c??""}`,ref:x,children:[
971
+ /* @__PURE__ */et("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Pu({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=fe().charts,p=be(),g=o??(e=>we(e,p)),f=s??m.intensity,b=d??m.noActivity,y=Re(null),x=Tc(y),v=a??x,w=We(),[N,k]=Oe(null);if(_e(()=>{if(null!==N)return te(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
972
+ return et("div",{className:c,ref:y,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??kc(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${wc.surface})`};/* @__PURE__ */
973
+ return Qe("div",{className:`relative ${c??""}`,ref:y,children:[
965
974
  /* @__PURE__ */Qe("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
966
975
  /* @__PURE__ */et("defs",{children:/* @__PURE__ */Qe("linearGradient",{id:w,x1:"0",x2:"1",children:[
967
976
  /* @__PURE__ */et("stop",{offset:"0",stopColor:A(0)}),
968
- /* @__PURE__ */et("stop",{offset:"1",stopColor:A(M)})]})}),e.map((e,t)=>/* @__PURE__ */et("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:oc.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
969
- return et("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */et("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */et("text",{x:C+r*S+S/2,y:L+15,textAnchor:"middle",fontSize:11,fill:oc.label,children:e},`c${r}`):null),
977
+ /* @__PURE__ */et("stop",{offset:"1",stopColor:A(M)})]})}),e.map((e,t)=>/* @__PURE__ */et("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:wc.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
978
+ return et("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */et("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */et("text",{x:C+r*S+S/2,y:L+15,textAnchor:"middle",fontSize:11,fill:wc.label,children:e},`c${r}`):null),
970
979
  /* @__PURE__ */et("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
971
- /* @__PURE__ */et("text",{x:C,y:L+48,fontSize:11,fill:oc.label,children:"0"}),
972
- /* @__PURE__ */et("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:11,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:g(M)})]}),N&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */et(zc,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:$,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function xu({caption:e,head:t,rows:n}){/* @__PURE__ */
980
+ /* @__PURE__ */et("text",{x:C,y:L+48,fontSize:11,fill:wc.label,children:"0"}),
981
+ /* @__PURE__ */et("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:11,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:g(M)})]}),N&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */et(Vc,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:$,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function ju({caption:e,head:t,rows:n}){/* @__PURE__ */
973
982
  return Qe("table",{className:"sr-only",children:[
974
983
  /* @__PURE__ */et("caption",{children:e}),
975
984
  /* @__PURE__ */et("thead",{children:/* @__PURE__ */et("tr",{children:t.map(e=>/* @__PURE__ */et("th",{className:r,scope:"col",children:e},e))})}),
976
- /* @__PURE__ */et("tbody",{children:n.map((e,t)=>/* @__PURE__ */et("tr",{children:e.map((e,t)=>/* @__PURE__ */et("td",{children:e},t))},t))})]})}var yu=3,vu=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function wu({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=be().charts,u=fe(),h=i??(e=>we(e,u)),m=c??d.nothingToCompare,p=We(),[g,f]=Oe(null),{highlighted:b}=Ac(),x=t;if(e.length<3||0===x.length)/* @__PURE__ */
977
- return et("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,N=vc(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...x.map(e=>e.values[t]??0).filter(Number.isFinite))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
985
+ /* @__PURE__ */et("tbody",{children:n.map((e,t)=>/* @__PURE__ */et("tr",{children:e.map((e,t)=>/* @__PURE__ */et("td",{children:e},t))},t))})]})}var zu=3,Fu=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Eu({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=fe().charts,u=be(),h=i??(e=>we(e,u)),m=c??d.nothingToCompare,p=We(),[g,f]=Oe(null),{highlighted:b}=qc(),y=t;if(e.length<3||0===y.length)/* @__PURE__ */
986
+ return et("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const x=r/2,v=r/2,w=r/2-46,N=Fc(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...y.map(e=>e.values[t]??0).filter(Number.isFinite))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[x+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?y[g]:void 0;/* @__PURE__ */
978
987
  return Qe("div",{className:`relative ${s??""}`,children:[
979
988
  /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
980
- /* @__PURE__ */et("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */et("circle",{cx:y,cy:v,r:n,fill:"none",stroke:oc.grid,strokeWidth:1},r):/* @__PURE__ */et("path",{d:vu(qc(y,v,n,e.length)),fill:"none",stroke:oc.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=$(t,k[t]);/* @__PURE__ */
989
+ /* @__PURE__ */et("title",{id:p,children:d.acrossMeasures(y.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */et("circle",{cx:x,cy:v,r:n,fill:"none",stroke:wc.grid,strokeWidth:1},r):/* @__PURE__ */et("path",{d:Fu(ad(x,v,n,e.length)),fill:"none",stroke:wc.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=$(t,k[t]);/* @__PURE__ */
981
990
  return Qe("g",{children:[
982
- /* @__PURE__ */et("line",{x1:y,y1:v,x2:r,y2:n,stroke:oc.grid,strokeWidth:1}),
983
- /* @__PURE__ */et("text",{x:y+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:oc.label,children:e.label})]},e.key)}),
984
- /* @__PURE__ */et(Wi,{id:p,reveal:!!o&&"center-out"}),x.map((t,r)=>{const a=hc(r,3,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
985
- return Qe("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Ei(p)})`:void 0,children:["area"===n&&/* @__PURE__ */et("path",{d:vu(l),fill:a,fillOpacity:.18,stroke:"none"}),
986
- /* @__PURE__ */et("path",{d:vu(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */et("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:oc.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:hc(g,3,C.color,C.tone),value:h(C.values[t]??0)}))})}),
987
- /* @__PURE__ */et("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:x.map((e,t)=>/* @__PURE__ */Qe("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
988
- /* @__PURE__ */et("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:hc(t,3,e.color,e.tone)}}),
991
+ /* @__PURE__ */et("line",{x1:x,y1:v,x2:r,y2:n,stroke:wc.grid,strokeWidth:1}),
992
+ /* @__PURE__ */et("text",{x:x+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:wc.label,children:e.label})]},e.key)}),
993
+ /* @__PURE__ */et(to,{id:p,reveal:!!o&&"center-out"}),y.map((t,r)=>{const a=Cc(r,3,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
994
+ return Qe("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Gi(p)})`:void 0,children:["area"===n&&/* @__PURE__ */et("path",{d:Fu(l),fill:a,fillOpacity:.18,stroke:"none"}),
995
+ /* @__PURE__ */et("path",{d:Fu(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */et("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:wc.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Cc(g,3,C.color,C.tone),value:h(C.values[t]??0)}))})}),
996
+ /* @__PURE__ */et("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:y.map((e,t)=>/* @__PURE__ */Qe("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
997
+ /* @__PURE__ */et("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Cc(t,3,e.color,e.tone)}}),
989
998
  /* @__PURE__ */et("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
990
- /* @__PURE__ */et(xu,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Nu=300*Math.PI/180;function ku({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=be().charts,d=fe(),u=a??(e=>we(e,d)),h=o??c.nothingToPlot,m=We(),[p,g]=Oe(null),{highlighted:f}=Ac();if(0===e.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,N=Math.max(1,Math.floor((y-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(s,Math.max(1,w-2)),M=vc(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
999
+ /* @__PURE__ */et(ju,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Iu=300*Math.PI/180;function Bu({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=fe().charts,d=be(),u=a??(e=>we(e,d)),h=o??c.nothingToPlot,m=We(),[p,g]=Oe(null),{highlighted:f}=qc();if(0===e.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,y=r/2,x=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(x-.16*r)/e.length):0,N=Math.max(1,Math.floor((x-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(s,Math.max(1,w-2)),M=Fc(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
991
1000
  return Qe("div",{className:`relative ${i??""}`,children:[
992
1001
  /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
993
- /* @__PURE__ */et("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=cc(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=y-n*w,r=t-w+$,s=-Math.PI/2;/* @__PURE__ */
994
- return Qe("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?_i.sweep:void 0,style:l?qi(n,70):void 0,children:[
995
- /* @__PURE__ */et("path",{d:Hc(b,x,r,t,s,s+Nu),fill:oc.grid}),
996
- /* @__PURE__ */et("path",{d:Hc(b,x,r,t,s,s+Nu*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
997
- return et("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */et("path",{d:Hc(b,x,s,s+(y-s)*i,M(n),M(n)+M.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:C.label,rows:[{key:"value",label:c.value,color:cc(p,C.color,C.tone),value:u(C.value)}]})}),
1002
+ /* @__PURE__ */et("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=kc(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=x-n*w,r=t-w+$,s=-Math.PI/2;/* @__PURE__ */
1003
+ return Qe("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?no.sweep:void 0,style:l?ao(n,70):void 0,children:[
1004
+ /* @__PURE__ */et("path",{d:ld(b,y,r,t,s,s+Iu),fill:wc.grid}),
1005
+ /* @__PURE__ */et("path",{d:ld(b,y,r,t,s,s+Iu*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
1006
+ return et("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */et("path",{d:ld(b,y,s,s+(x-s)*i,M(n),M(n)+M.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:C.label,rows:[{key:"value",label:c.value,color:kc(p,C.color,C.tone),value:u(C.value)}]})}),
998
1007
  /* @__PURE__ */et("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:e.map((e,t)=>/* @__PURE__ */Qe("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
999
- /* @__PURE__ */et("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:cc(t,e.color,e.tone)}}),
1008
+ /* @__PURE__ */et("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:kc(t,e.color,e.tone)}}),
1000
1009
  /* @__PURE__ */et("span",{className:"flex-1 truncate",children:e.label}),
1001
- /* @__PURE__ */et("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function $u({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=be().charts,u=fe(),h=i??(e=>we(e,u)),m=c??d.noStages,p=We(),[g,f]=Oe(null),{highlighted:b}=Ac(),x=Re(null),y=$c(x,560),v=n??y;if(0===e.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??cc(0),N=r??54*e.length,k=Math.max(...e.map(e=>e.value),1),$="bars"===t,M=$?Math.round(Math.min(132,Math.max(80,.24*v))):Math.round(Math.min(168,Math.max(104,.38*v))),C=t=>{const r=e[t-1]?.value;return null!=r&&r>0?100*(1-e[t].value/r):null},L=t=>{const r=C(t);return{count:h(e[t].value),drop:null!=r?`−${ke(r,1,u)}`:""}},D=$?Math.ceil(Math.max(...e.map((e,t)=>{const{count:r,drop:n}=L(t);return.62*(r.length+(n?n.length+1:0))*12}))+16):0,S=v-M-D,A=Math.max($?2:0,Math.min(l,S)),P=e=>Math.max(A,S*Math.max(0,e/k)),j=e=>P(e)/2,z=M+S/2,F=t=>46+t/Math.max(1,e.length-1)*54,E=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${oc.surface})`,B=e=>F(e)>=55?oc.surface:oc.label,I=(e,t)=>null!==g?g!==e:null!==b&&b!==t,T=null!==g?e[g]:void 0;/* @__PURE__ */
1002
- return Qe("div",{className:`relative ${s??""}`,ref:x,children:[
1010
+ /* @__PURE__ */et("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Tu({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=fe().charts,u=be(),h=i??(e=>we(e,u)),m=c??d.noStages,p=We(),[g,f]=Oe(null),{highlighted:b}=qc(),y=Re(null),x=Tc(y,560),v=n??x;if(0===e.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??kc(0),N=r??54*e.length,k=Math.max(...e.map(e=>e.value),1),$="bars"===t,M=$?Math.round(Math.min(132,Math.max(80,.24*v))):Math.round(Math.min(168,Math.max(104,.38*v))),C=t=>{const r=e[t-1]?.value;return null!=r&&r>0?100*(1-e[t].value/r):null},L=t=>{const r=C(t);return{count:h(e[t].value),drop:null!=r?`−${ke(r,1,u)}`:""}},D=$?Math.ceil(Math.max(...e.map((e,t)=>{const{count:r,drop:n}=L(t);return.62*(r.length+(n?n.length+1:0))*12}))+16):0,S=v-M-D,A=Math.max($?2:0,Math.min(l,S)),P=e=>Math.max(A,S*Math.max(0,e/k)),j=e=>P(e)/2,z=M+S/2,F=t=>46+t/Math.max(1,e.length-1)*54,E=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${wc.surface})`,I=e=>F(e)>=55?wc.surface:wc.label,B=(e,t)=>null!==g?g!==e:null!==b&&b!==t,T=null!==g?e[g]:void 0;/* @__PURE__ */
1011
+ return Qe("div",{className:`relative ${s??""}`,ref:y,children:[
1003
1012
  /* @__PURE__ */Qe("svg",{width:"100%",height:N,viewBox:`0 0 ${v} ${N}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
1004
1013
  /* @__PURE__ */et("title",{id:p,children:d.funnel(e.length,h(e[0].value),h(e[e.length-1].value))}),e.map((r,n)=>{const l=n*N/e.length+a/2,i=(n+1)*N/e.length-a/2,o=(l+i)/2,s=ke(r.value/(e[0].value||1)*100,0,u),c=.62*s.length*12+12;if($){const e=M,t=e+P(r.value),{count:a,drop:d}=L(n);/* @__PURE__ */
1005
- return Qe("g",{opacity:I(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
1014
+ return Qe("g",{opacity:B(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
1006
1015
  /* @__PURE__ */et("path",{d:`M${e},${l} L${t},${l} L${t},${i} L${e},${i} Z`,fill:E(n)}),
1007
- /* @__PURE__ */et("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:oc.label,children:r.label}),t-e>=c&&/* @__PURE__ */et("text",{x:e+8,y:o+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:B(n),style:{fontVariantNumeric:"tabular-nums"},children:s}),
1008
- /* @__PURE__ */Qe("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:oc.label,style:{fontVariantNumeric:"tabular-nums"},children:[
1009
- /* @__PURE__ */et("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */et("tspan",{fill:oc.muted,children:` ${d}`})]})]},r.key)}const d=j(r.value),m="cone"===t?j(e[n+1]?.value??r.value):d,p=C(n),g=2*Math.min(d,m)>=c;/* @__PURE__ */
1010
- return Qe("g",{opacity:I(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
1016
+ /* @__PURE__ */et("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:wc.label,children:r.label}),t-e>=c&&/* @__PURE__ */et("text",{x:e+8,y:o+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:I(n),style:{fontVariantNumeric:"tabular-nums"},children:s}),
1017
+ /* @__PURE__ */Qe("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:wc.label,style:{fontVariantNumeric:"tabular-nums"},children:[
1018
+ /* @__PURE__ */et("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */et("tspan",{fill:wc.muted,children:` ${d}`})]})]},r.key)}const d=j(r.value),m="cone"===t?j(e[n+1]?.value??r.value):d,p=C(n),g=2*Math.min(d,m)>=c;/* @__PURE__ */
1019
+ return Qe("g",{opacity:B(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
1011
1020
  /* @__PURE__ */et("path",{d:`M${z-d},${l} L${z+d},${l} L${z+m},${i} L${z-m},${i} Z`,fill:E(n)}),
1012
- /* @__PURE__ */et("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:oc.label,children:r.label}),
1013
- /* @__PURE__ */Qe("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:oc.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${ke(p,1,u)}`:""]}),
1014
- /* @__PURE__ */et("text",{x:g?z:z+Math.max(d,m)+6,y:o+4,textAnchor:g?"middle":"start",fontSize:12,fontWeight:600,fill:g?B(n):oc.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),T&&null!==g&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:T.label,rows:[{key:"value",label:d.count,color:E(g),value:h(T.value)},{key:"share",label:d.ofFirstStage,color:oc.muted,value:ke(T.value/(e[0].value||1)*100,0,u)},...g>0&&e[g-1].value>0?[{key:"drop",label:d.droppedHere,color:ic.critical,value:`−${ke(100*(1-T.value/e[g-1].value),1,u)}`}]:[]]})})]})}function Mu({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=be().charts,d=fe(),u=l??(e=>we(e,d)),h=s??c.nothingToBreakDown,m=Re(null),p=$c(m),g=r??p,[f,b]=Oe(null),{highlighted:x}=Ac(),y=Vd(e,g,t);if(0===y.length)/* @__PURE__ */
1015
- return et("div",{className:o,ref:m,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??cc(0),w=Math.max(...y.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${oc.surface})`,$=e=>N(e)>=55?oc.surface:oc.label,M=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
1021
+ /* @__PURE__ */et("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:wc.label,children:r.label}),
1022
+ /* @__PURE__ */Qe("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:wc.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${ke(p,1,u)}`:""]}),
1023
+ /* @__PURE__ */et("text",{x:g?z:z+Math.max(d,m)+6,y:o+4,textAnchor:g?"middle":"start",fontSize:12,fontWeight:600,fill:g?I(n):wc.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),T&&null!==g&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:T.label,rows:[{key:"value",label:d.count,color:E(g),value:h(T.value)},{key:"share",label:d.ofFirstStage,color:wc.muted,value:ke(T.value/(e[0].value||1)*100,0,u)},...g>0&&e[g-1].value>0?[{key:"drop",label:d.droppedHere,color:vc.critical,value:`−${ke(100*(1-T.value/e[g-1].value),1,u)}`}]:[]]})})]})}function Ou({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=fe().charts,d=be(),u=l??(e=>we(e,d)),h=s??c.nothingToBreakDown,m=Re(null),p=Tc(m),g=r??p,[f,b]=Oe(null),{highlighted:y}=qc(),x=ou(e,g,t);if(0===x.length)/* @__PURE__ */
1024
+ return et("div",{className:o,ref:m,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??kc(0),w=Math.max(...x.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${wc.surface})`,$=e=>N(e)>=55?wc.surface:wc.label,M=f??y,C=f?x.find(e=>e.key===f):void 0;/* @__PURE__ */
1016
1025
  return Qe("div",{className:`relative ${o??""}`,ref:m,children:[
1017
- /* @__PURE__ */et("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:y.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
1026
+ /* @__PURE__ */et("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:x.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
1018
1027
  return Qe("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
1019
- /* @__PURE__ */et("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */et("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:12,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */et("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
1020
- /* @__PURE__ */et(xu,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function Cu(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Lu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Lu(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Cu(e.children,c,u,n+1,m,p,h,o),c+=u})}function Lu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Lu(r,t-1),0):Math.max(0,e.value??0)}function Du({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=be().charts,c=fe(),d=a??(e=>we(e,c)),u=o??s.nothingToBreakDown,[h,m]=Oe(null),{highlighted:p}=Ac(),g=[];if(Cu(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${cc(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${oc.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>ke(e.value/v*100,1,c);/* @__PURE__ */
1028
+ /* @__PURE__ */et("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */et("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:12,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */et("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
1029
+ /* @__PURE__ */et(ju,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function Ru(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Wu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Wu(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Ru(e.children,c,u,n+1,m,p,h,o),c+=u})}function Wu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Wu(r,t-1),0):Math.max(0,e.value??0)}function Ku({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=fe().charts,c=be(),d=a??(e=>we(e,c)),u=o??s.nothingToBreakDown,[h,m]=Oe(null),{highlighted:p}=qc(),g=[];if(Ru(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,y=t/2,x=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${kc(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${wc.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>ke(e.value/v*100,1,c);/* @__PURE__ */
1021
1030
  return Qe("div",{className:`relative ${i??""}`,children:[
1022
- /* @__PURE__ */Qe("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */et("path",{d:Hc(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:oc.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */et("text",{x:b,y:x+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:oc.label,children:l})]}),k&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:oc.muted,value:$(k)}]})}),
1023
- /* @__PURE__ */et(xu,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Su({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=be().charts,d=fe(),u=i??(e=>we(e,d)),h=s??c.noFlows,m=Re(null),p=$c(m),g=n??p,[f,b]=Oe(null),{highlighted:x}=Ac();if(0===e.length||0===t.length)/* @__PURE__ */
1024
- return et("div",{className:o,ref:m,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
1031
+ /* @__PURE__ */Qe("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */et("path",{d:ld(b,y,r+e.depth*x+n/2,r+(e.depth+1)*x-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:wc.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */et("text",{x:b,y:y+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:wc.label,children:l})]}),k&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:wc.muted,value:$(k)}]})}),
1032
+ /* @__PURE__ */et(ju,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function _u({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=fe().charts,d=be(),u=i??(e=>we(e,d)),h=s??c.noFlows,m=Re(null),p=Tc(m),g=n??p,[f,b]=Oe(null),{highlighted:y}=qc();if(0===e.length||0===t.length)/* @__PURE__ */
1033
+ return et("div",{className:o,ref:m,children:/* @__PURE__ */et("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const x=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>x.length<=1?0:x.indexOf(e)/(x.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
1025
1034
  return Qe("div",{className:`relative ${o??""}`,ref:m,children:[
1026
- /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=cc(r.index,e.color),u=`${e.from}→${e.to}`,h=S.get(u)??0;S.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==x?A(e,x):null)(e,t);/* @__PURE__ */
1027
- return et("path",{d:Rc([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:A(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
1035
+ /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=kc(r.index,e.color),u=`${e.from}→${e.to}`,h=S.get(u)??0;S.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==y?A(e,y):null)(e,t);/* @__PURE__ */
1036
+ return et("path",{d:ed([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:A(t[f.index],i):null!==y?y===i:null);var i;/* @__PURE__ */
1028
1037
  return Qe("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
1029
- /* @__PURE__ */et("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:cc(r.index,e.color,e.tone)}),
1030
- /* @__PURE__ */et("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:oc.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:cc(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),j&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:j.label,rows:[{key:"value",label:c.throughput,color:cc(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
1031
- /* @__PURE__ */et(xu,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function Au({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=be().charts,d=fe(),u=i??(e=>we(e,d)),h=s??c.noFlows,[m,p]=Oe(null),{highlighted:g}=Ac(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:x,otherIndex:y,foldedCount:v}=f,w=(e,t)=>x[e]?.[t]??0,N=e=>e===y?oc.muted:cc(e),k=f.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,D=r/2-44,S=D-l,A=a*$.length,P=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-A);P.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=P.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:P.get(t).start+(P.get(t).end-P.get(t).start)/2})}const E=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],B="arc"===m?.kind?m.index:void 0,I="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
1038
+ /* @__PURE__ */et("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:kc(r.index,e.color,e.tone)}),
1039
+ /* @__PURE__ */et("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:wc.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:kc(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),j&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:j.label,rows:[{key:"value",label:c.throughput,color:kc(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
1040
+ /* @__PURE__ */et(ju,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function qu({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=fe().charts,d=be(),u=i??(e=>we(e,d)),h=s??c.noFlows,[m,p]=Oe(null),{highlighted:g}=qc(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:y,otherIndex:x,foldedCount:v}=f,w=(e,t)=>y[e]?.[t]??0,N=e=>e===x?wc.muted:kc(e),k=f.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return et("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,D=r/2-44,S=D-l,A=a*$.length,P=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-A);P.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=P.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:P.get(t).start+(P.get(t).end-P.get(t).start)/2})}const E=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],I="arc"===m?.kind?m.index:void 0,B="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
1032
1041
  return Qe("div",{className:`relative ${o??""}`,children:[
1033
1042
  /* @__PURE__ */Qe("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord($.length),onMouseLeave:()=>p(null),children:[F.map((e,t)=>{const[n,a]=E(e.a,S),[l,i]=E(e.b,S),o=N(e.from),s=((e,t)=>m?"ribbon"===m.kind?m.index===t:m.index===e.from||m.index===e.to:null!==g?b[e.from]===g||b[e.to]===g:null)(e,t);/* @__PURE__ */
1034
1043
  return et("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=P.get(e),r=(t.start+t.end)/2,[n,a]=E(r,D+16),l=(e=>m?"arc"===m.kind?m.index===e:F[m.index].from===e||F[m.index].to===e:null!==g?b[e]===g:null)(e);/* @__PURE__ */
1035
1044
  return Qe("g",{onMouseEnter:()=>p({kind:"arc",index:e}),children:[
1036
- /* @__PURE__ */et("path",{d:Hc(C,L,S,D,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
1037
- /* @__PURE__ */et("text",{x:n,y:a+4,fontSize:11,fill:oc.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */et("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==B&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:b[B],rows:[{key:"total",label:c.totalFlow,color:N(B),value:u(k[B])}]})}),I&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(zc,{title:`${b[I.from]} → ${b[I.to]}`,rows:[{key:"value",label:c.flow,color:N(I.from),value:u(I.value)}]})}),
1038
- /* @__PURE__ */et(xu,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Bs as APP_UPDATE_POLL_MS,ui as Accordion,qa as AlignmentGrid,Ts as AppUpdateBanner,Xa as AttachButton,Ya as AttachmentDropZone,Ga as AttachmentList,fd as AuthScreen,Jl as Avatar,Zl as AvatarGroup,Al as BORDER_WIDTHS,ri as Banner,gu as BoxPlotChart,sr as BrandAssetEditor,Si as BudgetBar,oc as CHART_INK,On as COLUMN_COUNT_MAX,Wn as COLUMN_COUNT_WIDTHS,Kn as COLUMN_SHARES_EQUAL,Rn as COLUMN_SHARE_MIN,$l as CONTROL_HEIGHTS,Ad as CORNERS,jd as CORNERS_FOR_THEME,$r as Calendar,fu as CandlestickChart,rl as Card,Cc as CartesianPlot,nu as ChartBrush,Wi as ChartDefs,ru as ChartDot,tu as ChartFrame,Sc as ChartHighlightProvider,Lc as ChartSkeleton,zc as ChartTooltip,ud as ChatTemplate,Lt as Checkbox_default,ld as CheckoutTemplate,Au as ChordChart,ya as ColorPicker,fa as ColorPickerPanel,ha as ColorSwatch,mi as ColoredBadge,Fc as ColumnChart,Ja as ComposerAttachments,Ro as ContainerFillChart,ds as ContextMenu,Ka as CornersInput,ql as CountBadge,Ai as DAY_MS,Zc as DashboardTemplate,ec as DataTable,td as DataTablePage,Hr as DatePicker_default,Fr as DateRangePicker,Gr as DateTimePicker_default,Rl as DescriptionList,Tn as DisplayChips,wl as Divider,Ks as Drawer,lt as DropdownMenu,jl as ELEVATION_LEVELS,sd as EmailTemplate,pi as EmptyState,Wd as EmptyValue,vd as ErrorBoundary,xd as ErrorPage,Dl as FONT_WEIGHTS,Ha as FilePicker_default,ss as FloatingBar,zt as FormErrorSummary,At as FormField,nd as FormLayoutPage,$u as FunnelChart,Tt as GROUP_COLORS,Ot as GROUP_COLORS_SOLID,pd as GalleryTemplate,yl as Grid,bu as HeatmapChart,Zo as HelpCenter,xa as HexInput,pu as HistogramChart,wn as IconPicker,Fs as IconRail,Es as IconRailButton,Na as ImageFocusPoint,gl as Inline,Sn as InputNumber_default,ct as Input_default,_s as Kanban,Bt as Label,Rd as LanguagePanel,Od as LanguageSelect,Sa as LinkPicker,tc as ListFooter,rc as ListLoadError,As as ListRow,an as MAX_FRACTION_DIGITS,_i as MOTION,Sl as MOTION_DURATIONS,Xo as Markdown,or as MediaUploadField,gr as MediaUploadGrid,Xd as Meter,Mi as MetricBar,Po as MilestoneTimeline,Nt as NativeSelect,cn as NumericKeypad,jo as POST_PRODUCTION_STATUSES,gi as PageHeader,Hs as Pagination,Ua as PaperclipGlyph,dl as Paragraph,Uc as PieChart,yn as Popover,hr as PortalBrandingProvider,To as ProductionTimeline,yu as RADAR_SERIES_CAP,Pl as RADIUS_ROLES,Ml as ROW_HEIGHTS,wu as RadarChart,ku as RadialBarChart,jt as RadioGroup,St as Radio_default,hu as RangeChart,Yd as RankedBars,du as SCATTER_SERIES_CAP,ac as SERIES_SLOT_COUNT,lc as SERIES_VARS,kl as SPACING_ROLES,Nl as SPACING_SCALE,zo as STAGES,ic as STATUS_VARS,Su as SankeyChart,uu as ScatterChart,$a as SearchableSelect,bn as Segmented,Mt as Select_default,Kl as SettingRow,es as SidebarActionButton,rs as SidebarGroupLabel,ls as SidebarNavGroup,as as SidebarNavItem,El as Skeleton,In as Slider,Bn as SliderGroup,nn as Snippet,Ss as SortableList,nc as Sparkline,st as SplitButton_default,pl as Stack,nl as StatCard,Zd as StatTile,Vl as Statistic,Ut as StatusBadge,qt as StatusBadgeProvider,ci as Stepper,Du as SunburstChart,Mn as Switch_default,Ll as TYPE_SCALE,oi as Tabs,Qa as TagInput,ol as Text,Aa as TextLinkField,Oa as TextToolbar,dt as Textarea_default,un as TileButton_default,Kd as TimeAgo,Tr as TimePicker_default,cu as TimeSeriesChart,So as TimelineTrack,cl as Title,is as TopNav,Gt as TransferProgress,ys as Tree,Cs as TreeEmptySlot,vs as TreeGroup,Ns as TreeGroupLabel,Ms as TreeRow,Ls as TreeSeam,Mu as TreemapChart,mu as WaterfallChart,ea as WidthsBar,vc as angleScale,ln as appendKey,Fd as applyCorners,Ed as applyIconSet,Bd as applyThemePrefs,Hc as arcPath,_c as areaBetween,Kc as areaFrom,dc as assignSeriesSlots,jc as autoHighlightIndex,on as backspace,pc as bandScale,Nc as binValues,Li as budgetState,Rc as bumpPath,Fo as calcOverall,Eo as calcReportOverall,da as colorFill,ua as colorSwatchClasses,Hn as columnSharesWidths,Zr as copyToClipboard,zd as cornersFor,Wc as curvePath,Ti as dashFor,Ii as fillFor,zi as fillId,ut as firstEnabledIndex,ji as fmtSliderDate,yr as fromKey,Fi as glowId,Bi as groundId,Rt as groupColors,la as hexToHsv,Pc as highlightOpacity,ia as hsvToHex,bi as isSeverityTone,Cl as isSpacingStep,Et as labelClasses,gc as ladderScale,Td as languageSelectWidth,ht as lastEnabledIndex,Bc as linearPath,mc as linearScale,yc as logScale,Ei as maskId,pt as matchTypeahead,Jt as mediaFileName,Tc as monotonePath,mt as nextEnabledIndex,bc as niceAxis,fc as niceMax,ra as parseHexColor,qc as polygonPoints,wc as radiusScale,qn as resolveColumnShares,Un as resolveColumnWidths,Pd as resolveCorners,cr as resolvePortalBrandAsset,cc as resolveSeriesColor,hc as resolveSeriesColorWithin,Ld as resolveTheme,Xr as selectionAt,sc as seriesColor,xi as severityOf,Oc as splinePath,Vd as squarify,qi as stagger,Ic as stepPath,ni as tabButtonId,ai as tabPanelId,Ia as textToolbarRows,Ba as textToolbarWindowColumns,Pi as toDayMs,Dr as toISODate,xr as toKey,uc as toggleSeriesSlot,Is as useAppUpdate,qd as useClickOutside,us as useContextMenu,_d as useDebouncedValue,Ac as useHighlight,$c as usePlotWidth,mr as usePortalBranding,Bo as useProductionTimeline,Ht as useStatusLabel,Id as useTheme,hi as useTransferProgress};
1045
+ /* @__PURE__ */et("path",{d:ld(C,L,S,D,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
1046
+ /* @__PURE__ */et("text",{x:n,y:a+4,fontSize:11,fill:wc.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */et("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==I&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:b[I],rows:[{key:"total",label:c.totalFlow,color:N(I),value:u(k[I])}]})}),B&&/* @__PURE__ */et("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */et(Vc,{title:`${b[B.from]} → ${b[B.to]}`,rows:[{key:"value",label:c.flow,color:N(B.from),value:u(B.value)}]})}),
1047
+ /* @__PURE__ */et(ju,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Xs as APP_UPDATE_POLL_MS,Mi as Accordion,al as AlignmentGrid,Js as AppUpdateBanner,dl as AttachButton,sl as AttachmentDropZone,cl as AttachmentList,Ad as AuthScreen,ui as Avatar,hi as AvatarGroup,Zn as BORDER_LINE_STYLES,ql as BORDER_WIDTHS,fi as Banner,aa as BorderInput,Su as BoxPlotChart,sr as BrandAssetEditor,_i as BudgetBar,wc as CHART_INK,ya as COLUMN_COUNT_MAX,va as COLUMN_COUNT_WIDTHS,wa as COLUMN_SHARES_EQUAL,xa as COLUMN_SHARE_MIN,Tl as CONTROL_HEIGHTS,qd as CORNERS,Ud as CORNERS_FOR_THEME,$r as Calendar,Au as CandlestickChart,fl as Card,Rc as CartesianPlot,bu as ChartBrush,to as ChartDefs,fu as ChartDot,gu as ChartFrame,_c as ChartHighlightProvider,Wc as ChartSkeleton,Vc as ChartTooltip,Md as ChatTemplate,Lt as Checkbox_default,xd as CheckoutTemplate,qu as ChordChart,Xn as ColorPicker,Vn as ColorPickerPanel,_n as ColorSwatch,Li as ColoredBadge,Yc as ColumnChart,ul as ComposerAttachments,es as ContainerFillChart,$s as ContextMenu,rl as CornersInput,ai as CountBadge,qi as DAY_MS,hd as DashboardTemplate,pc as DataTable,gd as DataTablePage,Hr as DatePicker_default,Fr as DateRangePicker,Gr as DateTimePicker_default,ei as DescriptionList,ba as DisplayChips,El as Divider,rc as Drawer,lt as DropdownMenu,Ul as ELEVATION_LEVELS,Nd as EmailTemplate,Di as EmptyState,tu as EmptyValue,Fd as ErrorBoundary,jd as ErrorPage,Kl as FONT_WEIGHTS,ll as FilePicker_default,Ns as FloatingBar,zt as FormErrorSummary,At as FormField,bd as FormLayoutPage,Tu as FunnelChart,Tt as GROUP_COLORS,Ot as GROUP_COLORS_SOLID,Dd as GalleryTemplate,zl as Grid,Pu as HeatmapChart,hs as HelpCenter,Gn as HexInput,Du as HistogramChart,wn as IconPicker,Ys as IconRail,Gs as IconRailButton,Ia as ImageFocusPoint,Sl as Inline,Mn as InputNumber_default,ct as Input_default,nc as Kanban,It as Label,eu as LanguagePanel,Qd as LanguageSelect,_a as LinkPicker,gc as ListFooter,fc as ListLoadError,qs as ListRow,an as MAX_FRACTION_DIGITS,no as MOTION,_l as MOTION_DURATIONS,ds as Markdown,or as MediaUploadField,gr as MediaUploadGrid,du as Meter,Oi as MetricBar,Ho as MilestoneTimeline,Nt as NativeSelect,cn as NumericKeypad,Uo as POST_PRODUCTION_STATUSES,Si as PageHeader,lc as Pagination,il as PaperclipGlyph,$l as Paragraph,id as PieChart,xn as Popover,hr as PortalBrandingProvider,Jo as ProductionTimeline,zu as RADAR_SERIES_CAP,Hl as RADIUS_ROLES,Ol as ROW_HEIGHTS,Eu as RadarChart,Bu as RadialBarChart,jt as RadioGroup,St as Radio_default,Cu as RangeChart,su as RankedBars,$u as SCATTER_SERIES_CAP,yc as SERIES_SLOT_COUNT,xc as SERIES_VARS,Bl as SPACING_ROLES,Il as SPACING_SCALE,Vo as STAGES,vc as STATUS_VARS,_u as SankeyChart,Mu as ScatterChart,Ta as SearchableSelect,bn as Segmented,Mt as Select_default,ri as SettingRow,ps as SidebarActionButton,fs as SidebarGroupLabel,xs as SidebarNavGroup,ys as SidebarNavItem,Pn as SidesEachToggle,An as SidesInput,Gl as Skeleton,fa as Slider,ga as SliderGroup,nn as Snippet,_s as SortableList,bc as Sparkline,st as SplitButton_default,Dl as Stack,bl as StatCard,hu as StatTile,oi as Statistic,Ut as StatusBadge,qt as StatusBadgeProvider,ki as Stepper,Ku as SunburstChart,sa as Switch_default,Wl as TYPE_SCALE,wi as Tabs,ml as TagInput,wl as Text,qa as TextLinkField,Qa as TextToolbar,dt as Textarea_default,un as TileButton_default,ru as TimeAgo,Tr as TimePicker_default,ku as TimeSeriesChart,_o as TimelineTrack,kl as Title,vs as TopNav,Gt as TransferProgress,zs as Tree,Rs as TreeEmptySlot,Fs as TreeGroup,Is as TreeGroupLabel,Os as TreeRow,Ws as TreeSeam,Ou as TreemapChart,Lu as WaterfallChart,za as WidthsBar,Fc as angleScale,ln as appendKey,Yd as applyCorners,Gd as applyIconSet,Xd as applyThemePrefs,ld as arcPath,nd as areaBetween,rd as areaFrom,$c as assignSeriesSlots,Uc as autoHighlightIndex,on as backspace,Dc as bandScale,Ic as binValues,Qn as borderSides,ea as borderStartEach,Wi as budgetState,ed as bumpPath,Yo as calcOverall,Go as calcReportOverall,Wn as colorFill,Kn as colorSwatchClasses,$a as columnSharesWidths,Jr as copyToClipboard,Vd as cornersFor,td as curvePath,Ji as dashFor,Zi as fillFor,Vi as fillId,ut as firstEnabledIndex,Ui as fmtSliderDate,xr as fromKey,Yi as glowId,Xi as groundId,Rt as groupColors,In as hexToHsv,Hc as highlightOpacity,Bn as hsvToHex,Pi as isSeverityTone,Rl as isSpacingStep,Et as labelClasses,Sc as ladderScale,Jd as languageSelectWidth,ht as lastEnabledIndex,Xc as linearPath,Lc as linearScale,zc as logScale,Gi as maskId,pt as matchTypeahead,Zt as mediaFileName,Jc as monotonePath,mt as nextEnabledIndex,Pc as niceAxis,Ac as niceMax,zn as parseHexColor,ad as polygonPoints,Ec as radiusScale,ka as resolveColumnShares,Ma as resolveColumnWidths,Hd as resolveCorners,cr as resolvePortalBrandAsset,kc as resolveSeriesColor,Cc as resolveSeriesColorWithin,Wd as resolveTheme,Xr as selectionAt,Nc as seriesColor,ji as severityOf,Sn as sidesStartEach,Qc as splinePath,ou as squarify,ao as stagger,Zc as stepPath,bi as tabButtonId,yi as tabPanelId,Za as textToolbarRows,Xa as textToolbarWindowColumns,Hi as toDayMs,Dr as toISODate,yr as toKey,Mc as toggleSeriesSlot,Zs as useAppUpdate,au as useClickOutside,Ms as useContextMenu,nu as useDebouncedValue,qc as useHighlight,Tc as usePlotWidth,mr as usePortalBranding,Xo as useProductionTimeline,Ht as useStatusLabel,Zd as useTheme,Ci as useTransferProgress};