efficient-shell 4.156.0 → 4.156.1

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.
@@ -1,5 +1,5 @@
1
- import{Breadcrumbs as e}from"./chunk-26RS37FG.js";import{SidebarLayout as t}from"./chunk-KASHUEJV.js";import{BrandMark as r}from"./chunk-ELCH5NDO.js";import{toast_default as n}from"./chunk-B2TBCVHH.js";import{useIsMobile as a,useShortcutLabel as l,useShellPrefs as i}from"./chunk-T6MKFQRH.js";import{iconButtonClasses as s,Button_default as o,buttonClasses as c}from"./chunk-PH3PRIFP.js";import{useFileIntake as d,humanSize as u,FileIntakeAlert as h}from"./chunk-FHIF6IUV.js";import{useTabLayer as m,focusableIn as p,useFocusTrap as g,useScrollLock as f,stopAfter as x}from"./chunk-PDTZTADH.js";import{glassStyle as b,glassFill as y,PopupMenu as v,PopupMenuDivider as w,PopupMenuLabel as N,itemLook as k}from"./chunk-J7LKJIZC.js";import{registerModalEscapeInterceptor as M,onOverlayOpen as $,Z_LAYERS as C,useDismissPopupsOnOpen as L}from"./chunk-OSJ3ADF2.js";import{useShellLocale as D,useShellStrings as j,DEFAULT_SHELL_STRINGS as S,currentShellStrings as z,formatPlain as P,formatFixed as A,formatPercent as F,splitAround as B}from"./chunk-VVI77XNV.js";import{useBrowserLayoutEffect as T,useBrowserValue as I,useBrowserValueOnce as W,useHydrated as E}from"./chunk-D65T4H6J.js";import{forwardRef as R,useCallback as O,useState as Y,useRef as H,useId as _,useEffect as q,createContext as U,useMemo as V,Children as K,isValidElement as Z,cloneElement as G,useContext as J,Fragment as X,Component as Q,useSyncExternalStore as ee,useLayoutEffect as te}from"react";import{jsx as re,jsxs as ne,Fragment as ae}from"react/jsx-runtime";import{createPortal as le}from"react-dom";var ie=R(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
- return re("button",{ref:i,type:n,className:s({variant:t,size:r,className:a}),...l,children:e})}),se="block w-full rounded-md border border-gray-300 bg-white",oe="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",ce={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},de=`${se} ${ce.md} ${oe}`,ue="disabled:cursor-not-allowed disabled:opacity-60";function he(e){return[e?.size&&"md"!==e.size?`${se} ${ce[e.size]} ${oe}`:de,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",ue,e?.className??""].filter(Boolean).join(" ")}var me=R(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
1
+ import{Breadcrumbs as e}from"./chunk-26RS37FG.js";import{SidebarLayout as t}from"./chunk-KASHUEJV.js";import{BrandMark as r}from"./chunk-ELCH5NDO.js";import{toast_default as n}from"./chunk-B2TBCVHH.js";import{useIsMobile as a,useShortcutLabel as l,useShellPrefs as i}from"./chunk-T6MKFQRH.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-FHIF6IUV.js";import{iconButtonClasses as d,Button_default as u,buttonClasses as h}from"./chunk-PH3PRIFP.js";import{useTabLayer as m,focusableIn as p,useFocusTrap as g,useScrollLock as f,stopAfter as x}from"./chunk-PDTZTADH.js";import{glassStyle as b,glassFill as y,PopupMenu as v,PopupMenuDivider as w,PopupMenuLabel as N,itemLook as k}from"./chunk-J7LKJIZC.js";import{registerModalEscapeInterceptor as M,onOverlayOpen as $,Z_LAYERS as C,useDismissPopupsOnOpen as L}from"./chunk-OSJ3ADF2.js";import{useShellLocale as D,useShellStrings as j,DEFAULT_SHELL_STRINGS as S,currentShellStrings as z,formatPlain as P,formatFixed as A,formatPercent as F,splitAround as B}from"./chunk-VVI77XNV.js";import{useBrowserLayoutEffect as T,useBrowserValue as I,useBrowserValueOnce as W,useHydrated as E}from"./chunk-D65T4H6J.js";import{forwardRef as R,useCallback as O,useState as Y,useRef as H,useId as _,useEffect as q,createContext as U,useMemo as V,Children as K,isValidElement as Z,cloneElement as G,useContext as J,Fragment as X,Component as Q,useSyncExternalStore as ee,useLayoutEffect as te}from"react";import{jsx as re,jsxs as ne,Fragment as ae}from"react/jsx-runtime";import{createPortal as le}from"react-dom";var ie=R(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
+ return re("button",{ref:i,type:n,className:d({variant:t,size:r,className:a}),...l,children:e})}),se="block w-full rounded-md border border-gray-300 bg-white",oe="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",ce={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},de=`${se} ${ce.md} ${oe}`,ue="disabled:cursor-not-allowed disabled:opacity-60";function he(e){return[e?.size&&"md"!==e.size?`${se} ${ce[e.size]} ${oe}`:de,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",ue,e?.className??""].filter(Boolean).join(" ")}var me=R(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
3
3
  /* @__PURE__ */re("input",{ref:i,"aria-invalid":e||void 0,className:he({invalid:e,size:n,className:[s,a].filter(Boolean).join(" ")}),...l});return t||r?/* @__PURE__ */ne("div",{className:"relative",children:[t&&/* @__PURE__ */re("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),o,r&&/* @__PURE__ */re("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):o}),pe=R(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,...i},s){const o=O(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
4
4
  return re("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:o,className:he({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})}),ge=448,fe=240,xe=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function be(e){const t=xe(),r=e?.closest?.("[data-modal-panel]");if(!r)return t;const n=r.getBoundingClientRect();return n.width<=0||n.height<=0?t:{left:Math.max(t.left,n.left),right:Math.min(t.right,n.right),top:Math.max(t.top,n.top),bottom:Math.min(t.bottom,n.bottom)}}var ye=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var ve={top:"bottom",bottom:"top",left:"right",right:"left"},we={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function Ne(e,t,r){return{top:e.top-r-(t.top+8),bottom:t.bottom-8-(e.bottom+r),left:e.left-r-(t.left+8),right:t.right-8-(e.right+r)}}var ke=(e,t,r)=>Math.max(t,Math.min(e,r));function Me(e,t,r){let n=NaN,a=NaN,l=NaN,i=NaN,s=NaN;const o=()=>{const t=e()?.getBoundingClientRect();if(!t)return!1;const o=r?r():NaN,c=t.left!==n||t.top!==a||t.right!==l||t.bottom!==i||o!==s&&!(Number.isNaN(o)&&Number.isNaN(s));return n=t.left,a=t.top,l=t.right,i=t.bottom,s=o,c};o();const c=()=>{o(),t()};let d=requestAnimationFrame(function e(){o()&&t(),d=requestAnimationFrame(e)});return window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}}function $e({trigger:e,menu:t,bounds:r,align:n,side:a}){const l=Ne(e,r,4),i="bottom"===a?"top":"bottom",s=t.height>l[a]&&(t.height<=l[i]||l[i]>l[a])?i:a,o=Math.max(Math.min(t.height,96),l[s]),c=Math.min(t.height,o),d=ke("bottom"===s?e.bottom+4:e.top-4-c,r.top+8,r.bottom-8-c),u=Math.max(0,r.right-r.left-16),h=Math.min(t.width,u);return{left:ke("start"===n?e.left:e.right-h,r.left+8,r.right-8-h),top:d,side:s,maxHeight:o,maxWidth:u}}function Ce(e,t,r={}){const{matchTriggerWidth:n=!1,preferredMaxWidth:a=ge,preferredMaxHeight:l=fe,popupRef:i}=r,[s,o]=Y(null);return T(()=>{if(!t)return void o(null);const r=()=>{const t=e.current,r=t?.getBoundingClientRect();if(!r)return;const s=be(t),c=s.bottom-r.bottom-4-8,d=r.top-s.top-4-8,u=c<Math.min(l,160)&&d>c,h=Math.max(96,Math.min(l,u?d:c)),m=Math.max(0,s.right-s.left-16),p={minWidth:r.width,maxWidth:Math.min(a,m),maxHeight:h};if(n){const e=Math.min(r.width,m);p.width=e,p.maxWidth=e,p.left=Math.min(Math.max(s.left+8,r.left),s.right-8-e)}else if(i&&s.right-8-r.left<p.maxWidth&&Math.min(r.right,s.right-8)-s.left-8<p.maxWidth){const e=i.current?.offsetWidth??0,t=e>0?Math.min(e,p.maxWidth):p.maxWidth;p.left=Math.max(s.left+8,Math.min(r.left,s.right-8-t))}else if(s.right-8-r.left<p.maxWidth){const e=Math.min(r.right,s.right-8);p.right=window.innerWidth-e,p.maxWidth=Math.min(p.maxWidth,Math.max(0,e-s.left-8))}else p.left=Math.max(s.left+8,r.left);u?p.bottom=window.innerHeight-r.top+4:p.top=r.bottom+4,o(p)};return r(),Me(()=>e.current,r,i?()=>i.current?.offsetWidth??NaN:void 0)},[t,e,n,a,l,i]),s}function Le(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function De(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function je(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?Le(e):De(e)}function Se(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 ze=R(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
5
5
  return ne("select",{ref:c,value:e,onChange:e=>t(e.target.value),"aria-invalid":a||void 0,className:he({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...o,children:[void 0!==n&&/* @__PURE__ */re("option",{value:"",disabled:!0,children:n}),r.map(e=>/* @__PURE__ */re("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]})}),Pe=R(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:s,size:o,touchSize:c,title:d,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,...p},g){const[f,x]=Y(!1),[y,v]=Y(-1),w=H(null),N=H(null),k=H(null),L=H(f);L.current=f;const D=H({buffer:"",timer:null}),j=_(),S=`${j}-listbox`,z=e=>`${j}-opt-${e}`,P=Ce(N,f,{matchTriggerWidth:!0}),A=r.findIndex(t=>t.value===e),F=A>=0?r[A].label:void 0,B=A>=0?r[A].lang:void 0,T=O((e=!0)=>{x(!1),v(-1),e&&N.current?.focus()},[]),I=O(()=>{s||(v(A>=0?A:Le(r)),x(!0))},[s,r,A]),W=O(e=>{const n=r[e];n&&!n.disabled&&(t(n.value),T())},[r,t,T]);q(()=>{if(!f)return;return M(e=>!("Escape"!==e.key||!L.current)&&(T(),!0))},[f,T]),q(()=>{if(!f)return;const e=e=>{const t=e.target;w.current?.contains(t)||k.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e);const t=$(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[f,T]),q(()=>{!f||y<0||k.current?.querySelector(`#${CSS.escape(z(y))}`)?.scrollIntoView({block:"nearest"})});const E=O(e=>{const t=D.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const n=f?y:A,a=Se(r,t.buffer,n);a<0||(f?v(a):W(a))},[f,y,A,r,W]);/* @__PURE__ */
@@ -31,22 +31,22 @@ return re("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColo
31
31
  return ne("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
32
32
  /* @__PURE__ */re("path",{d:"M12 15V4"}),
33
33
  /* @__PURE__ */re("path",{d:"M8 8l4-4 4 4"}),
34
- /* @__PURE__ */re("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function nt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:s,className:c,accept:u="image/*",maxSizeBytes:m,fit:p="cover",height:g=112,placeholder:f,cta:x,acceptHint:b,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:N,removeLabel:k,busy:M=!1,busyLabel:$,disabled:C=!1}){const L=j().media,D=x??L.cta,S=N??L.replace,z=k??L.remove,P=$??L.uploading,A=_(),F=H(null),[B,T]=Y(null);q(()=>()=>{F.current&&URL.revokeObjectURL(F.current)},[]);const I=C||M,W=!!e&&(Qe(e,u)||e===B),E=f??Ke(u,L),R=e=>{r?r(e):n?n(e):(e=>{F.current&&URL.revokeObjectURL(F.current);const r=URL.createObjectURL(e);F.current=r,T(e.type.startsWith("video/")?r:null),t(r)})(e)},O=d({accept:u,maxSizeBytes:m,acceptHint:b,multiple:!1,disabled:I,onAccept:([e])=>R(e)}),{dragOver:U}=O,V=()=>{I||(r?r():O.open())},K=e?Ue(e):"",Z=/* @__PURE__ */ne("div",{children:[
35
- /* @__PURE__ */ne("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",U?"border-blue-500":"border-gray-200"].join(" "),style:{height:g},children:[W?/* @__PURE__ */re("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:p}}):/* @__PURE__ */re("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:p}}),y&&e&&/* @__PURE__ */re(Xe,{children:K}),M&&/* @__PURE__ */re(Je,{label:P,rounded:"rounded-md"})]}),!C&&(v||w)&&/* @__PURE__ */ne("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */re(o,{id:A,variant:"secondary",size:"sm",onClick:()=>V(),disabled:M,children:S}),w&&/* @__PURE__ */re(o,{variant:"ghost",size:"sm",onClick:()=>{F.current&&(URL.revokeObjectURL(F.current),F.current=null),T(null),t("")},disabled:M,children:z})]})]}),G=/* @__PURE__ */re("button",{type:"button",id:A,onClick:()=>V(),disabled:I,"aria-label":"string"==typeof E?E:L.upload,"aria-busy":M||void 0,"aria-invalid":!!i||void 0,"aria-required":s||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...O.zoneProps,className:Ze(U,I,Ge(I)),style:{minHeight:g},children:M?/* @__PURE__ */ne("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
34
+ /* @__PURE__ */re("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function nt({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:d,accept:h="image/*",maxSizeBytes:m,fit:p="cover",height:g=112,placeholder:f,cta:x,acceptHint:b,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:N,removeLabel:k,busy:M=!1,busyLabel:$,disabled:C=!1}){const L=j().media,D=x??L.cta,S=N??L.replace,z=k??L.remove,P=$??L.uploading,A=_(),F=H(null),[B,T]=Y(null);q(()=>()=>{F.current&&URL.revokeObjectURL(F.current)},[]);const I=C||M,W=!!e&&(Qe(e,h)||e===B),E=f??Ke(h,L),R=e=>{r?r(e):n?n(e):(e=>{F.current&&URL.revokeObjectURL(F.current);const r=URL.createObjectURL(e);F.current=r,T(e.type.startsWith("video/")?r:null),t(r)})(e)},O=s({accept:h,maxSizeBytes:m,acceptHint:b,multiple:!1,disabled:I,onAccept:([e])=>R(e)}),{dragOver:U}=O,V=()=>{I||(r?r():O.open())},K=e?Ue(e):"",Z=/* @__PURE__ */ne("div",{children:[
35
+ /* @__PURE__ */ne("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",U?"border-blue-500":"border-gray-200"].join(" "),style:{height:g},children:[W?/* @__PURE__ */re("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:p}}):/* @__PURE__ */re("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:p}}),y&&e&&/* @__PURE__ */re(Xe,{children:K}),M&&/* @__PURE__ */re(Je,{label:P,rounded:"rounded-md"})]}),!C&&(v||w)&&/* @__PURE__ */ne("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */re(u,{id:A,variant:"secondary",size:"sm",onClick:()=>V(),disabled:M,children:S}),w&&/* @__PURE__ */re(u,{variant:"ghost",size:"sm",onClick:()=>{F.current&&(URL.revokeObjectURL(F.current),F.current=null),T(null),t("")},disabled:M,children:z})]})]}),G=/* @__PURE__ */re("button",{type:"button",id:A,onClick:()=>V(),disabled:I,"aria-label":"string"==typeof E?E:L.upload,"aria-busy":M||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:Ze(U,I,Ge(I)),style:{minHeight:g},children:M?/* @__PURE__ */ne("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
36
36
  /* @__PURE__ */re(et,{}),
37
37
  /* @__PURE__ */re("span",{className:"text-xs font-medium text-gray-500",children:P})]}):/* @__PURE__ */ne(ae,{children:[
38
38
  /* @__PURE__ */re("span",{className:"text-gray-400",children:/* @__PURE__ */re(rt,{})}),
39
39
  /* @__PURE__ */re("span",{className:"px-3 text-xs text-gray-500",children:E}),
40
40
  /* @__PURE__ */re("span",{className:"text-sm font-medium text-blue-600",children:D}),b&&/* @__PURE__ */re("span",{className:"text-xs text-gray-400",children:b})]})});/* @__PURE__ */
41
- return ne(We,{label:a,htmlFor:A,hint:l,error:i,required:s,className:c,children:[e?Z:G,!r&&/* @__PURE__ */re("input",{...O.inputProps}),
42
- /* @__PURE__ */re(h,{rejections:O.rejections})]})}function at({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:c,onSave:d,onRemove:u,accept:h="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:m="PNG · ICO · SVG · JPG · WEBP",maxBytes:p=5242880,previews:g=[],disabled:f=!1}){const x=H(null),[b,y]=Y(null),[v,w]=Y(""),[N,k]=Y(""),[M,$]=Y(!1),[C,L]=Y(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(c),S=j().brandAsset,z=v||e||a||"",P=b?null:e?t:l,A=b?null:e?n:i;q(()=>()=>{x.current&&URL.revokeObjectURL(x.current)},[]);const F=()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)};/* @__PURE__ */
43
- return ne("section",{"aria-label":S.region(c,s),className:"grid gap-4 lg:grid-cols-2",children:[
41
+ return ne(We,{label:a,htmlFor:A,hint:l,error:i,required:o,className:d,children:[e?Z:G,!r&&/* @__PURE__ */re("input",{...O.inputProps}),
42
+ /* @__PURE__ */re(c,{rejections:O.rejections})]})}function at({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept:h="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:m="PNG · ICO · SVG · JPG · WEBP",maxBytes:p=5242880,previews:g=[],disabled:f=!1}){const x=H(null),[b,y]=Y(null),[v,w]=Y(""),[N,k]=Y(""),[M,$]=Y(!1),[C,L]=Y(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),S=j().brandAsset,z=v||e||a||"",P=b?null:e?t:l,A=b?null:e?n:i;q(()=>()=>{x.current&&URL.revokeObjectURL(x.current)},[]);const F=()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)};/* @__PURE__ */
43
+ return ne("section",{"aria-label":S.region(o,s),className:"grid gap-4 lg:grid-cols-2",children:[
44
44
  /* @__PURE__ */ne("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
45
- /* @__PURE__ */re(nt,{value:z,onChange:()=>{},onFile:e=>{if(f)return;F();const t=URL.createObjectURL(e);x.current=t,y(e),w(t),k("")},label:c,hint:N||S.usedFor(s),error:N||void 0,accept:h,acceptHint:m,maxSizeBytes:p,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:f}),
45
+ /* @__PURE__ */re(nt,{value:z,onChange:()=>{},onFile:e=>{if(f)return;F();const t=URL.createObjectURL(e);x.current=t,y(e),w(t),k("")},label:o,hint:N||S.usedFor(s),error:N||void 0,accept:h,acceptHint:m,maxSizeBytes:p,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:f}),
46
46
  /* @__PURE__ */ne("div",{className:"mt-3 flex flex-wrap gap-2",children:[
47
- /* @__PURE__ */re(o,{onClick:async()=>{if(b&&!f&&!M){$(!0),k("");try{await d(b),F(),y(null),w("")}catch(e){k(e instanceof Error?e.message:S.saveFailed(D,c))}finally{$(!1)}}},disabled:!b||f,loading:M,children:S.save(D,c)}),(b||e)&&/* @__PURE__ */re(o,{variant:"ghost-danger",onClick:async()=>{if(!f&&!C){if(b)return F(),y(null),w(""),void k("");if(e){L(!0),k("");try{await u()}catch(e){k(e instanceof Error?e.message:S.removeFailed(D,c))}finally{L(!1)}}}},disabled:f,loading:C,children:b?S.discard:S.remove(D,c)})]})]}),g.length>0&&/* @__PURE__ */ne("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(c),children:[
47
+ /* @__PURE__ */re(u,{onClick:async()=>{if(b&&!f&&!M){$(!0),k("");try{await c(b),F(),y(null),w("")}catch(e){k(e instanceof Error?e.message:S.saveFailed(D,o))}finally{$(!1)}}},disabled:!b||f,loading:M,children:S.save(D,o)}),(b||e)&&/* @__PURE__ */re(u,{variant:"ghost-danger",onClick:async()=>{if(!f&&!C){if(b)return F(),y(null),w(""),void k("");if(e){L(!0),k("");try{await d()}catch(e){k(e instanceof Error?e.message:S.removeFailed(D,o))}finally{L(!1)}}}},disabled:f,loading:C,children:b?S.discard:S.remove(D,o)})]})]}),g.length>0&&/* @__PURE__ */ne("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(o),children:[
48
48
  /* @__PURE__ */re("h3",{className:"text-sm font-semibold text-gray-900",children:S.preview}),
49
- /* @__PURE__ */re("div",{className:"mt-3 grid gap-3",children:g.map(e=>{const t=/* @__PURE__ */re(r,{src:z,alt:S.alt(s,c),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:A,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
49
+ /* @__PURE__ */re("div",{className:"mt-3 grid gap-3",children:g.map(e=>{const t=/* @__PURE__ */re(r,{src:z,alt:S.alt(s,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:A,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
50
50
  return ne("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
51
51
  /* @__PURE__ */re("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */ne("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
52
52
  /* @__PURE__ */ne("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
@@ -59,16 +59,16 @@ return ne("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
59
59
  /* @__PURE__ */re("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??s}),e.url&&/* @__PURE__ */re("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
60
60
  /* @__PURE__ */re("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??s}),e.description&&/* @__PURE__ */re("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */ne("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,
61
61
  /* @__PURE__ */re("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function lt(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 it=U(null);function st(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 ot({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Y(t),[i,s]=Y(!0),[o,c]=Y(null),d=H(e),u=H(t);d.current=e,u.current=t,q(()=>{const e=new AbortController;let t=!0;return l(u.current),s(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),s(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),s(!1))}),()=>{t=!1,e.abort()}},[]),q(()=>(st(a.favicon_url),()=>st(null)),[a.favicon_url]),q(()=>{r&&(document.title=r(a))},[a,r]);const h=V(()=>({branding:a,loading:i,error:o}),[a,i,o]);/* @__PURE__ */
62
- return re(it.Provider,{value:h,children:n})}function ct(){const e=J(it);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var dt=/* @__PURE__ */re("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */re("path",{d:"M6 6l12 12M18 6L6 18"})});function ut({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:s,required:o,className:c,accept:u="image/*",maxSizeBytes:m,maxFiles:p,fit:g="cover",thumbSize:f=96,placeholder:x,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:N=!1,busyLabel:k,disabled:M=!1,readOnly:$=!1}){const C=j().media,L=b??C.cta,D=w??C.cover,S=k??C.uploading,z=_(),[P,A]=Y(null),F=M||N,B=!(!t&&!r||F||$),T=!!n&&!F&&!$,I=!!a&&!F&&!$,W=Ge(F),E=x??Ke(u,C),R=d({accept:u,maxSizeBytes:m,maxFiles:p,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),O=R.dragOver,H=()=>{B&&(t?t():R.open())},q={width:f,height:f},U=B&&/* @__PURE__ */ne("button",{type:"button",onClick:()=>H(),"aria-label":C.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 ${W}`,style:q,children:[
62
+ return re(it.Provider,{value:h,children:n})}function ct(){const e=J(it);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var dt=/* @__PURE__ */re("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */re("path",{d:"M6 6l12 12M18 6L6 18"})});function ut({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:d,className:u,accept:h="image/*",maxSizeBytes:m,maxFiles:p,fit:g="cover",thumbSize:f=96,placeholder:x,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:N=!1,busyLabel:k,disabled:M=!1,readOnly:$=!1}){const C=j().media,L=b??C.cta,D=w??C.cover,S=k??C.uploading,z=_(),[P,A]=Y(null),F=M||N,B=!(!t&&!r||F||$),T=!!n&&!F&&!$,I=!!a&&!F&&!$,W=Ge(F),E=x??Ke(h,C),R=s({accept:h,maxSizeBytes:m,maxFiles:p,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),O=R.dragOver,H=()=>{B&&(t?t():R.open())},q={width:f,height:f},U=B&&/* @__PURE__ */ne("button",{type:"button",onClick:()=>H(),"aria-label":C.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 ${W}`,style:q,children:[
63
63
  /* @__PURE__ */re(rt,{className:"h-5 w-5"}),
64
64
  /* @__PURE__ */re("span",{className:"text-xs font-medium text-gray-500",children:C.add})]}),V=B?/* @__PURE__ */ne("button",{type:"button",onClick:()=>H(),"aria-label":"string"==typeof E?E:C.upload,className:Ze(O,!1,W),style:{minHeight:f+32},children:[
65
65
  /* @__PURE__ */re("span",{className:"text-gray-400",children:/* @__PURE__ */re(rt,{})}),
66
66
  /* @__PURE__ */re("span",{className:"px-3 text-xs text-gray-500",children:E}),
67
67
  /* @__PURE__ */re("span",{className:"text-sm font-medium text-blue-600",children:L}),y&&/* @__PURE__ */re("span",{className:"text-xs text-gray-400",children:y})]}):/* @__PURE__ */re("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:f+32},children:C.empty});/* @__PURE__ */
68
- return ne(We,{label:l,labelId:l?`${z}-label`:void 0,htmlFor:z,hint:i,error:s,required:o,className:c,children:[
69
- /* @__PURE__ */ne("div",{id:z,role:"group","aria-labelledby":l?`${z}-label`:void 0,"aria-describedby":s?`${z}-error`:i?`${z}-hint`:void 0,"aria-busy":N||void 0,...R.zoneProps,className:"relative rounded-lg transition-colors",style:{...F?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?V:/* @__PURE__ */ne("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:Qe(t.url,u),i=Ue(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
68
+ return ne(We,{label:l,labelId:l?`${z}-label`:void 0,htmlFor:z,hint:i,error:o,required:d,className:u,children:[
69
+ /* @__PURE__ */ne("div",{id:z,role:"group","aria-labelledby":l?`${z}-label`:void 0,"aria-describedby":o?`${z}-error`:i?`${z}-hint`:void 0,"aria-busy":N||void 0,...R.zoneProps,className:"relative rounded-lg transition-colors",style:{...F?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?V:/* @__PURE__ */ne("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:Qe(t.url,h),i=Ue(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
70
70
  return ne("div",{draggable:I||void 0,onDragStart:I?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),A(r)}:void 0,onDragEnd:I?()=>A(null):void 0,onDragOver:I?e=>{null!=P&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:I?e=>{null!=P&&(e.preventDefault(),e.stopPropagation(),P!==r&&a(P,r),A(null))}:void 0,tabIndex:I?0:void 0,"aria-label":I?C.reorder(i,r+1,e.length):void 0,onKeyDown:I?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",W,P===r?"opacity-50":""].join(" "),style:{...q,cursor:I?"move":void 0},children:[l?/* @__PURE__ */re("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:g}}):/* @__PURE__ */re("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:g}}),s&&/* @__PURE__ */re("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:D}),null!=t.caption&&/* @__PURE__ */re(Xe,{children:t.caption}),T&&/* @__PURE__ */re("button",{type:"button",onClick:()=>n(t.id),"aria-label":C.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${W}`,style:{background:"var(--rosh-media-scrim-button)"},children:dt})]},t.id)}),U]}),N&&/* @__PURE__ */re(Je,{label:S})]}),!t&&r&&/* @__PURE__ */re("input",{...R.inputProps}),
71
- /* @__PURE__ */re(h,{rejections:R.rejections})]})}var ht=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mt=["January","February","March","April","May","June","July","August","September","October","November","December"];function pt(e){return ht[parseInt(e,10)-1]??e}function gt(e){return mt[parseInt(e,10)-1]??e}var ft={dateStyle:"medium"},xt=/* @__PURE__ */new Map;function bt(e,t){const r=`${e}|${JSON.stringify(t)}`;let n=xt.get(r);return n||(n=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),xt.set(r,n)),n}function yt(e,t){if(!e)return"—";const r=e.includes("T")?e.split("T")[0]:e,[n,a,l]=r.split("-").map(Number);if(!n||!a||!l)return e;if(t?.locale)return bt(t.locale,t.style??ft).format(new Date(Date.UTC(n,a-1,l)));const i=String(l).padStart(2,"0"),s=String(a).padStart(2,"0"),o=String(n);switch(function(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}()){case"MM/DD/YYYY":return`${s}/${i}/${o}`;case"YYYY-MM-DD":return`${o}-${s}-${i}`;case"DD-MM-YYYY":return`${i}-${s}-${o}`;case"MM-DD-YYYY":return`${s}-${i}-${o}`;case"DD.MM.YYYY":return`${i}.${s}.${o}`;case"YYYY.MM.DD":return`${o}.${s}.${i}`;case"YYYY/MM/DD":return`${o}/${s}/${i}`;case"DD/MM/YY":return`${i}/${s}/${o.slice(-2)}`;case"MM/DD/YY":return`${s}/${i}/${o.slice(-2)}`;case"DD/MMM/YYYY":return`${i}/${pt(s)}/${o}`;case"DD/MMM/YY":return`${i}/${pt(s)}/${o.slice(-2)}`;case"DD MMM YYYY":return`${i} ${pt(s)} ${o}`;case"MMM DD, YYYY":return`${pt(s)} ${i}, ${o}`;case"DD MMMM YYYY":return`${i} ${gt(s)} ${o}`;case"MMMM DD, YYYY":return`${gt(s)} ${i}, ${o}`;default:return`${i}/${s}/${o}`}}var vt={months:mt,monthsShort:ht,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${mt[t]} ${e}`,shortMonthYear:(e,t)=>`${ht[t]} ${e}`,longDate:(e,t,r)=>`${r} ${mt[t]} ${e}`},wt=/* @__PURE__ */new Map;function Nt(e){if(!e)return vt;const t=wt.get(e);if(t)return t;const r=t=>bt(e,t),n=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),a=r({month:"long"}),l=r({month:"short"}),i=r({weekday:"long"}),s=r({weekday:"short"}),o=r({month:"long",year:"numeric"}),c=r({month:"short",year:"numeric"}),d=r({day:"numeric",month:"long",year:"numeric"}),u=Array.from({length:12},(e,t)=>t),h=Array.from({length:7},(e,t)=>t),m={months:u.map(e=>a.format(n(2e3,e))),monthsShort:u.map(e=>l.format(n(2e3,e))),weekdays:h.map(e=>i.format(n(2e3,0,2+e))),weekdaysShort:h.map(e=>s.format(n(2e3,0,2+e))),monthYear:(e,t)=>o.format(n(e,t)),shortMonthYear:(e,t)=>c.format(n(e,t)),longDate:(e,t,r)=>d.format(n(e,t,r))};return wt.set(e,m),m}var kt=/* @__PURE__ */new Map;function Mt(e){if(!e)return 0;let t=kt.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),n="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===n?.firstDay&&(t=1)}catch{}kt.set(e,t)}return t}var $t=e=>String(e).padStart(2,"0");function Ct(e){return`${e.getFullYear()}-${$t(e.getMonth()+1)}-${$t(e.getDate())}`}function Lt(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 Dt=e=>`${e.getFullYear()}-${$t(e.getMonth()+1)}`;var jt=()=>Ct(/* @__PURE__ */new Date);var St=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),zt=(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 Pt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=Lt(e),p=I(jt,null),g=Lt(p),f=j().calendar,x=D(),b=Nt(x),y=I(()=>Mt(x),0),v=c??y,w=()=>{if(!g)return null;const e=Dt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[N,k]=Y(()=>s||(m?Dt(m):w())),M=i??N??w(),$=null===M?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}(M,g),[C,L]=Y(()=>e??p),S=H(null),z=H(!1),[P,A]=Y("days"),F=V(()=>$?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))}($,v):[],[M,v]),B=e=>!!a&&e<a||!!l&&e>l,T=C??p,W=F.some(e=>Ct(e)===T),E=$?F.find(e=>e.getMonth()===$.getMonth())??F[0]:null,R=W&&T?T:E?Ct(E):"";if(q(()=>{z.current&&(z.current=!1,S.current?.querySelector('[data-active="true"]')?.focus())},[R,M]),!$)/* @__PURE__ */
71
+ /* @__PURE__ */re(c,{rejections:R.rejections})]})}var ht=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mt=["January","February","March","April","May","June","July","August","September","October","November","December"];function pt(e){return ht[parseInt(e,10)-1]??e}function gt(e){return mt[parseInt(e,10)-1]??e}var ft={dateStyle:"medium"},xt=/* @__PURE__ */new Map;function bt(e,t){const r=`${e}|${JSON.stringify(t)}`;let n=xt.get(r);return n||(n=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),xt.set(r,n)),n}function yt(e,t){if(!e)return"—";const r=e.includes("T")?e.split("T")[0]:e,[n,a,l]=r.split("-").map(Number);if(!n||!a||!l)return e;if(t?.locale)return bt(t.locale,t.style??ft).format(new Date(Date.UTC(n,a-1,l)));const i=String(l).padStart(2,"0"),s=String(a).padStart(2,"0"),o=String(n);switch(function(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}()){case"MM/DD/YYYY":return`${s}/${i}/${o}`;case"YYYY-MM-DD":return`${o}-${s}-${i}`;case"DD-MM-YYYY":return`${i}-${s}-${o}`;case"MM-DD-YYYY":return`${s}-${i}-${o}`;case"DD.MM.YYYY":return`${i}.${s}.${o}`;case"YYYY.MM.DD":return`${o}.${s}.${i}`;case"YYYY/MM/DD":return`${o}/${s}/${i}`;case"DD/MM/YY":return`${i}/${s}/${o.slice(-2)}`;case"MM/DD/YY":return`${s}/${i}/${o.slice(-2)}`;case"DD/MMM/YYYY":return`${i}/${pt(s)}/${o}`;case"DD/MMM/YY":return`${i}/${pt(s)}/${o.slice(-2)}`;case"DD MMM YYYY":return`${i} ${pt(s)} ${o}`;case"MMM DD, YYYY":return`${pt(s)} ${i}, ${o}`;case"DD MMMM YYYY":return`${i} ${gt(s)} ${o}`;case"MMMM DD, YYYY":return`${gt(s)} ${i}, ${o}`;default:return`${i}/${s}/${o}`}}var vt={months:mt,monthsShort:ht,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${mt[t]} ${e}`,shortMonthYear:(e,t)=>`${ht[t]} ${e}`,longDate:(e,t,r)=>`${r} ${mt[t]} ${e}`},wt=/* @__PURE__ */new Map;function Nt(e){if(!e)return vt;const t=wt.get(e);if(t)return t;const r=t=>bt(e,t),n=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),a=r({month:"long"}),l=r({month:"short"}),i=r({weekday:"long"}),s=r({weekday:"short"}),o=r({month:"long",year:"numeric"}),c=r({month:"short",year:"numeric"}),d=r({day:"numeric",month:"long",year:"numeric"}),u=Array.from({length:12},(e,t)=>t),h=Array.from({length:7},(e,t)=>t),m={months:u.map(e=>a.format(n(2e3,e))),monthsShort:u.map(e=>l.format(n(2e3,e))),weekdays:h.map(e=>i.format(n(2e3,0,2+e))),weekdaysShort:h.map(e=>s.format(n(2e3,0,2+e))),monthYear:(e,t)=>o.format(n(e,t)),shortMonthYear:(e,t)=>c.format(n(e,t)),longDate:(e,t,r)=>d.format(n(e,t,r))};return wt.set(e,m),m}var kt=/* @__PURE__ */new Map;function Mt(e){if(!e)return 0;let t=kt.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),n="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===n?.firstDay&&(t=1)}catch{}kt.set(e,t)}return t}var $t=e=>String(e).padStart(2,"0");function Ct(e){return`${e.getFullYear()}-${$t(e.getMonth()+1)}-${$t(e.getDate())}`}function Lt(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 Dt=e=>`${e.getFullYear()}-${$t(e.getMonth()+1)}`;var jt=()=>Ct(/* @__PURE__ */new Date);var St=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),zt=(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 Pt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=Lt(e),p=I(jt,null),g=Lt(p),f=j().calendar,x=D(),b=Nt(x),y=I(()=>Mt(x),0),v=c??y,w=()=>{if(!g)return null;const e=Dt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[N,k]=Y(()=>s||(m?Dt(m):w())),M=i??N??w(),$=null===M?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}(M,g),[C,L]=Y(()=>e??p),S=H(null),z=H(!1),[P,A]=Y("days"),F=V(()=>$?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))}($,v):[],[M,v]),B=e=>!!a&&e<a||!!l&&e>l,T=C??p,W=F.some(e=>Ct(e)===T),E=$?F.find(e=>e.getMonth()===$.getMonth())??F[0]:null,R=W&&T?T:E?Ct(E):"";if(q(()=>{z.current&&(z.current=!1,S.current?.querySelector('[data-active="true"]')?.focus())},[R,M]),!$)/* @__PURE__ */
72
72
  return ne("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
73
73
  /* @__PURE__ */re("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */re("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const O=e=>"years"===P?new Date($.getFullYear()+12*e,$.getMonth(),1):"months"===P?new Date($.getFullYear()+e,$.getMonth(),1):zt($,e),_=e=>{const t=Dt(e);void 0===i&&k(t),o?.(t)},U=u??b.monthYear($.getFullYear(),$.getMonth());/* @__PURE__ */
74
74
  return ne("div",{className:h,children:[
@@ -120,8 +120,8 @@ return ne("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-
120
120
  /* @__PURE__ */re("span",{className:"min-w-0 font-mono text-gray-800 "+(c?"whitespace-pre-wrap break-all":"truncate"),title:c?void 0:e,children:t??e}),!s&&/* @__PURE__ */ne(ae,{children:[
121
121
  /* @__PURE__ */re(ie,{id:d,"aria-label":a?f.copyLabel(a):f.copy,"aria-describedby":u,onClick:x,className:`${y} text-gray-400`,children:/* @__PURE__ */re(m?dr:cr,{})}),
122
122
  /* @__PURE__ */re("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var hr=2;function mr(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 pr(e){return e.slice(0,-1)}var gr=["1","2","3","4","5","6","7","8","9",".","0"];function fr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=j().keypad,s=r=>{r!==e&&t(r)};/* @__PURE__ */
123
- return ne("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[gr.map(t=>/* @__PURE__ */re(o,{size:"touch-xl",variant:"secondary",onClick:()=>s(mr(e,t)),children:t},t)),
124
- /* @__PURE__ */re(o,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(pr(e)),children:"⌫"}),r&&/* @__PURE__ */re(o,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var xr={md:"h-24 p-3",lg:"h-32 p-4"},br=R(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...s},o){/* @__PURE__ */
123
+ return ne("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[gr.map(t=>/* @__PURE__ */re(u,{size:"touch-xl",variant:"secondary",onClick:()=>s(mr(e,t)),children:t},t)),
124
+ /* @__PURE__ */re(u,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(pr(e)),children:"⌫"}),r&&/* @__PURE__ */re(u,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var xr={md:"h-24 p-3",lg:"h-32 p-4"},br=R(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...s},o){/* @__PURE__ */
125
125
  return ne("button",{ref:o,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)]",xr[r],i].filter(Boolean).join(" "),...s,children:[
126
126
  /* @__PURE__ */re("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */re("span",{className:"text-sm text-gray-500",children:t})]})}),yr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},vr="bg-white text-gray-900 shadow-sm rosh-segmented-on",wr="text-gray-600 hover:text-gray-900";function Nr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:s="","aria-labelledby":o,"aria-describedby":c}){const d={"aria-label":o?void 0:i,"aria-labelledby":o,"aria-describedby":c},u=_(),h=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-lg bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${l?"w-full":""} ${s}`.trim(),m="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
127
127
  return re("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e;
@@ -129,17 +129,17 @@ return re("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l
129
129
  return ne("label",{htmlFor:l,title:r.title,className:[m,"relative",yr[a],i?vr:wr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
130
130
  /* @__PURE__ */re("input",{id:l,type:"radio",name:n,value:r.value,checked:i,disabled:r.disabled,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)]"}),r.icon,r.label]},r.value)})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e;/* @__PURE__ */
131
131
  return ne("button",{type:"button",title:r.title,"aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[m,yr[a],n?vr:wr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var kr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},Mr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},$r={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},Cr=R(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=_(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,x=f?`${m}-reason`:void 0,b=[p,g??x].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */re("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":b,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",kr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */re("span",{className:["inline-block rounded-full bg-white shadow transition-transform",Mr[n],e?$r[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */ne("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
132
- /* @__PURE__ */ne("span",{className:"min-w-0",children:[a&&/* @__PURE__ */re("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */re("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */re("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */re("span",{className:s,children:y})}),Lr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Dr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var jr=R(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,disabled:i,invalid:s,placeholder:o,size:c,prefix:d,suffix:u,id:h,name:m,className:p="",onBlur:g},f){const[x,b]=Y(()=>Lr(e,a)),y=H(x);y.current=x,q(()=>{Dr(y.current)!==e&&b(Lr(e,a))},[e,a]);const v=/* @__PURE__ */re("input",{ref:f,id:h,name:m,type:"text",inputMode:0===a?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?void 0:Lr(e,a),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(Dr(r)))},onKeyDown:e=>{const s=l??1,o="ArrowUp"===e.key?s:"ArrowDown"===e.key?-s:"PageUp"===e.key?10*s:"PageDown"===e.key?10*-s:null;null===o||i||(e.preventDefault(),(e=>{let i=(Dr(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(Lr(i,a)),t(i)})(o))},onBlur:()=>{const e=Dr(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=a&&(l=Number(l.toFixed(a))),b(Lr(l,a)),l!==e&&t(l)}g?.()},className:he({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */ne("div",{className:"relative",children:[d&&/* @__PURE__ */re("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:d}),v,u&&/* @__PURE__ */re("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),Sr=R(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:s=!1,label:o,hint:c,error:m,required:p,className:g=""},f){const x=_(),b=j().files,y=d({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:s,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:c?`${x}-hint`:void 0;/* @__PURE__ */
133
- return ne(We,{label:o,htmlFor:x,hint:c,error:m,required:p,className:g,children:[
134
- /* @__PURE__ */ne("button",{ref:f,type:"button",id:x,disabled:s,onClick:y.open,"aria-invalid":!!m||void 0,"aria-required":p||void 0,"aria-describedby":v,...y.zoneProps,className:Ze(y.dragOver,s,`px-4 py-6 ${Ge(s)}`),children:[
132
+ /* @__PURE__ */ne("span",{className:"min-w-0",children:[a&&/* @__PURE__ */re("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */re("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */re("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */re("span",{className:s,children:y})}),Lr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Dr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var jr=R(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,disabled:i,invalid:s,placeholder:o,size:c,prefix:d,suffix:u,id:h,name:m,className:p="",onBlur:g},f){const[x,b]=Y(()=>Lr(e,a)),y=H(x);y.current=x,q(()=>{Dr(y.current)!==e&&b(Lr(e,a))},[e,a]);const v=/* @__PURE__ */re("input",{ref:f,id:h,name:m,type:"text",inputMode:0===a?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?void 0:Lr(e,a),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(Dr(r)))},onKeyDown:e=>{const s=l??1,o="ArrowUp"===e.key?s:"ArrowDown"===e.key?-s:"PageUp"===e.key?10*s:"PageDown"===e.key?10*-s:null;null===o||i||(e.preventDefault(),(e=>{let i=(Dr(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(Lr(i,a)),t(i)})(o))},onBlur:()=>{const e=Dr(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=a&&(l=Number(l.toFixed(a))),b(Lr(l,a)),l!==e&&t(l)}g?.()},className:he({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */ne("div",{className:"relative",children:[d&&/* @__PURE__ */re("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:d}),v,u&&/* @__PURE__ */re("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),Sr=R(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:d=!1,label:u,hint:h,error:m,required:p,className:g=""},f){const x=_(),b=j().files,y=s({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:d,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:h?`${x}-hint`:void 0;/* @__PURE__ */
133
+ return ne(We,{label:u,htmlFor:x,hint:h,error:m,required:p,className:g,children:[
134
+ /* @__PURE__ */ne("button",{ref:f,type:"button",id:x,disabled:d,onClick:y.open,"aria-invalid":!!m||void 0,"aria-required":p||void 0,"aria-describedby":v,...y.zoneProps,className:Ze(y.dragOver,d,`px-4 py-6 ${Ge(d)}`),children:[
135
135
  /* @__PURE__ */ne("span",{children:[
136
136
  /* @__PURE__ */re("span",{className:"text-sm font-medium text-blue-600",children:a?b.chooseMany:b.chooseOne}),
137
137
  /* @__PURE__ */re("span",{className:"text-sm text-gray-500",children:` ${a?b.dragMany:b.dragOne}`})]}),n&&/* @__PURE__ */re("span",{className:"text-xs text-gray-400",children:n})]}),
138
138
  /* @__PURE__ */re("input",{...y.inputProps}),e.length>0&&/* @__PURE__ */re("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */ne("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
139
139
  /* @__PURE__ */re("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
140
- /* @__PURE__ */re("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:u(r.size,b)}),
141
- /* @__PURE__ */re("button",{type:"button",disabled:s,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":b.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */re(tt,{})})]},`${r.name}-${n}`))}),
142
- /* @__PURE__ */re(h,{rejections:y.rejections})]})});function zr({className:e="h-4 w-4"}){/* @__PURE__ */
140
+ /* @__PURE__ */re("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:o(r.size,b)}),
141
+ /* @__PURE__ */re("button",{type:"button",disabled:d,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":b.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */re(tt,{})})]},`${r.name}-${n}`))}),
142
+ /* @__PURE__ */re(c,{rejections:y.rejections})]})});function zr({className:e="h-4 w-4"}){/* @__PURE__ */
143
143
  return re("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */re("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function Pr({className:e="h-4 w-4"}){/* @__PURE__ */
144
144
  return ne("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
145
145
  /* @__PURE__ */re("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
@@ -148,12 +148,12 @@ return ne("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,childr
148
148
  /* @__PURE__ */re("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */re("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 Fr({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=j().files,l=H(/* @__PURE__ */new Map);q(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),q(()=>()=>{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__ */re("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
149
149
  return ne("li",{className:"flex max-w-full items-center gap-1.5 rounded-md border border-gray-200 bg-gray-50 py-1 pl-1.5 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */re("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */re("span",{className:"text-gray-400",children:/* @__PURE__ */re(Pr,{})}),
150
150
  /* @__PURE__ */re("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
151
- /* @__PURE__ */re("span",{className:"shrink-0 tabular-nums text-gray-400",children:u(e.size,a)}),t&&/* @__PURE__ */re("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__ */re(tt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Br({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=j().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */ne("span",{className:"relative inline-flex",children:[
152
- /* @__PURE__ */re(ie,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */re(zr,{})}),t>0&&/* @__PURE__ */re("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-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */re(o,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */re(zr,{}),children:s})}function Tr({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:s,attachLabel:o,trigger:c="button",actions:u,onReject:m,className:p="",children:g}){const f=d({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),x=H([]);return q(()=>{m&&f.rejections.length>0&&f.rejections!==x.current&&(x.current=f.rejections,m(f.rejections))},[f.rejections,m]),/* @__PURE__ */ne(Ar,{intake:f,dropLabel:s,className:p,children:[g,
151
+ /* @__PURE__ */re("span",{className:"shrink-0 tabular-nums text-gray-400",children:o(e.size,a)}),t&&/* @__PURE__ */re("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__ */re(tt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Br({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=j().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */ne("span",{className:"relative inline-flex",children:[
152
+ /* @__PURE__ */re(ie,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */re(zr,{})}),t>0&&/* @__PURE__ */re("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-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */re(u,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */re(zr,{}),children:s})}function Tr({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:d,trigger:u="button",actions:h,onReject:m,className:p="",children:g}){const f=s({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),x=H([]);return q(()=>{m&&f.rejections.length>0&&f.rejections!==x.current&&(x.current=f.rejections,m(f.rejections))},[f.rejections,m]),/* @__PURE__ */ne(Ar,{intake:f,dropLabel:o,className:p,children:[g,
153
153
  /* @__PURE__ */re(Fr,{files:e,disabled:i,onRemove:r=>{f.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
154
154
  /* @__PURE__ */ne("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
155
- /* @__PURE__ */re(Br,{onClick:f.open,count:e.length,variant:c,label:o,disabled:i}),u]}),
156
- /* @__PURE__ */re(h,{rejections:f.rejections})]})}function Ir({onClear:e,ariaLabel:t}){/* @__PURE__ */
155
+ /* @__PURE__ */re(Br,{onClick:f.open,count:e.length,variant:u,label:d,disabled:i}),h]}),
156
+ /* @__PURE__ */re(c,{rejections:f.rejections})]})}function Ir({onClear:e,ariaLabel:t}){/* @__PURE__ */
157
157
  return re("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 Wr({value:e,onChange:t,options:r,placeholder:n,emptyOptionLabel:a,className:l="",disabled:i,id:s,allowFreeText:o=!1,onSearchChange:c,rightAdornment:d}){const[u,h]=Y(!1),[m,p]=Y(""),g=j(),f=a??g.select.none,x=e=>{p(e),c?.(e)},y=H(null),v=H(null),w=H(null),N=H(null),k=H(u);k.current=u;const L=H(!1),D=r=>{if(!k.current)return;k.current=!1;const n=m.trim();r&&o&&n&&n!==e&&t(n),h(!1),x("")},[S,z]=Y(null);T(()=>{if(!d||u)return void z(null);const t=N.current?.offsetWidth??0;z(t?t+(e&&!i?32:8)+6:null)});const P=Ce(v,u,{matchTriggerWidth:!0}),A=V(()=>{const t=r.find(t=>t.value===e);return t?t.label:o?e:""},[r,e,o]);q(()=>{if(!u)return;const e=e=>{const t=e.target;y.current?.contains(t)||w.current?.contains(t)||D(!0)};document.addEventListener("mousedown",e);const t=$(()=>D(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[u,o,m,e,t]),q(()=>{if(u)return M(e=>!("Escape"!==e.key||!k.current)&&(D(!1),v.current?.blur(),!0))},[u]);const F=V(()=>{const e=/* @__PURE__ */new Set,t=[];for(const n of r)e.has(n.value)||(e.add(n.value),t.push(n));return t},[r]),B=V(()=>{if(c)return F;const e=m.trim().toLowerCase();return e?F.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):F},[F,m,c]);/* @__PURE__ */
158
158
  return ne("div",{ref:y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(y.current?.contains(t)||w.current?.contains(t))||L.current||document.activeElement!==v.current&&D(!0)},children:[
159
159
  /* @__PURE__ */re("input",{id:s,ref:v,type:"text",autoComplete:"off",role:"combobox","aria-expanded":u,value:u?m:A,onChange:e=>{x(e.target.value),h(!0)},onFocus:()=>{i||(x(""),h(!0))},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),1===B.length?(t(B[0].value),D(!1)):o&&m.trim()&&(t(m.trim()),D(!1),v.current?.blur())):"Escape"===e.key?(D(!1),v.current?.blur()):"Tab"===e.key&&D(!0)},placeholder:n||f,className:`${de} ${l} ${e?"pr-8":""} ${i?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:S?{paddingRight:S}:void 0,disabled:i}),e&&!i&&/* @__PURE__ */re(Ir,{ariaLabel:g.select.clear,onClear:()=>{t(""),D(!1)}}),d&&!u&&/* @__PURE__ */re("div",{ref:N,className:`absolute top-1/2 -translate-y-1/2 ${e&&!i?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:d}),u&&le(
@@ -461,11 +461,11 @@ return ne("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,
461
461
  return ne("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>I(e),...E(t,e),children:[e.icon,e.label]},e.key)},U={...Il.test(s)?{}:{zIndex:C.popup},minWidth:o};/* @__PURE__ */
462
462
  return ne("div",{ref:x,className:`relative inline-flex ${l}`.trim(),children:[
463
463
  /* @__PURE__ */re("button",{ref:b,id:S,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?D:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?z(!1):B(P(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),B(P(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),B(P(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 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",children:e}),m&&
464
- /* @__PURE__ */re(v,{portal:!0,className:s,style:U,children:/* @__PURE__ */re("div",{ref:y,id:D,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:S,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(P(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(P(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(P(0,1));else if("End"===e.key)e.preventDefault(),f(P(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),z(!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-L.current.at<500?L.current.text+n:n;L.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?g+1:Math.max(g,0),o=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(El(t[n])&&(o?.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 s="label"===t[l-1]?.type?`${D}-label-${l-1}`:void 0;e.push(/* @__PURE__ */re("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}var Ol=/(^|[\s:])!?z-/;function Yl({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:s,defaultOpen:o=!1,onOpenChange:d,matchTriggerWidth:u=!1,maxHeight:h,initialFocus:g,id:f,triggerLabel:b,"aria-describedby":y,disabled:v,className:w="",triggerClassName:N,panelClassName:k=""}){const[L,D]=Y(o),j=(s??L)&&!v,S=E(),z=H(null),P=H(null),A=H(null),F=H(null),B=_(),I=f??B,W=_(),R=_(),U=_(),V=H(null),K=H(!1),Z=H({openProp:s,onOpenChange:d});Z.current={openProp:s,onOpenChange:d};const G=O(e=>{void 0===Z.current.openProp&&D(e),Z.current.onOpenChange?.(e)},[]),J=O((e=!1)=>{K.current=e,G(!1)},[G]),X=e=>{V.current=e.nativeEvent},Q=O(()=>{const e=A.current,t=P.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=be(t),a=Math.max(0,n.right-n.left-16),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${a}px`,s.maxHeight="none",s.width=u?`${Math.min(r.width,a)}px`:"";const o={width:e.offsetWidth,height:e.offsetHeight},c=h??1/0,d=$e({trigger:r,menu:{width:o.width,height:Math.min(o.height,c)},bounds:n,align:l,side:i}),m=Math.min(d.maxHeight,c);s.left=`${d.left}px`,s.top=`${d.top}px`,s.maxHeight=`${m}px`,s.overflowY=o.height>m?"auto":"",e.dataset.side=d.side,e.dataset.align=l},[l,i,u,h]);T(()=>{j&&S&&Q()}),q(()=>{if(!j||!S)return;const e=Me(()=>P.current,Q),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>Q());return r.observe(t),()=>{e(),r.disconnect()}},[j,S,Q]),q(()=>{if(!j)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(V.current===e)return!1;const t=e.target;return!(t&&(z.current?.contains(t)||A.current?.contains(t)))})(e)&&J(!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=$(()=>J()),a=M(e=>"Escape"===e.key&&(J(),P.current?.focus(),!0));return()=>{t(),r(),n(),a()}},[j,J]),m(A,j&&S),T(()=>{if(!j||!S)return;const e=A.current;return()=>{if(K.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||P.current?.focus({preventScroll:!0})}},[j,S]),q(()=>{if(!j||!S)return;const e=A.current;e&&(K.current=!1,(g?.current??p(e)[0]??e).focus({preventScroll:!0}))},[j,S]);const ee="function"==typeof t?t({close:()=>J()}):t,te=r?{"aria-labelledby":R}:a?{"aria-label":a}:{"aria-labelledby":I};/* @__PURE__ */
464
+ /* @__PURE__ */re(v,{portal:!0,className:s,style:U,children:/* @__PURE__ */re("div",{ref:y,id:D,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:S,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(P(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(P(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(P(0,1));else if("End"===e.key)e.preventDefault(),f(P(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),z(!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-L.current.at<500?L.current.text+n:n;L.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?g+1:Math.max(g,0),o=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(El(t[n])&&(o?.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 s="label"===t[l-1]?.type?`${D}-label-${l-1}`:void 0;e.push(/* @__PURE__ */re("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}var Ol=/(^|[\s:])!?z-/;function Yl({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:s,defaultOpen:o=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:g,id:f,triggerLabel:b,"aria-describedby":y,disabled:v,className:w="",triggerClassName:N,panelClassName:k=""}){const[L,D]=Y(o),j=(s??L)&&!v,S=E(),z=H(null),P=H(null),A=H(null),F=H(null),B=_(),I=f??B,W=_(),R=_(),U=_(),V=H(null),K=H(!1),Z=H({openProp:s,onOpenChange:c});Z.current={openProp:s,onOpenChange:c};const G=O(e=>{void 0===Z.current.openProp&&D(e),Z.current.onOpenChange?.(e)},[]),J=O((e=!1)=>{K.current=e,G(!1)},[G]),X=e=>{V.current=e.nativeEvent},Q=O(()=>{const e=A.current,t=P.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=be(t),a=Math.max(0,n.right-n.left-16),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${a}px`,s.maxHeight="none",s.width=d?`${Math.min(r.width,a)}px`:"";const o={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=$e({trigger:r,menu:{width:o.width,height:Math.min(o.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);s.left=`${h.left}px`,s.top=`${h.top}px`,s.maxHeight=`${m}px`,s.overflowY=o.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);T(()=>{j&&S&&Q()}),q(()=>{if(!j||!S)return;const e=Me(()=>P.current,Q),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>Q());return r.observe(t),()=>{e(),r.disconnect()}},[j,S,Q]),q(()=>{if(!j)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(V.current===e)return!1;const t=e.target;return!(t&&(z.current?.contains(t)||A.current?.contains(t)))})(e)&&J(!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=$(()=>J()),a=M(e=>"Escape"===e.key&&(J(),P.current?.focus(),!0));return()=>{t(),r(),n(),a()}},[j,J]),m(A,j&&S),T(()=>{if(!j||!S)return;const e=A.current;return()=>{if(K.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||P.current?.focus({preventScroll:!0})}},[j,S]),q(()=>{if(!j||!S)return;const e=A.current;e&&(K.current=!1,(g?.current??p(e)[0]??e).focus({preventScroll:!0}))},[j,S]);const ee="function"==typeof t?t({close:()=>J()}):t,te=r?{"aria-labelledby":R}:a?{"aria-label":a}:{"aria-labelledby":I};/* @__PURE__ */
465
465
  return ne("div",{ref:z,className:`relative inline-flex ${w}`.trim(),children:[
466
- /* @__PURE__ */re("button",{ref:P,id:I,type:"button","aria-haspopup":"dialog","aria-expanded":j,"aria-controls":j&&S?W:void 0,"aria-label":b,"aria-describedby":y,disabled:v,onClick:()=>j?J():G(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!j)return;const t=(()=>{const e=A.current;return e?p(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:N??c({variant:"secondary"}),children:e}),j&&S&&le(
467
- /* @__PURE__ */re("div",{ref:A,id:W,role:"dialog",...te,"aria-describedby":n?U:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:X,onFocusCapture:X,onKeyDown:e=>{const t=A.current,r=P.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=p(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=x(r,t);J(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${k}`.trim(),style:Ol.test(k)?void 0:{zIndex:C.popup},children:/* @__PURE__ */ne("div",{ref:F,children:[r&&/* @__PURE__ */re("h2",{id:R,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */re("p",{id:U,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */re("div",{className:"mt-3",children:ee}):ee]})}),document.body)]})}var Hl=6e4;function _l({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Y(null);return q(()=>{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(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,n]),n}function ql({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=_l({currentVersion:e,versionUrl:t,pollMs:r}),s=j();if(null===i)return null;const c=a??(()=>window.location.reload());/* @__PURE__ */
468
- return re("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */ne(Sn,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */re(o,{type:"button",variant:"primary",size:"md",onClick:c,children:s.update.refreshNow}),children:[
466
+ /* @__PURE__ */re("button",{ref:P,id:I,type:"button","aria-haspopup":"dialog","aria-expanded":j,"aria-controls":j&&S?W:void 0,"aria-label":b,"aria-describedby":y,disabled:v,onClick:()=>j?J():G(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!j)return;const t=(()=>{const e=A.current;return e?p(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:N??h({variant:"secondary"}),children:e}),j&&S&&le(
467
+ /* @__PURE__ */re("div",{ref:A,id:W,role:"dialog",...te,"aria-describedby":n?U:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:X,onFocusCapture:X,onKeyDown:e=>{const t=A.current,r=P.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=p(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=x(r,t);J(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${k}`.trim(),style:Ol.test(k)?void 0:{zIndex:C.popup},children:/* @__PURE__ */ne("div",{ref:F,children:[r&&/* @__PURE__ */re("h2",{id:R,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */re("p",{id:U,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */re("div",{className:"mt-3",children:ee}):ee]})}),document.body)]})}var Hl=6e4;function _l({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Y(null);return q(()=>{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(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,n]),n}function ql({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=_l({currentVersion:e,versionUrl:t,pollMs:r}),s=j();if(null===i)return null;const o=a??(()=>window.location.reload());/* @__PURE__ */
468
+ return re("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */ne(Sn,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */re(u,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
469
469
  /* @__PURE__ */re("span",{className:"font-medium",children:n??s.update.available}),
470
470
  /* @__PURE__ */ne("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Ul={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Vl={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Kl({onClose:e}){const t=j().dialog;/* @__PURE__ */
471
471
  return re("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-md 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__ */re("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */re("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Zl({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=H(null),x=_(),b=_(),y=_();if(L(e),g(p,e,c),f(e),q(()=>{if(e)return M(()=>(o||t(),!0))},[e,o,t]),!e)return null;const v="bottom"===r,w=v?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
@@ -509,7 +509,7 @@ return ne(ae,{children:[i,d?`${d} — `:"",c?null!=n?s.allLoaded(o,a):s.count(o,
509
509
  return ne("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:[
510
510
  /* @__PURE__ */re("svg",{className:"h-10 w-10 text-red-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,"aria-hidden":"true",children:/* @__PURE__ */re("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0 3.75h.008M10.34 3.94l-8.4 14.55A1.5 1.5 0 003.24 21h17.52a1.5 1.5 0 001.3-2.51l-8.4-14.55a1.5 1.5 0 00-2.6 0z"})}),
511
511
  /* @__PURE__ */re("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
512
- /* @__PURE__ */re("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */re("div",{className:"mt-4",children:/* @__PURE__ */re(o,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function ci({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){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__ */
512
+ /* @__PURE__ */re("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */re("div",{className:"mt-4",children:/* @__PURE__ */re(u,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function ci({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){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__ */
513
513
  return ne("svg",{className:s,style:o,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */re("path",{d:f,fill:a,stroke:"none"}),
514
514
  /* @__PURE__ */re("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */re("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}function di({data:e,labels:t,height:r=120,color:n="currentColor",colors:a,max:l,gap:i=6,className:s,style:o}){const c=D();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
515
515
  return ne("div",{className:s,style:o,children:[
@@ -532,8 +532,8 @@ return re(qn,{groups:gi,children:/* @__PURE__ */re("div",{className:"h-full over
532
532
  /* @__PURE__ */re("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
533
533
  /* @__PURE__ */re("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
534
534
  /* @__PURE__ */ne("div",{className:"flex items-center gap-2",children:[
535
- /* @__PURE__ */re(o,{variant:"secondary",size:"sm",children:"Export"}),
536
- /* @__PURE__ */re(o,{size:"sm",children:"New report"})]})]}),
535
+ /* @__PURE__ */re(u,{variant:"secondary",size:"sm",children:"Export"}),
536
+ /* @__PURE__ */re(u,{size:"sm",children:"New report"})]})]}),
537
537
  /* @__PURE__ */ne("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
538
538
  /* @__PURE__ */re(Yr,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
539
539
  /* @__PURE__ */re(Yr,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
@@ -570,12 +570,12 @@ return re("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backg
570
570
  return re(qn,{groups:wi,children:/* @__PURE__ */re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ne("div",{className:"mx-auto max-w-5xl space-y-4",children:[
571
571
  /* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-4",children:[
572
572
  /* @__PURE__ */re("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
573
- /* @__PURE__ */re(o,{size:"sm",children:"Invite member"})]}),
573
+ /* @__PURE__ */re(u,{size:"sm",children:"Invite member"})]}),
574
574
  /* @__PURE__ */ne(Or,{padded:!1,children:[
575
575
  /* @__PURE__ */ne("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
576
576
  /* @__PURE__ */re("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */re(me,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */re(Mi,{})})}),
577
577
  /* @__PURE__ */re("div",{className:"w-40",children:/* @__PURE__ */re(Ae,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
578
- /* @__PURE__ */re(o,{variant:"secondary",size:"sm",children:"Filter"})]}),
578
+ /* @__PURE__ */re(u,{variant:"secondary",size:"sm",children:"Filter"})]}),
579
579
  /* @__PURE__ */ne("table",{className:"w-full text-sm",children:[
580
580
  /* @__PURE__ */re("thead",{children:/* @__PURE__ */ne("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
581
581
  /* @__PURE__ */re("th",{className:"px-4 py-2 font-medium",children:"Name"}),
@@ -588,7 +588,7 @@ return re(qn,{groups:wi,children:/* @__PURE__ */re("div",{className:"h-full over
588
588
  /* @__PURE__ */re("div",{className:"text-xs text-gray-400",children:e.email})]}),
589
589
  /* @__PURE__ */re("td",{className:"px-4 py-2.5",children:e.role}),
590
590
  /* @__PURE__ */re("td",{className:"px-4 py-2.5",children:/* @__PURE__ */re(Un,{status:e.status})}),
591
- /* @__PURE__ */re("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */re(o,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
591
+ /* @__PURE__ */re("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */re(u,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
592
592
  /* @__PURE__ */ne("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
593
593
  /* @__PURE__ */re("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
594
594
  /* @__PURE__ */re(Xl,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function Mi(){/* @__PURE__ */
@@ -614,8 +614,8 @@ return re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
614
614
  /* @__PURE__ */re(Ie,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
615
615
  /* @__PURE__ */re(Be,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
616
616
  /* @__PURE__ */ne("div",{className:"flex items-center justify-end gap-2",children:[
617
- /* @__PURE__ */re(o,{variant:"secondary",children:"Cancel"}),
618
- /* @__PURE__ */re(o,{type:"submit",children:"Save changes"})]})]})})}var Ci=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function Li(){const[e,t]=Y(!0),[r,n]=Y("us"),a=Ci.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
617
+ /* @__PURE__ */re(u,{variant:"secondary",children:"Cancel"}),
618
+ /* @__PURE__ */re(u,{type:"submit",children:"Save changes"})]})]})})}var Ci=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function Li(){const[e,t]=Y(!0),[r,n]=Y("us"),a=Ci.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
619
619
  return re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ne("div",{className:"mx-auto max-w-5xl space-y-5",children:[
620
620
  /* @__PURE__ */re("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
621
621
  /* @__PURE__ */ne("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -652,10 +652,10 @@ return re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
652
652
  /* @__PURE__ */ne("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
653
653
  /* @__PURE__ */re("span",{children:"Total"}),
654
654
  /* @__PURE__ */ne("span",{children:["$",l]})]})]}),
655
- /* @__PURE__ */ne(o,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
655
+ /* @__PURE__ */ne(u,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
656
656
  /* @__PURE__ */re(Sn,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Di=[{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"}],ji=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function Si(){const[e,r]=Y(1),n=ji.find(t=>t.id===e)??ji[0];/* @__PURE__ */
657
657
  return re("div",{className:"h-full",children:/* @__PURE__ */re(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */ne("div",{className:"flex h-full flex-col p-2",children:[
658
- /* @__PURE__ */re(o,{block:!0,className:"mb-2",children:"Compose"}),Di.map((e,t)=>/* @__PURE__ */ne("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:[
658
+ /* @__PURE__ */re(u,{block:!0,className:"mb-2",children:"Compose"}),Di.map((e,t)=>/* @__PURE__ */ne("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:[
659
659
  /* @__PURE__ */re("span",{children:e.label}),null!=e.count&&/* @__PURE__ */re("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */ne("div",{className:"flex h-full",children:[
660
660
  /* @__PURE__ */re("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:ji.map(t=>/* @__PURE__ */ne("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
661
661
  /* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-2",children:[
@@ -667,8 +667,8 @@ return re("div",{className:"h-full",children:/* @__PURE__ */re(t,{side:"left",de
667
667
  /* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
668
668
  /* @__PURE__ */re("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
669
669
  /* @__PURE__ */ne("div",{className:"flex shrink-0 gap-1.5",children:[
670
- /* @__PURE__ */re(o,{variant:"ghost",size:"sm",children:"Archive"}),
671
- /* @__PURE__ */re(o,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
670
+ /* @__PURE__ */re(u,{variant:"ghost",size:"sm",children:"Archive"}),
671
+ /* @__PURE__ */re(u,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
672
672
  /* @__PURE__ */ne("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
673
673
  /* @__PURE__ */re($n,{name:n.from}),
674
674
  /* @__PURE__ */ne("div",{className:"min-w-0",children:[
@@ -694,11 +694,11 @@ return re("div",{className:"h-full",children:/* @__PURE__ */re(t,{side:"left",de
694
694
  /* @__PURE__ */re("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:Pi.map((e,t)=>/* @__PURE__ */re("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */re("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))}),
695
695
  /* @__PURE__ */ne("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
696
696
  /* @__PURE__ */re("div",{className:"flex-1",children:/* @__PURE__ */re(me,{placeholder:"Type a message…"})}),
697
- /* @__PURE__ */re(o,{type:"submit",children:"Send"})]})]})})})}var Fi={featured:"success",new:"active",draft:"draft"},Bi=["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 Ti(){const[e,t]=Y("all"),r="all"===e?Bi:Bi.filter(t=>t.tag===e);/* @__PURE__ */
697
+ /* @__PURE__ */re(u,{type:"submit",children:"Send"})]})]})})})}var Fi={featured:"success",new:"active",draft:"draft"},Bi=["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 Ti(){const[e,t]=Y("all"),r="all"===e?Bi:Bi.filter(t=>t.tag===e);/* @__PURE__ */
698
698
  return re(qn,{groups:Fi,children:/* @__PURE__ */re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ne("div",{className:"mx-auto max-w-5xl space-y-4",children:[
699
699
  /* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-4",children:[
700
700
  /* @__PURE__ */re("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
701
- /* @__PURE__ */re(o,{size:"sm",children:"Upload"})]}),
701
+ /* @__PURE__ */re(u,{size:"sm",children:"Upload"})]}),
702
702
  /* @__PURE__ */re(Bn,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
703
703
  /* @__PURE__ */re("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */ne(Or,{padded:!1,className:"overflow-hidden",children:[
704
704
  /* @__PURE__ */re("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */re("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */re(Un,{status:e.tag})})}),
@@ -714,7 +714,7 @@ return re("div",{className:"flex h-full items-center justify-center overflow-aut
714
714
  /* @__PURE__ */re(We,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */re(me,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */re(We,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */re(me,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */ne("div",{className:"flex items-center justify-between",children:[
715
715
  /* @__PURE__ */re(Be,{checked:t,onChange:r,label:"Remember me"}),
716
716
  /* @__PURE__ */re("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
717
- /* @__PURE__ */re(o,{type:"submit",block:!0,children:n.cta})]})}),
717
+ /* @__PURE__ */re(u,{type:"submit",block:!0,children:n.cta})]})}),
718
718
  /* @__PURE__ */re("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */ne(ae,"register"===e?{children:["Already have an account? ",
719
719
  /* @__PURE__ */re("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
720
720
  /* @__PURE__ */re("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var Ei={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 Ri({code:e=404,actions:t}){const r=Ei[e](j().errors);/* @__PURE__ */
@@ -725,7 +725,7 @@ return ne("div",{className:"flex h-full flex-col items-center justify-center bg-
725
725
  return re(ae,{children:e(j().errors)})}var Yi=class extends Q{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),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):
726
726
  /* @__PURE__ */ne("div",{className:"flex h-full flex-col",children:[
727
727
  /* @__PURE__ */re("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */re(Ri,{code:500,actions:/* @__PURE__ */ne(ae,{children:[
728
- /* @__PURE__ */re(o,{onClick:this.reset,children:/* @__PURE__ */re(Oi,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */ne("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
728
+ /* @__PURE__ */re(u,{onClick:this.reset,children:/* @__PURE__ */re(Oi,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */ne("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
729
729
  /* @__PURE__ */re("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */re(Oi,{pick:e=>e.details})}),
730
730
  /* @__PURE__ */re("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 Hi(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function _i(e){const t=Hi();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function qi(){return Hi()?.matches??!1}function Ui(){return!1}function Vi(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,s=0;const o=(a+l)/2;if(a!==l){const e=a-l;s=o>.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*s,100*o]}function Ki(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 Zi(e){const t=e||"system";return"system"===t?qi()?"dark":"light":t}function Gi(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Vi(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ki(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Ki(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Ki(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Ki(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Ki(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Ki(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Ki(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 Ji(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]=Vi(a);l.style.setProperty("--custom-button-hover",Ki(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Xi(e){document.documentElement.setAttribute("data-theme",Zi(e.theme)),Gi(e.accent_color??null),Ji(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 Qi(){const{prefs:e}=i(),t=ee(_i,qi,Ui),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,s=e.custom_window_color||null,o=e.custom_button_color||null,c="system"===r?t?"dark":"light":r;return q(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),q(()=>{Gi(n)},[n]),q(()=>{Ji(n,a,l,s,o)},[n,a,l,s,o]),{theme:r,resolved:c}}function es(e,t){q(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var ts=8,rs=["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)"],ns={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},as={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function ls(e){return rs[e]??as.muted}function is(e,t,r){return t||(r?ns[r]:ls(e))}function ss(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 os(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 cs(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 ds(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 us(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),s=a>0&&l>0?Math.log10(a)-i:0,o=e=>{if(s<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/s*(t.to-t.from)};return o.domain=[l,a],o.range=t,o.ticks=e=>{if(e<2||s<=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)},o}function hs(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 ms(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 ps(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}var gs=e=>e.toFixed(2);function fs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${gs(e)},${gs(t)}`).join(" ")}function xs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${gs(e.start)},${gs(e.y)}`,t+=` L${gs(e.end)},${gs(e.y)}`}),t}function bs(e){if(e.length<3)return fs(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${gs(e[0][0])},${gs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${gs(e[n][0]+t)},${gs(e[n][1]+a[n]*t)} ${gs(e[n+1][0]-t)},${gs(e[n+1][1]-a[n+1]*t)} ${gs(e[n+1][0])},${gs(e[n+1][1])}`}return l}function ys(e,t=0){if(e.length<3)return fs(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 s=`M${gs(e[0][0])},${gs(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],o=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(o[0]-n[0])*i,h=l(a[1]-(o[1]-n[1])*i);s+=` C${gs(c)},${gs(d)} ${gs(u)},${gs(h)} ${gs(a[0])},${gs(a[1])}`}return s}function vs(e){if(e.length<2)return fs(e);let t=`M${gs(e[0][0])},${gs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],s=(n+l)/2;t+=` C${gs(s)},${gs(a)} ${gs(s)},${gs(i)} ${gs(l)},${gs(i)}`}return t}function ws(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${gs(e[0][0])},${gs(e[0][1])}`:"monotone"===t?bs(e):"spline"===t?ys(e,r):"bump"===t?vs(e):fs(e)}function Ns(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${gs(a[0])},${gs(r)} L${gs(n[0])},${gs(r)} Z`}function ks(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${gs(e)},${gs(t)}`).join(" L")} Z`}function Ms(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const s=a+2*i*Math.PI/n;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function $s(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${$s(e,t,r,n,a,l)} ${$s(e,t,r,n,l,a+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=o(n,a),[u,h]=o(n,l);if(r<=0)return`M${gs(e)},${gs(t)} L${gs(c)},${gs(d)} A${gs(n)},${gs(n)} 0 ${s} 1 ${gs(u)},${gs(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,a);return`M${gs(c)},${gs(d)} A${gs(n)},${gs(n)} 0 ${s} 1 ${gs(u)},${gs(h)} L${gs(m)},${gs(p)} A${gs(r)},${gs(r)} 0 ${s} 0 ${gs(g)},${gs(f)} Z`}function Cs(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 Ls(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 s=t>0?e.value/t*a:0,o=n?{...e,x:r.x,y:r.y+i,width:l,height:s}:{...e,x:r.x+i,y:r.y,width:s,height:l};return i+=s,o}),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 Ds(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 s={x:0,y:0,width:t,height:r},o=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,n=Cs(o.map(e=>e.value),c,t),a=Cs([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||a<=n)o.push(e),c+=e.value,d=d.slice(1);else{const e=Ls(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...Ls(o,c,s,s.width>=s.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}))}var js=U({highlighted:null,setHighlighted:()=>{}});function Ss({children:e}){const[t,r]=Y(null),n=V(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
731
731
  return re(js.Provider,{value:n,children:e})}function zs(){return J(js)}function Ps(e,t,r=.22){return null===t?null:t===e?1:r}function As(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 Fs(e,t=720){const[r,n]=Y(t);return q(()=>{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 Bs({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=j().charts,h=D(),m=r??(e=>P(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
@@ -787,54 +787,54 @@ return re("div",{className:s,children:/* @__PURE__ */ne("svg",{ref:c,width:"100%
787
787
  /* @__PURE__ */re("path",{d:v,fill:as.grid}),
788
788
  /* @__PURE__ */re("rect",{x:0,y:0,width:p(u),height:a,fill:as.surface,fillOpacity:.72}),
789
789
  /* @__PURE__ */re("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:as.surface,fillOpacity:.72}),
790
- /* @__PURE__ */re("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")]})})}function Vs({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=j().charts,x=D(),b=o??(e=>P(e,x)),y=g??f.noData,v=H(null),w=Fs(v),N=n??w,[k,$]=Y(null),C=_();if(q(()=>{if(null!==k)return M(e=>"Escape"===e.key&&($(null),!0))},[k]),0===e.length)/* @__PURE__ */
790
+ /* @__PURE__ */re("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")]})})}function Vs(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 Ks({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=j().charts,x=D(),b=o??(e=>P(e,x)),y=g??f.noData,v=H(null),w=Fs(v),N=n??w,[k,$]=Y(null),C=_();if(q(()=>{if(null!==k)return M(e=>"Escape"===e.key&&($(null),!0))},[k]),0===e.length)/* @__PURE__ */
791
791
  return re("div",{className:p,ref:v,children:/* @__PURE__ */re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const L={top:12,right:16,bottom:26,left:c?58:48},S=L.left,z=Math.max(S+1,N-L.right),A=L.top,F=r-L.bottom,B=t.filter(Number.isFinite),T=l??Math.min(0,...B),I=ss([T,i??ds(Math.max(...B,0))],{from:F,to:A}),W=os(e.length,{from:S,to:z},a),E=I.ticks(s+1),R=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
792
792
  return ne("div",{className:`relative ${p??""}`,ref:v,children:[
793
793
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${N} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>$(null),onBlur:()=>$(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;$(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
794
794
  /* @__PURE__ */re("defs",{children:/* @__PURE__ */re("clipPath",{id:C,children:/* @__PURE__ */re("rect",{x:S,y:A,width:z-S,height:F-A})})}),E.map(e=>/* @__PURE__ */re("line",{x1:S,y1:I(e),x2:z,y2:I(e),stroke:as.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
795
795
  /* @__PURE__ */re("line",{x1:S,y1:I(Math.max(T,0)),x2:z,y2:I(Math.max(T,0)),stroke:as.axis,strokeWidth:1,shapeRendering:"crispEdges"}),E.map(e=>/* @__PURE__ */re("text",{x:S-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)},`t${e}`)),c&&/* @__PURE__ */re("text",{x:14,y:(A+F)/2,transform:`rotate(-90 14 ${(A+F)/2})`,textAnchor:"middle",fontSize:11,fill:as.label,children:c}),
796
796
  /* @__PURE__ */re("g",{clipPath:`url(#${C})`,children:u({x:W,y:I,left:S,right:z,top:A,bottom:F,width:N,height:r,clipId:C,active:k})}),e.map((e,t)=>t%R===0?/* @__PURE__ */re("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */re("rect",{x:W.center(r)-(z-S)/e.length/2,y:A,width:(z-S)/e.length,height:F-A,fill:"transparent",onMouseEnter:()=>$(r)},`h${r}`))]}),h&&null!==k&&
797
- /* @__PURE__ */re("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(W.center(k)/N*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:h(k)})]})}var Ks=12,Zs=16,Gs=26,Js=52,Xs=e=>"number"==typeof e&&Number.isFinite(e);function Qs({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:x=!1,range:b,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:N="left-to-right",fillVariant:k="gradient",gridStyle:$="solid",width:C,className:L,emptyLabel:S}){const z=j().charts,A=D(),B=d??(e=>P(e,A)),T=S??z.noData,I=H(null),W=Fs(I),E=C??W,[R,O]=Y(null),[U,V]=Y(null),{highlighted:K}=zs(),Z=_();if(q(()=>{if(null!==R)return M(e=>"Escape"===e.key&&(O(null),!0))},[R]),v)/* @__PURE__ */
798
- return re("div",{className:L,ref:I,children:/* @__PURE__ */re(Rs,{height:r,width:C??W})});const G=t,J=b??U??[0,Math.max(0,G.length-1)],[X,Q]=J,ee=e=>x?e.slice(X,Q+1):e,te=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Xs)).map(e=>({...e,data:ee(e.data)}));if(t=ee(G),0===te.length||0===t.length)/* @__PURE__ */
799
- return re("div",{className:L,ref:I,children:/* @__PURE__ */re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:T})});const ae={left:Js,right:Math.max(Js+1,E-Zs),top:Ks,bottom:r-Gs},le=os(t.length,{from:ae.left,to:ae.right}),ie=t.map((e,t)=>te.reduce((e,r)=>e+(Xs(r.data[t])?r.data[t]:0),0)),se=(e,t)=>ie[t]>0?e/ie[t]:null,oe=[];if(n){let e=t.map(()=>0);for(const t of te)e=e.map((e,r)=>e+(Xs(t.data[r])?t.data[r]:0)),oe.push("percent"===a?e.map((e,t)=>se(e,t)):[...e])}const ce=l&&l.length>0?cs(l,{from:ae.bottom,to:ae.top}):null,de=n?(oe.at(-1)??[]).filter(Xs):te.flatMap(e=>e.data.filter(Xs)),ue=ss([0,n&&"percent"===a?1:o??ds(Math.max(...de,0))],{from:ae.bottom,to:ae.top}),he=e=>ce?ce(e):ue(e),me=n&&"percent"===a?e=>F(Math.round(100*e),0,A):B,pe=ce?ce.levels.map(e=>({value:e,y:ce(e)})):ue.ticks(c+1).map(e=>({value:e,y:ue(e)})),ge=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(E/96))));/* @__PURE__ */
797
+ /* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 z-10",style:Vs(W.center(k),W.bandwidth,N),children:h(k)})]})}var Zs=12,Gs=16,Js=26,Xs=52,Qs=e=>"number"==typeof e&&Number.isFinite(e);function eo({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:x=!1,range:b,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:N="left-to-right",fillVariant:k="gradient",gridStyle:$="solid",width:C,className:L,emptyLabel:S}){const z=j().charts,A=D(),B=d??(e=>P(e,A)),T=S??z.noData,I=H(null),W=Fs(I),E=C??W,[R,O]=Y(null),[U,V]=Y(null),{highlighted:K}=zs(),Z=_();if(q(()=>{if(null!==R)return M(e=>"Escape"===e.key&&(O(null),!0))},[R]),v)/* @__PURE__ */
798
+ return re("div",{className:L,ref:I,children:/* @__PURE__ */re(Rs,{height:r,width:C??W})});const G=t,J=b??U??[0,Math.max(0,G.length-1)],[X,Q]=J,ee=e=>x?e.slice(X,Q+1):e,te=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Qs)).map(e=>({...e,data:ee(e.data)}));if(t=ee(G),0===te.length||0===t.length)/* @__PURE__ */
799
+ return re("div",{className:L,ref:I,children:/* @__PURE__ */re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:T})});const ae={left:Xs,right:Math.max(Xs+1,E-Gs),top:Zs,bottom:r-Js},le=os(t.length,{from:ae.left,to:ae.right}),ie=t.map((e,t)=>te.reduce((e,r)=>e+(Qs(r.data[t])?r.data[t]:0),0)),se=(e,t)=>ie[t]>0?e/ie[t]:null,oe=[];if(n){let e=t.map(()=>0);for(const t of te)e=e.map((e,r)=>e+(Qs(t.data[r])?t.data[r]:0)),oe.push("percent"===a?e.map((e,t)=>se(e,t)):[...e])}const ce=l&&l.length>0?cs(l,{from:ae.bottom,to:ae.top}):null,de=n?(oe.at(-1)??[]).filter(Qs):te.flatMap(e=>e.data.filter(Qs)),ue=ss([0,n&&"percent"===a?1:o??ds(Math.max(...de,0))],{from:ae.bottom,to:ae.top}),he=e=>ce?ce(e):ue(e),me=n&&"percent"===a?e=>F(Math.round(100*e),0,A):B,pe=ce?ce.levels.map(e=>({value:e,y:ce(e)})):ue.ticks(c+1).map(e=>({value:e,y:ue(e)})),ge=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(E/96))));/* @__PURE__ */
800
800
  return ne("div",{className:`relative ${L??""}`,ref:I,children:[
801
801
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${E} ${r}`,role:"img","aria-label":z.overIntervals(te.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&&ge(1)(e),"ArrowLeft"===e.key&&ge(-1)(e)},children:[
802
802
  /* @__PURE__ */re("defs",{children:/* @__PURE__ */re("clipPath",{id:Z,children:/* @__PURE__ */re("rect",{x:ae.left,y:ae.top,width:ae.right-ae.left,height:ae.bottom-ae.top})})}),
803
803
  /* @__PURE__ */re(wa,{id:Z,fills:te.map((e,t)=>({color:is(e.slot,e.color,e.tone),variant:e.fillVariant??k})),fadeFrom:n?.42:.3,reveal:!!w&&N}),pe.map(e=>/* @__PURE__ */re("line",{x1:ae.left,y1:e.y,x2:ae.right,y2:e.y,stroke:as.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===$?"3 3":void 0},`grid-${e.value}`)),
804
804
  /* @__PURE__ */re("line",{x1:ae.left,y1:ae.bottom,x2:ae.right,y2:ae.bottom,stroke:as.axis,strokeWidth:1,shapeRendering:"crispEdges"}),pe.map(e=>/* @__PURE__ */re("text",{x:ae.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:me(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */re("text",{x:12,y:(ae.top+ae.bottom)/2,transform:`rotate(-90 12 ${(ae.top+ae.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:as.label,children:u}),
805
- /* @__PURE__ */re("g",{clipPath:`url(#${Z})`,mask:w&&N?`url(#${ga(Z)})`:void 0,children:te.map((e,r)=>{const a=is(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),o=Ps(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:le(r),end:le.end(r),value:e.data[r]})).filter(e=>Xs(e.value)).map(e=>({start:e.start,end:e.end,y:he(e.value)}));/* @__PURE__ */
806
- return re("path",{d:xs(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?oe[r]?.[a]:e.data[a];return Xs(l)?[le.center(a),he(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*le.bandwidth);/* @__PURE__ */
807
- return re("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=n?oe[r]?.[i]:e.data[i];if(!Xs(s))return null;const o=he(s);/* @__PURE__ */
805
+ /* @__PURE__ */re("g",{clipPath:`url(#${Z})`,mask:w&&N?`url(#${ga(Z)})`:void 0,children:te.map((e,r)=>{const a=is(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),o=Ps(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:le(r),end:le.end(r),value:e.data[r]})).filter(e=>Qs(e.value)).map(e=>({start:e.start,end:e.end,y:he(e.value)}));/* @__PURE__ */
806
+ return re("path",{d:xs(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?oe[r]?.[a]:e.data[a];return Qs(l)?[le.center(a),he(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*le.bandwidth);/* @__PURE__ */
807
+ return re("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=n?oe[r]?.[i]:e.data[i];if(!Qs(s))return null;const o=he(s);/* @__PURE__ */
808
808
  return re("rect",{x:le.center(i)-l/2,y:o,width:l,height:Math.max(0,ae.bottom-o),rx:2,fill:a,fillOpacity:.35,className:w?ka.rise:void 0,style:w?Ma(i,26):void 0},i)})},e.key)}const d=ws(c,i,s),u=n&&r>0?t.map((e,t)=>[le.center(t),he(oe[r-1]?.[t]??0)-2]):null,h=u?ks(d,u):Ns(d,c,ae.bottom);/* @__PURE__ */
809
809
  return ne("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
810
810
  /* @__PURE__ */re("path",{d:h,fill:xa(Z,r,e.fillVariant??k,a),stroke:"none"}),
811
811
  /* @__PURE__ */re("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:ba(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?ka.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??ns[e.tone??"critical"],n=he(e.value);/* @__PURE__ */
812
812
  return ne("g",{children:[
813
- /* @__PURE__ */re("line",{x1:ae.left,y1:n,x2:ae.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */re("text",{x:ae.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&te.map((e,r)=>{const a=p??(m?"last":"none"),l=is(e.slot,e.color,e.tone),i=[...e.data].map(Xs).lastIndexOf(!0),s="all"===a?t.map((e,t)=>t).filter(t=>Xs(n?oe[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
814
- return ne("g",{children:[s.map(a=>{const s=n?oe[r]?.[a]:e.data[a];return Xs(s)?/* @__PURE__ */re(qs,{cx:le.center(a),cy:he(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${B(s)}`},a):null}),m&&i>=0&&Xs(n?oe[r]?.[i]:e.data[i])&&/* @__PURE__ */re("text",{x:le.center(i)-10,y:he(n?oe[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:B(n?oe[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */re("text",{x:le.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==R&&/* @__PURE__ */re("line",{x1:le.center(R),y1:ae.top,x2:le.center(R),y2:ae.bottom,stroke:as.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */re("rect",{x:le(t),y:ae.top,width:Math.max(1,le.bandwidth),height:ae.bottom-ae.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),x&&G.length>2&&/* @__PURE__ */re(Us,{className:"mt-1",labels:G,width:E,data:e[0]?.data??[],range:J,onRangeChange:e=>{y?y(e):V(e)}}),null!==R&&
815
- /* @__PURE__ */re("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(le.center(R)/E*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:/* @__PURE__ */re(_s,{title:t[R],rows:te.map((e,t)=>({key:e.key,label:e.label,color:is(e.slot,e.color,e.tone),value:Xs(e.data[R])?n&&"percent"===a?`${F(100*(se(e.data[R],R)??0),1,A)} · ${B(e.data[R])}`:B(e.data[R]):void 0})),footnote:n&&"percent"===a?z.inBucket(B(ie[R])):void 0})})]})}function eo({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:x="none"}){const b=_(),{highlighted:y}=zs(),v=j().charts,w=D(),N=s??(e=>P(e,w));if(h)/* @__PURE__ */return re(Rs,{height:a,width:l,variant:"bars",className:c});const k=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>k.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>k.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>k.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),S=r&&"percent"===n,z=(e,t)=>$[t]>0?e/$[t]:null,A=S?[1]:r?[...C,...L]:k.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
816
- return re(Vs,{labels:t,values:A,height:a,width:l,max:S?1:i,formatValue:S?e=>F(Math.round(100*e),0,w):N,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(k.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */re(_s,{title:t[e],rows:k.map(t=>({key:t.key,label:t.label,color:is(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?S?`${F(100*(z(t.data[e],e)??0),1,w)} · ${N(t.data[e])}`:N(t.data[e]):void 0})),footnote:S?v.inCategory(N($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=As(r?$:k[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
813
+ /* @__PURE__ */re("line",{x1:ae.left,y1:n,x2:ae.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */re("text",{x:ae.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&te.map((e,r)=>{const a=p??(m?"last":"none"),l=is(e.slot,e.color,e.tone),i=[...e.data].map(Qs).lastIndexOf(!0),s="all"===a?t.map((e,t)=>t).filter(t=>Qs(n?oe[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
814
+ return ne("g",{children:[s.map(a=>{const s=n?oe[r]?.[a]:e.data[a];return Qs(s)?/* @__PURE__ */re(qs,{cx:le.center(a),cy:he(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${B(s)}`},a):null}),m&&i>=0&&Qs(n?oe[r]?.[i]:e.data[i])&&/* @__PURE__ */re("text",{x:le.center(i)-10,y:he(n?oe[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:B(n?oe[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */re("text",{x:le.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==R&&/* @__PURE__ */re("line",{x1:le.center(R),y1:ae.top,x2:le.center(R),y2:ae.bottom,stroke:as.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */re("rect",{x:le(t),y:ae.top,width:Math.max(1,le.bandwidth),height:ae.bottom-ae.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),x&&G.length>2&&/* @__PURE__ */re(Us,{className:"mt-1",labels:G,width:E,data:e[0]?.data??[],range:J,onRangeChange:e=>{y?y(e):V(e)}}),null!==R&&
815
+ /* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 z-10",style:Vs(le.center(R),le.bandwidth,E),children:/* @__PURE__ */re(_s,{title:t[R],rows:te.map((e,t)=>({key:e.key,label:e.label,color:is(e.slot,e.color,e.tone),value:Qs(e.data[R])?n&&"percent"===a?`${F(100*(se(e.data[R],R)??0),1,A)} · ${B(e.data[R])}`:B(e.data[R]):void 0})),footnote:n&&"percent"===a?z.inBucket(B(ie[R])):void 0})})]})}function to({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:x="none"}){const b=_(),{highlighted:y}=zs(),v=j().charts,w=D(),N=s??(e=>P(e,w));if(h)/* @__PURE__ */return re(Rs,{height:a,width:l,variant:"bars",className:c});const k=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>k.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>k.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>k.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),S=r&&"percent"===n,z=(e,t)=>$[t]>0?e/$[t]:null,A=S?[1]:r?[...C,...L]:k.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
816
+ return re(Ks,{labels:t,values:A,height:a,width:l,max:S?1:i,formatValue:S?e=>F(Math.round(100*e),0,w):N,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(k.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */re(_s,{title:t[e],rows:k.map(t=>({key:t.key,label:t.label,color:is(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?S?`${F(100*(z(t.data[e],e)??0),1,w)} · ${N(t.data[e])}`:N(t.data[e]):void 0})),footnote:S?v.inCategory(N($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=As(r?$:k[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
817
817
  return ne("g",{children:[
818
818
  /* @__PURE__ */re(wa,{id:b,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,k.length));let i=0,s=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return k.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=S?z(h,a):h;if(null===f)return null;const x=is(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,N,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=n(Math.max(e,t)),N=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),N=Math.max(n(f),c);const $=Math.max(0,N-w-(r&&!M?2:0)),C=null===o||o===a,L=C?x:g?as.muted:x,D=Ps(t.key,y);/* @__PURE__ */
819
- return re("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:D??(C?1:g?.32:.45),filter:p&&o===a?`url(#${pa(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${ka.rise}`:""),style:m?Ma(a*(r?1:k.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */re("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:as.axis,strokeWidth:1})]})}})}var to=3;function ro({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=j().charts,g=D(),f=l??(e=>P(e,g)),x=i??(e=>P(e,g)),b=m??p.noObservations,y=H(null),v=Fs(y),w=r??v,N=_(),[k,$]=Y(null);q(()=>{if(null!==k)return M(e=>"Escape"===e.key&&($(null),!0))},[k]);const C=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),L=e.filter(e=>e.points.length>0).slice(0,3),S=s||o?L.map(e=>({...e,points:e.points.filter(e=>C(e.x,s)&&C(e.y,o))})).filter(e=>e.points.length>0):L,z=L.reduce((e,t)=>e+t.points.length,0)-S.reduce((e,t)=>e+t.points.length,0);if(0===S.length)/* @__PURE__ */
819
+ return re("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:D??(C?1:g?.32:.45),filter:p&&o===a?`url(#${pa(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${ka.rise}`:""),style:m?Ma(a*(r?1:k.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */re("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:as.axis,strokeWidth:1})]})}})}var ro=3;function no({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=j().charts,g=D(),f=l??(e=>P(e,g)),x=i??(e=>P(e,g)),b=m??p.noObservations,y=H(null),v=Fs(y),w=r??v,N=_(),[k,$]=Y(null);q(()=>{if(null!==k)return M(e=>"Escape"===e.key&&($(null),!0))},[k]);const C=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),L=e.filter(e=>e.points.length>0).slice(0,3),S=s||o?L.map(e=>({...e,points:e.points.filter(e=>C(e.x,s)&&C(e.y,o))})).filter(e=>e.points.length>0):L,z=L.reduce((e,t)=>e+t.points.length,0)-S.reduce((e,t)=>e+t.points.length,0);if(0===S.length)/* @__PURE__ */
820
820
  return re("div",{className:h,ref:y,children:/* @__PURE__ */re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:b})});const A=S.flatMap(e=>e.points),F=A.some(e=>null!=e.size),B=14,T=20,I=34,W=52,E=Math.max(W+1,w-T),R=(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,ds(Math.max(...e))];return"log"===r?us(i,n):ss(i,n)},O=R(A.map(e=>e.x),s,c,{from:W,to:E}),U=R(A.map(e=>e.y),o,d,{from:t-I,to:B}),V=ms([0,Math.max(...A.map(e=>e.size??1))],{from:u[0],to:u[1]}),K=k?S[k.s]:void 0,Z=k&&K?K.points[k.i]:void 0,G=S.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
821
821
  return ne("div",{className:`relative ${h??""}`,ref:y,children:[
822
822
  /* @__PURE__ */ne("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(S.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(z>0?`. ${p.outsideRange(z)}`:""),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?G.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(G[Math.min(G.length-1,Math.max(0,r+t))])},children:[
823
823
  /* @__PURE__ */re("defs",{children:/* @__PURE__ */re("clipPath",{id:N,children:/* @__PURE__ */re("rect",{x:W-u[1],y:B-u[1],width:E-W+2*u[1],height:t-I-B+2*u[1]})})}),U.ticks(5).map(e=>/* @__PURE__ */ne("g",{children:[
824
824
  /* @__PURE__ */re("line",{x1:W,y1:U(e),x2:E,y2:U(e),stroke:as.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
825
825
  /* @__PURE__ */re("text",{x:W-8,y:U(e)+4,textAnchor:"end",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */re("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */re("text",{x:(W+E)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:as.label,children:n}),a&&/* @__PURE__ */re("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:as.label,children:a}),
826
- /* @__PURE__ */re("g",{clipPath:`url(#${N})`,children:S.map((e,t)=>{const r=is(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */re("circle",{cx:O(n.x),cy:U(n.y),r:F?V(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:as.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&K&&Z&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:Z.label??K.label,rows:[{key:"x",label:n??p.xAxis,color:is(k.s,K.color,K.tone),value:f(Z.x)},{key:"y",label:a??p.yAxis,color:is(k.s,K.color,K.tone),value:x(Z.y)},...null!=Z.size?[{key:"size",label:p.size,color:as.muted,value:P(Z.size,g)}]:[]],footnote:Z.label?K.label:void 0})})]})}function no({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=j().charts,x=D(),b=o??(e=>P(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=is(0,d,u);/* @__PURE__ */
827
- return re(Vs,{labels:t,values:v,height:a,width:l,max:i,min:s,formatValue:b,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */re(_s,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:b(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:b(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */re("g",{children:e.map((e,r)=>/* @__PURE__ */re("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__ */ne("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__ */
826
+ /* @__PURE__ */re("g",{clipPath:`url(#${N})`,children:S.map((e,t)=>{const r=is(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */re("circle",{cx:O(n.x),cy:U(n.y),r:F?V(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:as.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&K&&Z&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:Z.label??K.label,rows:[{key:"x",label:n??p.xAxis,color:is(k.s,K.color,K.tone),value:f(Z.x)},{key:"y",label:a??p.yAxis,color:is(k.s,K.color,K.tone),value:x(Z.y)},...null!=Z.size?[{key:"size",label:p.size,color:as.muted,value:P(Z.size,g)}]:[]],footnote:Z.label?K.label:void 0})})]})}function ao({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=j().charts,x=D(),b=o??(e=>P(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=is(0,d,u);/* @__PURE__ */
827
+ return re(Ks,{labels:t,values:v,height:a,width:l,max:i,min:s,formatValue:b,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */re(_s,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:b(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:b(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */re("g",{children:e.map((e,r)=>/* @__PURE__ */re("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__ */ne("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__ */
828
828
  return ne(ae,{children:[
829
829
  /* @__PURE__ */re("path",{d:ks(ws(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
830
830
  /* @__PURE__ */re("path",{d:ws(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
831
- /* @__PURE__ */re("path",{d:ws(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */re("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:as.axis,strokeWidth:1})]})})}function ao({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=j().charts,d=D(),u=n??(e=>P(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__ */
832
- return re(Vs,{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?ns.neutral:t.value>=0?ns.good:ns.critical;/* @__PURE__ */
831
+ /* @__PURE__ */re("path",{d:ws(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */re("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:as.axis,strokeWidth:1})]})})}function lo({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=j().charts,d=D(),u=n??(e=>P(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__ */
832
+ return re(Ks,{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?ns.neutral:t.value>=0?ns.good:ns.critical;/* @__PURE__ */
833
833
  return re(_s,{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:ns.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */ne("g",{children:[o&&m.slice(0,-1).map((r,n)=>
834
834
  /* @__PURE__ */re("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:as.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?ns.neutral:n.value>=0?ns.good:ns.critical,i=Math.min(t(n.from),t(n.to)),o=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
835
- return re("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function lo({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=j().charts,p=D(),g=s??(e=>Number.isInteger(e)?P(e,p):A(e,1,p)),f=o??(e=>P(e,p)),x=c??m.countAxis,b=d??m.distribution,y=r??ps(e??[],t),v=is(0,l,i),w=y.map(e=>g(e.from)),N=y.map(e=>e.count);/* @__PURE__ */
836
- return re(Vs,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:x,className:u,emptyLabel:h,ariaLabel:m.histogram(b,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */re(_s,{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__ */re("g",{children:y.map((a,l)=>/* @__PURE__ */re("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 io({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=j().charts,u=D(),h=l??(e=>P(e,u)),m=s??d.distribution,p=is(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
837
- return re(Vs,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
835
+ return re("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function io({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=j().charts,p=D(),g=s??(e=>Number.isInteger(e)?P(e,p):A(e,1,p)),f=o??(e=>P(e,p)),x=c??m.countAxis,b=d??m.distribution,y=r??ps(e??[],t),v=is(0,l,i),w=y.map(e=>g(e.from)),N=y.map(e=>e.count);/* @__PURE__ */
836
+ return re(Ks,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:x,className:u,emptyLabel:h,ariaLabel:m.histogram(b,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */re(_s,{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__ */re("g",{children:y.map((a,l)=>/* @__PURE__ */re("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 so({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=j().charts,u=D(),h=l??(e=>P(e,u)),m=s??d.distribution,p=is(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
837
+ return re(Ks,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
838
838
  return re(_s,{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__ */re("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
839
839
  return ne("g",{opacity:null!==n&&n!==a?.45:1,children:[
840
840
  /* @__PURE__ */re("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
@@ -842,13 +842,13 @@ return ne("g",{opacity:null!==n&&n!==a?.45:1,children:[
842
842
  /* @__PURE__ */re("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
843
843
  /* @__PURE__ */re("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
844
844
  /* @__PURE__ */re("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}),
845
- /* @__PURE__ */re("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__ */re("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:as.surface,strokeWidth:1.5},t))]},a)})})})}function so({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=a??(e=>Number.isInteger(e)?P(e,d):A(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__ */
846
- return re(Vs,{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:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ns.good:ns.critical;/* @__PURE__ */
845
+ /* @__PURE__ */re("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__ */re("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:as.surface,strokeWidth:1.5},t))]},a)})})})}function oo({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=a??(e=>Number.isInteger(e)?P(e,d):A(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__ */
846
+ return re(Ks,{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:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ns.good:ns.critical;/* @__PURE__ */
847
847
  return re(_s,{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__ */re("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?ns.good:ns.critical,o=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__ */
848
848
  return ne("g",{opacity:d?.45:1,children:[
849
849
  /* @__PURE__ */re("line",{x1:o,y1:n(e.high),x2:o,y2:n(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */re("rect",{x:o-c/2,y:u,width:c,height:h,rx:1,fill:i?s:"transparent",fillOpacity:i?.85:1,stroke:s,strokeWidth:1.5}):/* @__PURE__ */ne(ae,{children:[
850
850
  /* @__PURE__ */re("line",{x1:o-c/2,y1:n(e.open),x2:o,y2:n(e.open),stroke:s,strokeWidth:2}),
851
- /* @__PURE__ */re("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function oo({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=j().charts,p=D(),g=s??(e=>P(e,p)),f=o??m.intensity,x=d??m.noActivity,b=H(null),y=Fs(b),v=a??y,w=_(),[N,k]=Y(null);if(q(()=>{if(null!==N)return M(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
851
+ /* @__PURE__ */re("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function co({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=j().charts,p=D(),g=s??(e=>P(e,p)),f=o??m.intensity,x=d??m.noActivity,b=H(null),y=Fs(b),v=a??y,w=_(),[N,k]=Y(null);if(q(()=>{if(null!==N)return M(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
852
852
  return re("div",{className:c,ref:b,children:/* @__PURE__ */re("p",{className:"py-8 text-center text-sm text-gray-500",children:x})});const $=l??is(0),C=i??Math.max(1,...r.flat().filter(Number.isFinite)),L=96,S=26*e.length,z=n??S+26+26,A=Math.max(2,(Math.max(97,v)-L)/t.length),F=e=>{const t=C>0?Math.max(0,Math.min(1,e/C)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${as.surface})`};/* @__PURE__ */
853
853
  return ne("div",{className:`relative ${c??""}`,ref:b,children:[
854
854
  /* @__PURE__ */ne("svg",{width:"100%",height:z,viewBox:`0 0 ${v} ${z}`,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:[
@@ -858,25 +858,25 @@ return ne("div",{className:`relative ${c??""}`,ref:b,children:[
858
858
  return re("rect",{x:L+a*A+u/2,y:26*n+u/2,width:Math.max(1,A-u),height:26-u,rx:h,fill:F(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */re("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-L)/56))))===0?/* @__PURE__ */re("text",{x:L+r*A+A/2,y:S+15,textAnchor:"middle",fontSize:11,fill:as.label,children:e},`c${r}`):null),
859
859
  /* @__PURE__ */re("rect",{x:L,y:S+26,width:Math.min(180,Math.max(40,v-L)),height:8,rx:4,fill:`url(#${w})`}),
860
860
  /* @__PURE__ */re("text",{x:L,y:S+48,fontSize:10.5,fill:as.label,children:"0"}),
861
- /* @__PURE__ */re("text",{x:L+Math.min(180,Math.max(40,v-L)),y:S+48,textAnchor:"end",fontSize:10.5,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:g(C)})]}),N&&/* @__PURE__ */re("div",{className:"absolute top-1 right-1 z-10",children:/* @__PURE__ */re(_s,{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 co({caption:e,head:t,rows:r}){/* @__PURE__ */
861
+ /* @__PURE__ */re("text",{x:L+Math.min(180,Math.max(40,v-L)),y:S+48,textAnchor:"end",fontSize:10.5,fill:as.label,style:{fontVariantNumeric:"tabular-nums"},children:g(C)})]}),N&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */re(_s,{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 uo({caption:e,head:t,rows:r}){/* @__PURE__ */
862
862
  return ne("table",{className:"sr-only",children:[
863
863
  /* @__PURE__ */re("caption",{children:e}),
864
864
  /* @__PURE__ */re("thead",{children:/* @__PURE__ */re("tr",{children:t.map(e=>/* @__PURE__ */re("th",{scope:"col",children:e},e))})}),
865
- /* @__PURE__ */re("tbody",{children:r.map((e,t)=>/* @__PURE__ */re("tr",{children:e.map((e,t)=>/* @__PURE__ */re("td",{children:e},t))},t))})]})}var uo=3,ho=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function mo({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=j().charts,u=D(),h=i??(e=>P(e,u)),m=c??d.nothingToCompare,p=_(),[g,f]=Y(null),{highlighted:x}=zs(),b=t.slice(0,3);if(e.length<3||0===b.length)/* @__PURE__ */
865
+ /* @__PURE__ */re("tbody",{children:r.map((e,t)=>/* @__PURE__ */re("tr",{children:e.map((e,t)=>/* @__PURE__ */re("td",{children:e},t))},t))})]})}var ho=3,mo=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function po({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=j().charts,u=D(),h=i??(e=>P(e,u)),m=c??d.nothingToCompare,p=_(),[g,f]=Y(null),{highlighted:x}=zs(),b=t.slice(0,3);if(e.length<3||0===b.length)/* @__PURE__ */
866
866
  return re("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,N=hs(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...b.map(e=>e.values[t]??0).filter(Number.isFinite))),M=(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)]},$=(e,t)=>null!==g?g!==e:null!==x&&x!==t,C=null!==g?b[g]:void 0;/* @__PURE__ */
867
867
  return ne("div",{className:`relative ${o??""}`,children:[
868
868
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
869
- /* @__PURE__ */re("title",{id:p,children:d.acrossMeasures(b.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */re("circle",{cx:y,cy:v,r:n,fill:"none",stroke:as.grid,strokeWidth:1},r):/* @__PURE__ */re("path",{d:ho(Ms(y,v,n,e.length)),fill:"none",stroke:as.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,k[t]);/* @__PURE__ */
869
+ /* @__PURE__ */re("title",{id:p,children:d.acrossMeasures(b.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */re("circle",{cx:y,cy:v,r:n,fill:"none",stroke:as.grid,strokeWidth:1},r):/* @__PURE__ */re("path",{d:mo(Ms(y,v,n,e.length)),fill:"none",stroke:as.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,k[t]);/* @__PURE__ */
870
870
  return ne("g",{children:[
871
871
  /* @__PURE__ */re("line",{x1:y,y1:v,x2:r,y2:n,stroke:as.grid,strokeWidth:1}),
872
872
  /* @__PURE__ */re("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:as.label,children:e.label})]},e.key)}),
873
873
  /* @__PURE__ */re(wa,{id:p,reveal:!!s&&"center-out"}),b.map((t,r)=>{const a=is(r,t.color,t.tone),l=e.map((e,r)=>M(r,t.values[r]??0));/* @__PURE__ */
874
- return ne("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${ga(p)})`:void 0,children:["area"===n&&/* @__PURE__ */re("path",{d:ho(l),fill:a,fillOpacity:.18,stroke:"none"}),
875
- /* @__PURE__ */re("path",{d:ho(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */re("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:as.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:is(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
874
+ return ne("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${ga(p)})`:void 0,children:["area"===n&&/* @__PURE__ */re("path",{d:mo(l),fill:a,fillOpacity:.18,stroke:"none"}),
875
+ /* @__PURE__ */re("path",{d:mo(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */re("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:as.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:is(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
876
876
  /* @__PURE__ */re("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:b.map((e,t)=>/* @__PURE__ */ne("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
877
877
  /* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:is(t,e.color,e.tone)}}),
878
878
  /* @__PURE__ */re("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
879
- /* @__PURE__ */re(co,{caption:d.acrossMeasures(b.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:b.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function po({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=j().charts,g=D(),f=s??(e=>P(e,g)),x=i??p.other,b=m??p.nothingToBreakDown,y=_(),[v,w]=Y(null),{highlighted:N}=zs(),k=e.filter(e=>e.value>0);if(0===k.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${h??""}`,children:b});const M=[...k].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:x,value:C.reduce((e,t)=>e+t.value,0)}]:$,S=L.reduce((e,t)=>e+t.value,0),z=r/2,A=r/2,B=r/2-12,T=n??("ring"===t?.58*B:0),I=hs(L.length,a),W=Math.max(...L.map(e=>e.value)),E=e=>T+(B-T)*Math.sqrt(Math.max(0,e)/W);let R=-Math.PI/2;const O=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?hs(L.length,a).step:r.value/S*Math.PI*2,i="rose"===t?hs(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?E(r.value):B;return{key:r.key,label:r.label,share:r.value/S,right:Math.cos(i)>=0,anchor:[z+s*Math.cos(i),A+s*Math.sin(i)],y:A+(s+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),H=(e,t)=>null!==v?v!==e:null!==N&&N!==t,q=null!==v?L[v]:void 0;/* @__PURE__ */
879
+ /* @__PURE__ */re(uo,{caption:d.acrossMeasures(b.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:b.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function go({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=j().charts,g=D(),f=s??(e=>P(e,g)),x=i??p.other,b=m??p.nothingToBreakDown,y=_(),[v,w]=Y(null),{highlighted:N}=zs(),k=e.filter(e=>e.value>0);if(0===k.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${h??""}`,children:b});const M=[...k].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:x,value:C.reduce((e,t)=>e+t.value,0)}]:$,S=L.reduce((e,t)=>e+t.value,0),z=r/2,A=r/2,B=r/2-12,T=n??("ring"===t?.58*B:0),I=hs(L.length,a),W=Math.max(...L.map(e=>e.value)),E=e=>T+(B-T)*Math.sqrt(Math.max(0,e)/W);let R=-Math.PI/2;const O=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?hs(L.length,a).step:r.value/S*Math.PI*2,i="rose"===t?hs(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?E(r.value):B;return{key:r.key,label:r.label,share:r.value/S,right:Math.cos(i)>=0,anchor:[z+s*Math.cos(i),A+s*Math.sin(i)],y:A+(s+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),H=(e,t)=>null!==v?v!==e:null!==N&&N!==t,q=null!==v?L[v]:void 0;/* @__PURE__ */
880
880
  return ne("div",{className:`relative ${h??""}`,children:[
881
881
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
882
882
  /* @__PURE__ */re("title",{id:y,children:p.breakdown(f(S),L.length)}),L.map((e,r)=>{const n=is(r,e.color,e.tone),l="rose"===t?I(r):R,i="rose"===t?I.step:e.value/S*Math.PI*2-a;"rose"!==t&&(R+=e.value/S*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?E(e.value):B;/* @__PURE__ */
@@ -884,22 +884,22 @@ return re("path",{d:$s(z,A,T,o,l,s),fill:n,fillOpacity:H(r,e.key)?.4:1,stroke:as
884
884
  return ne("g",{children:[
885
885
  /* @__PURE__ */re("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:as.grid,strokeWidth:1}),
886
886
  /* @__PURE__ */re("text",{x:t,y:e.y-2,fontSize:10.5,fill:as.label,textAnchor:e.right?"end":"start",children:e.label}),
887
- /* @__PURE__ */re("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:as.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:F(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&T>0&&/* @__PURE__ */re("text",{x:z,y:A+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:as.label,children:o})]}),q&&null!==v&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:q.label,rows:[{key:"value",label:p.value,color:is(v,q.color,q.tone),value:f(q.value)},{key:"share",label:p.share,color:as.muted,value:F(q.value/S*100,1,g)}]})}),
887
+ /* @__PURE__ */re("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:as.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:F(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&T>0&&/* @__PURE__ */re("text",{x:z,y:A+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:as.label,children:o})]}),q&&null!==v&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:q.label,rows:[{key:"value",label:p.value,color:is(v,q.color,q.tone),value:f(q.value)},{key:"share",label:p.share,color:as.muted,value:F(q.value/S*100,1,g)}]})}),
888
888
  /* @__PURE__ */re("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */ne("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
889
889
  /* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:is(t,e.color,e.tone)}}),
890
890
  /* @__PURE__ */re("span",{className:"flex-1 truncate",children:e.label}),
891
- /* @__PURE__ */re("span",{className:"tabular-nums text-gray-800",children:F(e.value/S*100,1,g)})]},e.key))})]})}var go=300*Math.PI/180;function fo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=j().charts,d=D(),u=a??(e=>P(e,d)),h=s??c.nothingToPlot,m=_(),[p,g]=Y(null),{highlighted:f}=zs();if(0===e.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const x=r/2,b=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,M=Math.min(o,Math.max(1,w-2)),$=hs(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
891
+ /* @__PURE__ */re("span",{className:"tabular-nums text-gray-800",children:F(e.value/S*100,1,g)})]},e.key))})]})}var fo=300*Math.PI/180;function xo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=j().charts,d=D(),u=a??(e=>P(e,d)),h=s??c.nothingToPlot,m=_(),[p,g]=Y(null),{highlighted:f}=zs();if(0===e.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const x=r/2,b=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,M=Math.min(o,Math.max(1,w-2)),$=hs(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
892
892
  return ne("div",{className:`relative ${i??""}`,children:[
893
893
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
894
894
  /* @__PURE__ */re("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=is(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),s=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=y-n*w,r=t-w+M,o=-Math.PI/2;/* @__PURE__ */
895
895
  return ne("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),className:l?ka.sweep:void 0,style:l?Ma(n,70):void 0,children:[
896
- /* @__PURE__ */re("path",{d:$s(x,b,r,t,o,o+go),fill:as.grid}),
897
- /* @__PURE__ */re("path",{d:$s(x,b,r,t,o,o+go*i),fill:a})]},e.key)}const o=.14*r;/* @__PURE__ */
898
- return re("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */re("path",{d:$s(x,b,o,o+(y-o)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:[{key:"value",label:c.value,color:is(p,C.color,C.tone),value:u(C.value)}]})}),
896
+ /* @__PURE__ */re("path",{d:$s(x,b,r,t,o,o+fo),fill:as.grid}),
897
+ /* @__PURE__ */re("path",{d:$s(x,b,r,t,o,o+fo*i),fill:a})]},e.key)}const o=.14*r;/* @__PURE__ */
898
+ return re("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */re("path",{d:$s(x,b,o,o+(y-o)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:[{key:"value",label:c.value,color:is(p,C.color,C.tone),value:u(C.value)}]})}),
899
899
  /* @__PURE__ */re("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__ */ne("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
900
900
  /* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:is(t,e.color,e.tone)}}),
901
901
  /* @__PURE__ */re("span",{className:"flex-1 truncate",children:e.label}),
902
- /* @__PURE__ */re("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function xo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=l??(e=>P(e,d)),h=o??c.noStages,m=_(),[p,g]=Y(null),{highlighted:f}=zs();if(0===e.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const x=i??is(0),b=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,N=e=>w*Math.max(0,e/y)/2,k=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${x} ${M(e).toFixed(0)}%, ${as.surface})`,C=e=>M(e)>=55?as.surface:as.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,S=null!==p?e[p]:void 0;/* @__PURE__ */
902
+ /* @__PURE__ */re("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function bo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=l??(e=>P(e,d)),h=o??c.noStages,m=_(),[p,g]=Y(null),{highlighted:f}=zs();if(0===e.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const x=i??is(0),b=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,N=e=>w*Math.max(0,e/y)/2,k=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${x} ${M(e).toFixed(0)}%, ${as.surface})`,C=e=>M(e)>=55?as.surface:as.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,S=null!==p?e[p]:void 0;/* @__PURE__ */
903
903
  return ne("div",{className:`relative ${s??""}`,children:[
904
904
  /* @__PURE__ */ne("svg",{width:"100%",height:b,viewBox:`0 0 ${n} ${b}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
905
905
  /* @__PURE__ */re("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,n)=>{const l=n*b/e.length+a/2,i=(n+1)*b/e.length-a/2,s=N(r.value),o="cone"===t?N(e[n+1]?.value??r.value):s,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
@@ -907,28 +907,28 @@ return ne("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
907
907
  /* @__PURE__ */re("path",{d:`M${k-s},${l} L${k+s},${l} L${k+o},${i} L${k-o},${i} Z`,fill:$(n)}),
908
908
  /* @__PURE__ */re("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:as.label,children:r.label}),
909
909
  /* @__PURE__ */ne("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:as.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${F(h,1,d)}`:""]}),
910
- /* @__PURE__ */re("text",{x:k,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:F(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),S&&null!==p&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:S.label,rows:[{key:"value",label:c.count,color:$(p),value:u(S.value)},{key:"share",label:c.ofFirstStage,color:as.muted,value:F(S.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:ns.critical,value:`−${F(100*(1-S.value/e[p-1].value),1,d)}`}]:[]]})})]})}function bo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=l??(e=>P(e,d)),h=o??c.nothingToBreakDown,m=H(null),p=Fs(m),g=r??p,[f,x]=Y(null),{highlighted:b}=zs(),y=Ds(e,g,t);if(0===y.length)/* @__PURE__ */
910
+ /* @__PURE__ */re("text",{x:k,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:F(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),S&&null!==p&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:S.label,rows:[{key:"value",label:c.count,color:$(p),value:u(S.value)},{key:"share",label:c.ofFirstStage,color:as.muted,value:F(S.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:ns.critical,value:`−${F(100*(1-S.value/e[p-1].value),1,d)}`}]:[]]})})]})}function yo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=l??(e=>P(e,d)),h=o??c.nothingToBreakDown,m=H(null),p=Fs(m),g=r??p,[f,x]=Y(null),{highlighted:b}=zs(),y=Ds(e,g,t);if(0===y.length)/* @__PURE__ */
911
911
  return re("div",{className:s,ref:m,children:/* @__PURE__ */re("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??is(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)}%, ${as.surface})`,M=e=>N(e)>=55?as.surface:as.label,$=f??b,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
912
912
  return ne("div",{className:`relative ${s??""}`,ref:m,children:[
913
913
  /* @__PURE__ */re("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>x(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__ */
914
914
  return ne("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>x(e.key),children:[
915
- /* @__PURE__ */re("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */re("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */re("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
916
- /* @__PURE__ */re(co,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function yo(e,t,r,n,a,l,i,s){if(n>=8)return;const o=e.reduce((e,t)=>e+vo(t,8-n),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=vo(e,8-n),u=d/o*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;s.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&yo(e.children,c,u,n+1,m,p,h,s),c+=u})}function vo(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+vo(r,t-1),0):Math.max(0,e.value??0)}function wo({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:s}){const o=j().charts,c=D(),d=a??(e=>P(e,c)),u=s??o.nothingToBreakDown,[h,m]=Y(null),{highlighted:p}=zs(),g=[];if(yo(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,x=t/2,b=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, ${is(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${as.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,M=e=>F(e.value/v*100,1,c);/* @__PURE__ */
915
+ /* @__PURE__ */re("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */re("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */re("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
916
+ /* @__PURE__ */re(uo,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function vo(e,t,r,n,a,l,i,s){if(n>=8)return;const o=e.reduce((e,t)=>e+wo(t,8-n),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=wo(e,8-n),u=d/o*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;s.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&vo(e.children,c,u,n+1,m,p,h,s),c+=u})}function wo(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+wo(r,t-1),0):Math.max(0,e.value??0)}function No({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:s}){const o=j().charts,c=D(),d=a??(e=>P(e,c)),u=s??o.nothingToBreakDown,[h,m]=Y(null),{highlighted:p}=zs(),g=[];if(vo(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,x=t/2,b=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, ${is(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${as.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,M=e=>F(e.value/v*100,1,c);/* @__PURE__ */
917
917
  return ne("div",{className:`relative ${i??""}`,children:[
918
- /* @__PURE__ */ne("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */re("path",{d:$s(x,b,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:as.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */re("text",{x:x,y:b+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:as.label,children:l})]}),k&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:k.label,rows:[{key:"value",label:o.value,color:w(k),value:d(k.value)},{key:"share",label:o.share,color:as.muted,value:M(k)}]})}),
919
- /* @__PURE__ */re(co,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function No({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=i??(e=>P(e,d)),h=o??c.noFlows,m=H(null),p=Fs(m),g=n??p,[f,x]=Y(null),{highlighted:b}=zs();if(0===e.length||0===t.length)/* @__PURE__ */
918
+ /* @__PURE__ */ne("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */re("path",{d:$s(x,b,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:as.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */re("text",{x:x,y:b+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:as.label,children:l})]}),k&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:k.label,rows:[{key:"value",label:o.value,color:w(k),value:d(k.value)},{key:"share",label:o.share,color:as.muted,value:M(k)}]})}),
919
+ /* @__PURE__ */re(uo,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function ko({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=i??(e=>P(e,d)),h=o??c.noFlows,m=H(null),p=Fs(m),g=n??p,[f,x]=Y(null),{highlighted:b}=zs();if(0===e.length||0===t.length)/* @__PURE__ */
920
920
  return re("div",{className:s,ref:m,children:/* @__PURE__ */re("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))),M=r-20,$=k>0?(M-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)*$)),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>M&&a>0?Math.max(0,1-(n-M)/a):1;let s=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:s,h:a,index:n}),s+=a+l})}const L=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,z=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,F="link"===f?.kind?t[f.index]:void 0,B="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
921
921
  return ne("div",{className:`relative ${s??""}`,ref:m,children:[
922
922
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>x(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*$),i=r.y+(L.get(e.from)??0)+l/2,s=n.y+(S.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),S.set(e.to,(S.get(e.to)??0)+l);const o=r.x+a,c=n.x,d=is(r.index,e.color),u=`${e.from}→${e.to}`,h=z.get(u)??0;z.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==b?A(e,b):null)(e,t);/* @__PURE__ */
923
923
  return re("path",{d:vs([[o,i],[c,s]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>x({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!==b?b===i:null);var i;/* @__PURE__ */
924
924
  return ne("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>x({kind:"node",key:e.key}),children:[
925
925
  /* @__PURE__ */re("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:is(r.index,e.color,e.tone)}),
926
- /* @__PURE__ */re("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:as.label,children:e.label})]},e.key)})]}),F&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:`${F.from} → ${F.to}`,rows:[{key:"value",label:c.flow,color:is(C.get(F.from)?.index??0,F.color),value:u(F.value)}]})}),B&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:B.label,rows:[{key:"value",label:c.throughput,color:is(C.get(B.key)?.index??0,B.color,B.tone),value:u(w.get(B.key)??0)}]})}),
927
- /* @__PURE__ */re(co,{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 ko({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=i??(e=>P(e,d)),h=o??c.noFlows,[m,p]=Y(null),{highlighted:g}=zs(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},x=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),b=e.map((e,t)=>t).sort((e,t)=>x[t]-x[e]).slice(0,n),y=b.reduce((e,t)=>e+x[t],0);if(y<=0)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,N=r/2-44,k=N-l,M=a*b.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;b.forEach((e,t)=>{const r=x[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,S=[];for(const e of b)for(const t of b){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,x[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),S.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const z=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,F="ribbon"===m?.kind?S[m.index]:void 0;/* @__PURE__ */
926
+ /* @__PURE__ */re("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:as.label,children:e.label})]},e.key)})]}),F&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:`${F.from} → ${F.to}`,rows:[{key:"value",label:c.flow,color:is(C.get(F.from)?.index??0,F.color),value:u(F.value)}]})}),B&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:B.label,rows:[{key:"value",label:c.throughput,color:is(C.get(B.key)?.index??0,B.color,B.tone),value:u(w.get(B.key)??0)}]})}),
927
+ /* @__PURE__ */re(uo,{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 Mo({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=j().charts,d=D(),u=i??(e=>P(e,d)),h=o??c.noFlows,[m,p]=Y(null),{highlighted:g}=zs(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},x=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),b=e.map((e,t)=>t).sort((e,t)=>x[t]-x[e]).slice(0,n),y=b.reduce((e,t)=>e+x[t],0);if(y<=0)/* @__PURE__ */return re("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,N=r/2-44,k=N-l,M=a*b.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;b.forEach((e,t)=>{const r=x[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,S=[];for(const e of b)for(const t of b){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,x[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),S.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const z=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,F="ribbon"===m?.kind?S[m.index]:void 0;/* @__PURE__ */
928
928
  return ne("div",{className:`relative ${s??""}`,children:[
929
929
  /* @__PURE__ */ne("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(b.length),onMouseLeave:()=>p(null),children:[S.map((t,n)=>{const[a,l]=z(t.a,k),[i,s]=z(t.b,k),o=is($.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,n);/* @__PURE__ */
930
930
  return re("path",{d:`M${a},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:n})},`${e[t.from]}→${e[t.to]}`)}),b.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=z(n,N+16),i=(t=>m?"arc"===m.kind?m.index===t:S[m.index].from===t||S[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
931
931
  return ne("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
932
932
  /* @__PURE__ */re("path",{d:$s(v,w,k,N,r.start,r.end),fill:is(r.slot),fillOpacity:null===i||i?1:.45}),
933
- /* @__PURE__ */re("text",{x:a,y:l+4,fontSize:11,fill:as.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:is($.get(A).slot),value:u(x[A])}]})}),F&&/* @__PURE__ */re("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:`${e[F.from]} → ${e[F.to]}`,rows:[{key:"value",label:c.flow,color:is($.get(F.from).slot),value:u(F.value)}]})}),
934
- /* @__PURE__ */re(co,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:S.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Hl as APP_UPDATE_POLL_MS,Wn as Accordion,ql as AppUpdateBanner,Br as AttachButton,Ar as AttachmentDropZone,Fr as AttachmentList,Wi as AuthScreen,$n as Avatar,Cn as AvatarGroup,Sn as Banner,di as BarChart,io as BoxPlotChart,at as BrandAssetEditor,ca as BudgetBar,as as CHART_INK,Pt as Calendar,so as CandlestickChart,Or as Card,Vs as CartesianPlot,Us as ChartBrush,wa as ChartDefs,qs as ChartDot,Hs as ChartFrame,Ss as ChartHighlightProvider,Rs as ChartSkeleton,_s as ChartTooltip,Ai as ChatTemplate,Be as Checkbox_default,Li as CheckoutTemplate,ko as ChordChart,Vn as ColoredBadge,eo as ColumnChart,Tr as ComposerAttachments,yl as ContainerFillChart,bn as CountBadge,da as DAY_MS,yi as DashboardTemplate,ii as DataTable,ki as DataTablePage,Qt as DatePicker_default,Yt as DateRangePicker,nr as DateTimePicker_default,gn as DescriptionList,sn as Divider,hi as DonutChart,Zl as Drawer,Rl as DropdownMenu,Si as EmailTemplate,Kn as EmptyState,Yi as ErrorBoundary,Ri as ErrorPage,Sr as FilePicker_default,Oe as FormErrorSummary,We as FormField,$i as FormLayoutPage,xo as FunnelChart,On as GROUP_COLORS,Yn as GROUP_COLORS_SOLID,Ti as GalleryTemplate,an as Grid,oo as HeatmapChart,zl as HelpCenter,lo as HistogramChart,de as INPUT_BASE,ce as INPUT_SIZES,ie as IconButton_default,en as Inline,jr as InputNumber_default,me as Input_default,Gl as Kanban,_e as Label,pi as LineChart,si as ListFooter,oi as ListLoadError,hr as MAX_FRACTION_DIGITS,fe as MENU_MAX_HEIGHT,ka as MOTION,jl as Markdown,nt as MediaUploadField,ut as MediaUploadGrid,Is as Meter,la as MetricBar,dl as MilestoneTimeline,ze as NativeSelect,fr as NumericKeypad,ge as POPUP_MAX_WIDTH,ul as POST_PRODUCTION_STATUSES,Zn as PageHeader,Xl as Pagination,zr as PaperclipGlyph,Zr as Paragraph,po as PieChart,Yl as Popover,ot as PortalBrandingProvider,xl as ProductionTimeline,uo as RADAR_SERIES_CAP,mo as RadarChart,fo as RadialBarChart,Re as RadioGroup,Ie as Radio_default,no as RangeChart,Bs as RankedBars,to as SCATTER_SERIES_CAP,ts as SERIES_SLOT_COUNT,rs as SERIES_VARS,hl as STAGES,ns as STATUS_VARS,No as SankeyChart,ro as ScatterChart,Wr as SearchableSelect,Nr as Segmented,Ae as Select_default,fn as SettingRow,Al as SidebarActionButton,Fl as SidebarGroupLabel,Bl as SidebarNavItem,dn as Skeleton,ur as Snippet,ci as Sparkline,Qr as Stack,Yr as StatCard,Es as StatTile,wn as Statistic,Un as StatusBadge,qn as StatusBadgeProvider,In as Stepper,wo as SunburstChart,Cr as Switch_default,Bn as Tabs,Er as TagInput,Ur as Text,pe as Textarea_default,br as TileButton_default,Ut as TimePicker_default,Qs as TimeSeriesChart,ol as TimelineTrack,Kr as Title,Rn as Tooltip,Tl as TopNav,bo as TreemapChart,ao as WaterfallChart,hs as angleScale,mr as appendKey,Xi as applyThemePrefs,$s as arcPath,ks as areaBetween,Ns as areaFrom,As as autoHighlightIndex,pr as backspace,os as bandScale,ps as binValues,sa as budgetState,vs as bumpPath,ml as calcOverall,pl as calcReportOverall,ir as copyToClipboard,ws as curvePath,ba as dashFor,xa as fillFor,ma as fillId,Mt as firstDayOfWeek,Le as firstEnabledIndex,ha as fmtSliderDate,yt as formatDate,Lt as fromKey,pa as glowId,fa as groundId,Hn as groupColors,Ps as highlightOpacity,he as inputClasses,Jn as isSeverityTone,He as labelClasses,cs as ladderScale,De as lastEnabledIndex,fs as linearPath,ss as linearScale,us as logScale,ga as maskId,Se as matchTypeahead,Ue as mediaFileName,bs as monotonePath,je as nextEnabledIndex,ds as niceMax,Ms as polygonPoints,be as popupBounds,ms as radiusScale,lt as resolvePortalBrandAsset,is as resolveSeriesColor,Zi as resolveTheme,ar as selectionAt,ls as seriesColor,Xn as severityOf,ys as splinePath,Ds as squarify,Ma as stagger,xs as stepPath,zn as tabButtonId,Pn as tabPanelId,ua as toDayMs,Tt as toISODate,Ct as toKey,_l as useAppUpdate,es as useClickOutside,Ce as useDropdownPosition,zs as useHighlight,Fs as usePlotWidth,ct as usePortalBranding,gl as useProductionTimeline,Qi as useTheme};
933
+ /* @__PURE__ */re("text",{x:a,y:l+4,fontSize:11,fill:as.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:is($.get(A).slot),value:u(x[A])}]})}),F&&/* @__PURE__ */re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */re(_s,{title:`${e[F.from]} → ${e[F.to]}`,rows:[{key:"value",label:c.flow,color:is($.get(F.from).slot),value:u(F.value)}]})}),
934
+ /* @__PURE__ */re(uo,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:S.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Hl as APP_UPDATE_POLL_MS,Wn as Accordion,ql as AppUpdateBanner,Br as AttachButton,Ar as AttachmentDropZone,Fr as AttachmentList,Wi as AuthScreen,$n as Avatar,Cn as AvatarGroup,Sn as Banner,di as BarChart,so as BoxPlotChart,at as BrandAssetEditor,ca as BudgetBar,as as CHART_INK,Pt as Calendar,oo as CandlestickChart,Or as Card,Ks as CartesianPlot,Us as ChartBrush,wa as ChartDefs,qs as ChartDot,Hs as ChartFrame,Ss as ChartHighlightProvider,Rs as ChartSkeleton,_s as ChartTooltip,Ai as ChatTemplate,Be as Checkbox_default,Li as CheckoutTemplate,Mo as ChordChart,Vn as ColoredBadge,to as ColumnChart,Tr as ComposerAttachments,yl as ContainerFillChart,bn as CountBadge,da as DAY_MS,yi as DashboardTemplate,ii as DataTable,ki as DataTablePage,Qt as DatePicker_default,Yt as DateRangePicker,nr as DateTimePicker_default,gn as DescriptionList,sn as Divider,hi as DonutChart,Zl as Drawer,Rl as DropdownMenu,Si as EmailTemplate,Kn as EmptyState,Yi as ErrorBoundary,Ri as ErrorPage,Sr as FilePicker_default,Oe as FormErrorSummary,We as FormField,$i as FormLayoutPage,bo as FunnelChart,On as GROUP_COLORS,Yn as GROUP_COLORS_SOLID,Ti as GalleryTemplate,an as Grid,co as HeatmapChart,zl as HelpCenter,io as HistogramChart,de as INPUT_BASE,ce as INPUT_SIZES,ie as IconButton_default,en as Inline,jr as InputNumber_default,me as Input_default,Gl as Kanban,_e as Label,pi as LineChart,si as ListFooter,oi as ListLoadError,hr as MAX_FRACTION_DIGITS,fe as MENU_MAX_HEIGHT,ka as MOTION,jl as Markdown,nt as MediaUploadField,ut as MediaUploadGrid,Is as Meter,la as MetricBar,dl as MilestoneTimeline,ze as NativeSelect,fr as NumericKeypad,ge as POPUP_MAX_WIDTH,ul as POST_PRODUCTION_STATUSES,Zn as PageHeader,Xl as Pagination,zr as PaperclipGlyph,Zr as Paragraph,go as PieChart,Yl as Popover,ot as PortalBrandingProvider,xl as ProductionTimeline,ho as RADAR_SERIES_CAP,po as RadarChart,xo as RadialBarChart,Re as RadioGroup,Ie as Radio_default,ao as RangeChart,Bs as RankedBars,ro as SCATTER_SERIES_CAP,ts as SERIES_SLOT_COUNT,rs as SERIES_VARS,hl as STAGES,ns as STATUS_VARS,ko as SankeyChart,no as ScatterChart,Wr as SearchableSelect,Nr as Segmented,Ae as Select_default,fn as SettingRow,Al as SidebarActionButton,Fl as SidebarGroupLabel,Bl as SidebarNavItem,dn as Skeleton,ur as Snippet,ci as Sparkline,Qr as Stack,Yr as StatCard,Es as StatTile,wn as Statistic,Un as StatusBadge,qn as StatusBadgeProvider,In as Stepper,No as SunburstChart,Cr as Switch_default,Bn as Tabs,Er as TagInput,Ur as Text,pe as Textarea_default,br as TileButton_default,Ut as TimePicker_default,eo as TimeSeriesChart,ol as TimelineTrack,Kr as Title,Rn as Tooltip,Tl as TopNav,yo as TreemapChart,lo as WaterfallChart,hs as angleScale,mr as appendKey,Xi as applyThemePrefs,$s as arcPath,ks as areaBetween,Ns as areaFrom,As as autoHighlightIndex,pr as backspace,os as bandScale,ps as binValues,sa as budgetState,vs as bumpPath,ml as calcOverall,pl as calcReportOverall,ir as copyToClipboard,ws as curvePath,ba as dashFor,xa as fillFor,ma as fillId,Mt as firstDayOfWeek,Le as firstEnabledIndex,ha as fmtSliderDate,yt as formatDate,Lt as fromKey,pa as glowId,fa as groundId,Hn as groupColors,Ps as highlightOpacity,he as inputClasses,Jn as isSeverityTone,He as labelClasses,cs as ladderScale,De as lastEnabledIndex,fs as linearPath,ss as linearScale,us as logScale,ga as maskId,Se as matchTypeahead,Ue as mediaFileName,bs as monotonePath,je as nextEnabledIndex,ds as niceMax,Ms as polygonPoints,be as popupBounds,ms as radiusScale,lt as resolvePortalBrandAsset,is as resolveSeriesColor,Zi as resolveTheme,ar as selectionAt,ls as seriesColor,Xn as severityOf,ys as splinePath,Ds as squarify,Ma as stagger,xs as stepPath,zn as tabButtonId,Pn as tabPanelId,ua as toDayMs,Tt as toISODate,Ct as toKey,_l as useAppUpdate,es as useClickOutside,Ce as useDropdownPosition,zs as useHighlight,Fs as usePlotWidth,ct as usePortalBranding,gl as useProductionTimeline,Qi as useTheme};