@uxuissk/design-system 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@
53
53
  `,style:V,children:I},I))})]}),u&&a==="single"&&P==="days"&&e.jsxs("div",{className:"px-4 py-3 border-t border-border flex items-center gap-3",children:[e.jsx(v.Clock,{size:14,className:"text-muted-foreground"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"number",min:0,max:23,value:String(_).padStart(2,"0"),onChange:I=>K(Math.max(0,Math.min(23,Number(I.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:V}),e.jsx("span",{className:"text-muted-foreground",style:V,children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:String(Z).padStart(2,"0"),onChange:I=>G(Math.max(0,Math.min(59,Number(I.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:V})]}),e.jsx("button",{onClick:Y,className:"ml-auto px-3 py-1 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:V,children:"Apply"})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-card flex items-center justify-between",children:[S?e.jsx("button",{onClick:O,className:"text-primary hover:underline cursor-pointer",style:V,children:"Today"}):e.jsx("span",{}),z??e.jsx("button",{onClick:()=>{E(!1),L("days")},className:"text-muted-foreground hover:text-foreground cursor-pointer",style:V,children:"Close"})]})]})]})}const Ft={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]"};function br({open:r,onClose:t,title:o,description:s,size:a="md",children:n,footer:l,closeOnOverlay:i=!0,showCloseButton:d=!0,className:c=""}){const h=b.useRef(null);return b.useEffect(()=>{if(!r)return;const g=x=>{x.key==="Escape"&&t()};return document.addEventListener("keydown",g),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=""}},[r,t]),b.useEffect(()=>{r&&h.current&&h.current.focus()},[r]),r?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/40 backdrop-blur-sm animate-in fade-in duration-200",onClick:i?t:void 0}),e.jsxs("div",{ref:h,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":o?"modal-title":void 0,className:`relative w-full ${Ft[a]} bg-card rounded-[var(--radius-lg)] shadow-elevation-sm border border-border animate-in zoom-in-95 fade-in duration-200 flex flex-col ${a==="full"?"h-full":"max-h-[85vh]"} ${c}`,children:[(o||d)&&e.jsxs("div",{className:"flex items-start justify-between gap-4 px-6 pt-6 pb-2 flex-shrink-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[o&&e.jsx("h4",{id:"modal-title",className:"text-foreground",children:o}),s&&e.jsx("span",{className:"text-muted-foreground block mt-0.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:s})]}),d&&e.jsx("button",{onClick:t,className:"flex-shrink-0 w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer","aria-label":"Close",children:e.jsx(v.X,{size:16})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:n}),l&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-border flex-shrink-0",children:l})]})]}):null}function Ct({open:r,onClose:t,onConfirm:o,title:s="Are you sure?",description:a="This action cannot be undone.",confirmLabel:n="Confirm",cancelLabel:l="Cancel",variant:i="default"}){const d={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx(br,{open:r,onClose:t,title:s,description:a,size:"sm",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-4",children:[e.jsx("button",{onClick:t,className:"px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-muted transition-colors cursor-pointer",style:d,children:l}),e.jsx("button",{onClick:()=>{o(),t()},className:`px-4 py-2 rounded-[var(--radius-md)] text-primary-foreground transition-colors cursor-pointer ${i==="destructive"?"bg-destructive hover:bg-destructive/90":"bg-primary hover:bg-primary/90"}`,style:d,children:n})]})})}const Wt={sm:{btn:"min-w-[28px] h-7 px-1.5",icon:14,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1"},md:{btn:"min-w-[34px] h-9 px-2",icon:16,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1.5"},lg:{btn:"min-w-[42px] h-11 px-3",icon:18,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},gap:"gap-2"}},Lt={default:{base:"bg-transparent text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},outlined:{base:"bg-transparent text-foreground border border-border",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted hover:border-muted"},filled:{base:"bg-muted/50 text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},minimal:{base:"bg-transparent text-foreground border border-transparent",active:"bg-accent text-accent-foreground border-accent",hover:"hover:text-primary"}};function Mt(r,t,o){return b.useMemo(()=>{if(o*2+5>=t)return Array.from({length:t},(c,h)=>h+1);const a=Math.max(r-o,1),n=Math.min(r+o,t),l=a>2,i=n<t-1;if(!l&&i){const c=3+2*o;return[...Array.from({length:c},(g,x)=>x+1),"dots-right",t]}if(l&&!i){const c=3+2*o;return[1,"dots-left",...Array.from({length:c},(g,x)=>t-c+x+1)]}return[1,"dots-left",...Array.from({length:n-a+1},(c,h)=>a+h),"dots-right",t]},[r,t,o])}function jt({currentPage:r,totalPages:t,onPageChange:o,siblingCount:s=1,showFirstLast:a=!1,showPrevNext:n=!0,showPageSize:l=!1,pageSizeOptions:i=[10,20,50,100],pageSize:d=10,onPageSizeChange:c,totalItems:h,size:g="md",variant:x="default",disabled:f=!1,showPageInfo:p=!1,showItemsInfo:w=!1,prevLabel:u,nextLabel:m}){const F=Mt(r,t,s),y=Wt[g],S=Lt[x],z=b.useCallback(W=>{!f&&W>=1&&W<=t&&o(W)},[f,t,o]),M=(W,P)=>`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all cursor-pointer select-none
54
54
  ${y.btn}
55
55
  ${P?"opacity-40 pointer-events-none cursor-default":""}
56
- ${W?S.active:`${S.base} ${P?"":S.hover}`}`,T=h?(r-1)*d+1:0,E=h?Math.min(r*d,h):0,j={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[w&&h!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:j,children:[T,"–",E," of ",h]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:j,children:"Rows per page:"}),e.jsx("select",{value:d,onChange:W=>c==null?void 0:c(Number(W.target.value)),disabled:f,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:i.map(W=>e.jsx("option",{value:W,children:W},W))})]})]}),e.jsxs("nav",{className:`flex items-center ${y.gap}`,"aria-label":"Pagination",role:"navigation",children:[a&&e.jsx("button",{onClick:()=>z(1),disabled:f||r<=1,className:M(!1,f||r<=1),style:y.text,"aria-label":"First page",title:"First page",children:e.jsx(v.ChevronsLeft,{size:y.icon})}),n&&e.jsx("button",{onClick:()=>z(r-1),disabled:f||r<=1,className:M(!1,f||r<=1),style:y.text,"aria-label":"Previous page",children:u??e.jsx(v.ChevronLeft,{size:y.icon})}),F.map((W,P)=>W==="dots-left"||W==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${y.btn}`,style:y.text,children:e.jsx(v.MoreHorizontal,{size:y.icon})},W):e.jsx("button",{onClick:()=>z(W),disabled:f,className:M(W===r,f),style:y.text,"aria-label":`Page ${W}`,"aria-current":W===r?"page":void 0,children:W},W)),n&&e.jsx("button",{onClick:()=>z(r+1),disabled:f||r>=t,className:M(!1,f||r>=t),style:y.text,"aria-label":"Next page",children:m??e.jsx(v.ChevronRight,{size:y.icon})}),a&&e.jsx("button",{onClick:()=>z(t),disabled:f||r>=t,className:M(!1,f||r>=t),style:y.text,"aria-label":"Last page",title:"Last page",children:e.jsx(v.ChevronsRight,{size:y.icon})})]}),p&&e.jsxs("span",{className:"text-muted-foreground",style:j,children:["Page ",r," of ",t]})]})}const At={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}},Dt={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function Tt({value:r,onChange:t,onSearch:o,placeholder:s="Search...",size:a="md",variant:n="default",loading:l=!1,suggestions:i=[],onSuggestionSelect:d,clearable:c=!0,disabled:h=!1,autoFocus:g=!1,debounce:x=0,className:f=""}){const[p,w]=b.useState(""),[u,m]=b.useState(!1),[F,y]=b.useState(-1),S=r??p,z=b.useRef(null),M=b.useRef(null),T=b.useRef(void 0),E=At[a],j=b.useCallback(C=>{r===void 0&&w(C),t==null||t(C),x>0&&(clearTimeout(T.current),T.current=setTimeout(()=>o==null?void 0:o(C),x))},[r,t,o,x]),W=C=>{C.key==="Enter"?F>=0&&i[F]?(d==null||d(i[F]),m(!1)):o==null||o(S):C.key==="ArrowDown"?(C.preventDefault(),y(A=>Math.min(A+1,i.length-1))):C.key==="ArrowUp"?(C.preventDefault(),y(A=>Math.max(A-1,-1))):C.key==="Escape"&&m(!1)};b.useEffect(()=>{const C=A=>{M.current&&!M.current.contains(A.target)&&m(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]),b.useEffect(()=>{m(i.length>0&&S.length>0),y(-1)},[i,S]);const P={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},L={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:M,className:`relative ${f}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Dt[n]} ${h?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(v.Search,{size:E.icon})}),e.jsx("input",{ref:z,type:"text",value:S,onChange:C=>j(C.target.value),onKeyDown:W,onFocus:()=>i.length>0&&S.length>0&&m(!0),placeholder:s,disabled:h,autoFocus:g,className:`w-full ${E.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:E.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(v.Loader2,{size:E.icon,className:"animate-spin text-muted-foreground"}),c&&S&&!l&&e.jsx("button",{onClick:()=>{var C;j(""),(C=z.current)==null||C.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.X,{size:E.icon})})]})]}),u&&i.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:i.map((C,A)=>e.jsxs("button",{onClick:()=>{d==null||d(C),m(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${A===F?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[C.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:C.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:P,children:C.label}),C.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...L},children:C.description})]})]},C.id))})]})}const ue={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function ur({columns:r,data:t,size:o="md",striped:s=!1,hoverable:a=!0,bordered:n=!1,selectable:l=!1,selectedRows:i,onSelectionChange:d,loading:c=!1,emptyMessage:h="No data available",stickyHeader:g=!1,flush:x=!1,className:f=""}){const[p,w]=b.useState(null),[u,m]=b.useState("asc"),[F,y]=b.useState(new Set),S=i??F,z=A=>{i||y(A),d==null||d(A)},M=b.useMemo(()=>p?[...t].sort((A,_)=>{const K=A[p],Z=_[p];if(K==null)return 1;if(Z==null)return-1;const G=typeof K=="string"?K.localeCompare(Z):K-Z;return u==="asc"?G:-G}):t,[t,p,u]),T=A=>{p===A?m(_=>_==="asc"?"desc":"asc"):(w(A),m("asc"))},E=t.length>0&&S.size===t.length,j=S.size>0&&!E,W=()=>{z(E?new Set:new Set(t.map((A,_)=>_)))},P=A=>{const _=new Set(S);_.has(A)?_.delete(A):_.add(A),z(_)},L={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},C={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${x?"":"rounded-[var(--radius-lg)] border border-border"} overflow-hidden ${f}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:g?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[l&&e.jsx("th",{className:`${ue[o]} w-12`,children:e.jsx(be,{size:"sm",checked:E,indeterminate:j,onChange:W})}),r.map(A=>e.jsx("th",{className:`${ue[o]} text-${A.align??"left"} text-foreground ${A.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...C,width:A.width},onClick:()=>A.sortable&&T(A.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[A.header,A.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:p===A.key?u==="asc"?e.jsx(v.ChevronUp,{size:14}):e.jsx(v.ChevronDown,{size:14}):e.jsx(v.ChevronsUpDown,{size:12})})]})},A.key))]})}),e.jsx("tbody",{children:c?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${ue[o]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:L,children:"Loading..."})]})})}):M.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${ue[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:L,children:h})})}):M.map((A,_)=>{const K=S.has(_);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${K?"bg-primary/5":s&&_%2===1?"bg-muted/20":"bg-card"} ${a?"hover:bg-[var(--row-hover-bg)]":""}`,children:[l&&e.jsx("td",{className:`${ue[o]} w-12`,children:e.jsx(be,{size:"sm",checked:K,onChange:()=>P(_)})}),r.map(Z=>e.jsx("td",{className:`${ue[o]} text-${Z.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:L,children:Z.render?Z.render(A[Z.key],A,_):A[Z.key]},Z.key))]},_)})})]})})})}const It={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",padding:"6px 12px"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",padding:"8px 16px"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",padding:"10px 20px"}};function Et({tabs:r,variant:t="default",size:o="md",defaultTab:s,activeTab:a,onChange:n,fullWidth:l=!1,className:i=""}){var F,y;const[d,c]=b.useState(s??((F=r[0])==null?void 0:F.id)??""),h=a??d,g=b.useRef(null),[x,f]=b.useState({left:0,width:0}),p=S=>{a||c(S),n==null||n(S)};b.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const S=g.current;if(!S)return;const z=S.querySelector(`[data-tab-id="${h}"]`);z&&f({left:z.offsetLeft,width:z.offsetWidth})},[h,t]);const w=(y=r.find(S=>S.id===h))==null?void 0:y.content,u=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),m=(S,z)=>{const M="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(z)return`${M} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${M} rounded-[var(--radius-sm)] ${S?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${M} rounded-[var(--radius)] ${S?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${M} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${M} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:i,children:[e.jsxs("div",{ref:g,className:`flex ${l?"":"inline-flex"} ${u}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:x.left,width:x.width}}),r.map(S=>{const z=h===S.id;return e.jsxs("button",{"data-tab-id":S.id,role:"tab","aria-selected":z,disabled:S.disabled,onClick:()=>!S.disabled&&p(S.id),className:`${m(z,!!S.disabled)} ${l?"flex-1 justify-center":""}`,style:It[o],children:[S.icon&&e.jsx("span",{className:"flex-shrink-0",children:S.icon}),e.jsx("span",{children:S.label}),S.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${z&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"12px",fontWeight:"var(--weight-label)",lineHeight:"1",padding:"1px 6px"},children:S.badge})]},S.id)})]}),w&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:w})]})}const Bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ht={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Ee({title:r,children:t,open:o,onToggle:s,icon:a}){return e.jsxs("div",{className:"border-b border-border last:border-b-0",children:[e.jsxs("button",{onClick:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/20 transition-colors cursor-pointer",children:[a&&e.jsx("span",{className:"text-primary flex-shrink-0",children:a}),e.jsx("span",{className:"flex-1 text-foreground",style:Bt,children:r}),e.jsx(v.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${o?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${o?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Ht,children:t})})]})}function vr({type:r="single",items:t,defaultOpen:o,value:s,onChange:a,className:n=""}){const[l,i]=b.useState(typeof o=="string"?o:null),[d,c]=b.useState(Array.isArray(o)?new Set(o):new Set),h=s!==void 0,g=f=>h?r==="single"?s===f:Array.isArray(s)&&s.includes(f):r==="single"?l===f:d.has(f),x=f=>{if(r==="single"){const p=(h?s===f:l===f)?null:f;h||i(p),a==null||a(p)}else if(h){const p=Array.isArray(s)?s:[],w=p.includes(f)?p.filter(u=>u!==f):[...p,f];a==null||a(w)}else c(p=>{const w=new Set(p);return w.has(f)?w.delete(f):w.add(f),w})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(f=>e.jsx(Ee,{title:f.title,open:g(f.id),onToggle:()=>x(f.id),icon:f.icon,children:f.content},f.id))})}vr.displayName="Accordion",Ee.displayName="AccordionItem";const gr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],_t={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},Yt={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},Xt={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Ot={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function pr({src:r,name:t,size:o="md",status:s,className:a=""}){const n=_t[o],l=t?t.split(" ").map(d=>d[0]).join("").slice(0,2).toUpperCase():"?",i=t?gr[t.length%gr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${a}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover`}):e.jsx("div",{className:`${n.box} rounded-full ${i} text-primary-foreground flex items-center justify-center`,style:n.font,children:l}),s&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Yt[o]} ${Xt[s]} rounded-full border-2 border-card`})]})}function xr({children:r,max:t,className:o=""}){const s=b.Children.toArray(r),a=t?s.slice(0,t):s,n=t&&s.length>t?s.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[a.map((l,i)=>e.jsx("div",{className:"relative",style:{zIndex:a.length-i},children:l},i)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...Ot,zIndex:0},children:["+",n]})]})}pr.displayName="Avatar",xr.displayName="AvatarGroup";const Ut={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Pt({items:r,separator:t="chevron",size:o="md",maxItems:s}){const a=t==="slash"?e.jsx(v.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(v.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(v.ChevronRight,{size:12,className:"text-muted-foreground"}),n=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",l=Ut[o];let i=r;if(s&&r.length>s){const d=r.slice(0,1),c=r.slice(-(s-1));i=[...d,{label:"…"},...c]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:i.map((d,c)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[c>0&&e.jsx("span",{className:"mx-0.5",children:a}),d.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(v.MoreHorizontal,{size:14})}):c===i.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[d.icon,d.label]}):e.jsxs("a",{href:d.href||"#",onClick:h=>h.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[d.icon,d.label]})]},c))})})}const Gt={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function mr({children:r,className:t,hover:o,elevation:s="none"}){return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden ${Gt[s]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}mr.displayName="Card";function yr({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}yr.displayName="CardHeader";function wr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}wr.displayName="CardBody";function Nr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}Nr.displayName="CardFooter";const Kt=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#0ea5e9","#e11d48","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#0369a1","#9f1239","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#bae6fd","#fecdd3"];function Zt(r){const t=parseInt(r.slice(1,3),16),o=parseInt(r.slice(3,5),16),s=parseInt(r.slice(5,7),16);return`rgb(${t}, ${o}, ${s})`}function qt(r){const t=parseInt(r.slice(1,3),16)/255,o=parseInt(r.slice(3,5),16)/255,s=parseInt(r.slice(5,7),16)/255,a=Math.max(t,o,s),n=Math.min(t,o,s),l=(a+n)/2;if(a===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const i=a-n,d=l>.5?i/(2-a-n):i/(a+n);let c=0;return a===t?c=((o-s)/i+(o<s?6:0))/6:a===o?c=((s-t)/i+2)/6:c=((t-o)/i+4)/6,`hsl(${Math.round(c*360)}, ${Math.round(d*100)}%, ${Math.round(l*100)}%)`}const Jt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Qt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Sr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Vt({value:r,onChange:t,label:o,presets:s,showInput:a=!0,showFormats:n,size:l="md"}){const[i,d]=b.useState(!1),c=b.useRef(null),h=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",g=s||Kt,x=f=>{navigator.clipboard.writeText(f).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})};return e.jsxs("div",{className:"space-y-3",children:[o&&e.jsx("label",{className:"block text-foreground",style:Jt,children:o}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var f;return(f=c.current)==null?void 0:f.click()}}),e.jsx("input",{ref:c,type:"color",value:r,onChange:f=>t(f.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),a&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:f=>{(/^#[0-9a-fA-F]{0,6}$/.test(f.target.value)||f.target.value==="#")&&t(f.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:Sr,maxLength:7}),e.jsx("button",{onClick:()=>x(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:i?e.jsx(v.Check,{size:14,className:"text-chart-2"}):e.jsx(v.Copy,{size:14})})]})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(f=>e.jsx("button",{onClick:()=>t(f),className:`${h} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
56
+ ${W?S.active:`${S.base} ${P?"":S.hover}`}`,T=h?(r-1)*d+1:0,E=h?Math.min(r*d,h):0,j={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[w&&h!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:j,children:[T,"–",E," of ",h]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:j,children:"Rows per page:"}),e.jsx("select",{value:d,onChange:W=>c==null?void 0:c(Number(W.target.value)),disabled:f,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:i.map(W=>e.jsx("option",{value:W,children:W},W))})]})]}),e.jsxs("nav",{className:`flex items-center ${y.gap}`,"aria-label":"Pagination",role:"navigation",children:[a&&e.jsx("button",{onClick:()=>z(1),disabled:f||r<=1,className:M(!1,f||r<=1),style:y.text,"aria-label":"First page",title:"First page",children:e.jsx(v.ChevronsLeft,{size:y.icon})}),n&&e.jsx("button",{onClick:()=>z(r-1),disabled:f||r<=1,className:M(!1,f||r<=1),style:y.text,"aria-label":"Previous page",children:u??e.jsx(v.ChevronLeft,{size:y.icon})}),F.map((W,P)=>W==="dots-left"||W==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${y.btn}`,style:y.text,children:e.jsx(v.MoreHorizontal,{size:y.icon})},W):e.jsx("button",{onClick:()=>z(W),disabled:f,className:M(W===r,f),style:y.text,"aria-label":`Page ${W}`,"aria-current":W===r?"page":void 0,children:W},W)),n&&e.jsx("button",{onClick:()=>z(r+1),disabled:f||r>=t,className:M(!1,f||r>=t),style:y.text,"aria-label":"Next page",children:m??e.jsx(v.ChevronRight,{size:y.icon})}),a&&e.jsx("button",{onClick:()=>z(t),disabled:f||r>=t,className:M(!1,f||r>=t),style:y.text,"aria-label":"Last page",title:"Last page",children:e.jsx(v.ChevronsRight,{size:y.icon})})]}),p&&e.jsxs("span",{className:"text-muted-foreground",style:j,children:["Page ",r," of ",t]})]})}const At={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}},Dt={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function Tt({value:r,onChange:t,onSearch:o,placeholder:s="Search...",size:a="md",variant:n="default",loading:l=!1,suggestions:i=[],onSuggestionSelect:d,clearable:c=!0,disabled:h=!1,autoFocus:g=!1,debounce:x=0,className:f=""}){const[p,w]=b.useState(""),[u,m]=b.useState(!1),[F,y]=b.useState(-1),S=r??p,z=b.useRef(null),M=b.useRef(null),T=b.useRef(void 0),E=At[a],j=b.useCallback(C=>{r===void 0&&w(C),t==null||t(C),x>0&&(clearTimeout(T.current),T.current=setTimeout(()=>o==null?void 0:o(C),x))},[r,t,o,x]),W=C=>{C.key==="Enter"?F>=0&&i[F]?(d==null||d(i[F]),m(!1)):o==null||o(S):C.key==="ArrowDown"?(C.preventDefault(),y(A=>Math.min(A+1,i.length-1))):C.key==="ArrowUp"?(C.preventDefault(),y(A=>Math.max(A-1,-1))):C.key==="Escape"&&m(!1)};b.useEffect(()=>{const C=A=>{M.current&&!M.current.contains(A.target)&&m(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]),b.useEffect(()=>{m(i.length>0&&S.length>0),y(-1)},[i,S]);const P={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},L={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:M,className:`relative ${f}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Dt[n]} ${h?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(v.Search,{size:E.icon})}),e.jsx("input",{ref:z,type:"text",value:S,onChange:C=>j(C.target.value),onKeyDown:W,onFocus:()=>i.length>0&&S.length>0&&m(!0),placeholder:s,disabled:h,autoFocus:g,className:`w-full ${E.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:E.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(v.Loader2,{size:E.icon,className:"animate-spin text-muted-foreground"}),c&&S&&!l&&e.jsx("button",{onClick:()=>{var C;j(""),(C=z.current)==null||C.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(v.X,{size:E.icon})})]})]}),u&&i.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:i.map((C,A)=>e.jsxs("button",{onClick:()=>{d==null||d(C),m(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${A===F?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[C.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:C.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:P,children:C.label}),C.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...L},children:C.description})]})]},C.id))})]})}const ue={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function ur({columns:r,data:t,size:o="md",striped:s=!1,hoverable:a=!0,bordered:n=!1,selectable:l=!1,selectedRows:i,onSelectionChange:d,loading:c=!1,emptyMessage:h="No data available",stickyHeader:g=!1,flush:x=!1,className:f=""}){const[p,w]=b.useState(null),[u,m]=b.useState("asc"),[F,y]=b.useState(new Set),S=i??F,z=A=>{i||y(A),d==null||d(A)},M=b.useMemo(()=>p?[...t].sort((A,_)=>{const K=A[p],Z=_[p];if(K==null)return 1;if(Z==null)return-1;const G=typeof K=="string"?K.localeCompare(Z):K-Z;return u==="asc"?G:-G}):t,[t,p,u]),T=A=>{p===A?m(_=>_==="asc"?"desc":"asc"):(w(A),m("asc"))},E=t.length>0&&S.size===t.length,j=S.size>0&&!E,W=()=>{z(E?new Set:new Set(t.map((A,_)=>_)))},P=A=>{const _=new Set(S);_.has(A)?_.delete(A):_.add(A),z(_)},L={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},C={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${x?"":"rounded-[var(--radius-lg)] border border-border"} overflow-hidden ${f}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:g?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[l&&e.jsx("th",{className:`${ue[o]} w-12`,children:e.jsx(be,{size:"sm",checked:E,indeterminate:j,onChange:W})}),r.map(A=>e.jsx("th",{className:`${ue[o]} text-${A.align??"left"} text-foreground ${A.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...C,width:A.width},onClick:()=>A.sortable&&T(A.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[A.header,A.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:p===A.key?u==="asc"?e.jsx(v.ChevronUp,{size:14}):e.jsx(v.ChevronDown,{size:14}):e.jsx(v.ChevronsUpDown,{size:12})})]})},A.key))]})}),e.jsx("tbody",{children:c?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${ue[o]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:L,children:"Loading..."})]})})}):M.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${ue[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:L,children:h})})}):M.map((A,_)=>{const K=S.has(_);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${K?"bg-primary/5":s&&_%2===1?"bg-muted/20":"bg-card"} ${a?"hover:bg-[var(--row-hover-bg)]":""}`,children:[l&&e.jsx("td",{className:`${ue[o]} w-12`,children:e.jsx(be,{size:"sm",checked:K,onChange:()=>P(_)})}),r.map(Z=>e.jsx("td",{className:`${ue[o]} text-${Z.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:L,children:Z.render?Z.render(A[Z.key],A,_):A[Z.key]},Z.key))]},_)})})]})})})}const It={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)",padding:"6px 12px"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",padding:"8px 16px"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-p)",padding:"10px 20px"}};function Et({tabs:r,variant:t="default",size:o="md",defaultTab:s,activeTab:a,onChange:n,fullWidth:l=!1,className:i=""}){var F,y;const[d,c]=b.useState(s??((F=r[0])==null?void 0:F.id)??""),h=a??d,g=b.useRef(null),[x,f]=b.useState({left:0,width:0}),p=S=>{a||c(S),n==null||n(S)};b.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const S=g.current;if(!S)return;const z=S.querySelector(`[data-tab-id="${h}"]`);z&&f({left:z.offsetLeft,width:z.offsetWidth})},[h,t]);const w=(y=r.find(S=>S.id===h))==null?void 0:y.content,u=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),m=(S,z)=>{const M="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(z)return`${M} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${M} rounded-[var(--radius-sm)] ${S?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${M} rounded-[var(--radius)] ${S?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${M} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${M} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:i,children:[e.jsxs("div",{ref:g,className:`flex ${l?"":"inline-flex"} ${u}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:x.left,width:x.width}}),r.map(S=>{const z=h===S.id;return e.jsxs("button",{"data-tab-id":S.id,role:"tab","aria-selected":z,disabled:S.disabled,onClick:()=>!S.disabled&&p(S.id),className:`${m(z,!!S.disabled)} ${l?"flex-1 justify-center":""}`,style:It[o],children:[S.icon&&e.jsx("span",{className:"flex-shrink-0",children:S.icon}),e.jsx("span",{children:S.label}),S.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${z&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)",lineHeight:"1",padding:"1px 6px"},children:S.badge})]},S.id)})]}),w&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:w})]})}const Bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ht={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Ee({title:r,children:t,open:o,onToggle:s,icon:a}){return e.jsxs("div",{className:"border-b border-border last:border-b-0",children:[e.jsxs("button",{onClick:s,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/20 transition-colors cursor-pointer",children:[a&&e.jsx("span",{className:"text-primary flex-shrink-0",children:a}),e.jsx("span",{className:"flex-1 text-foreground",style:Bt,children:r}),e.jsx(v.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${o?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${o?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Ht,children:t})})]})}function vr({type:r="single",items:t,defaultOpen:o,value:s,onChange:a,className:n=""}){const[l,i]=b.useState(typeof o=="string"?o:null),[d,c]=b.useState(Array.isArray(o)?new Set(o):new Set),h=s!==void 0,g=f=>h?r==="single"?s===f:Array.isArray(s)&&s.includes(f):r==="single"?l===f:d.has(f),x=f=>{if(r==="single"){const p=(h?s===f:l===f)?null:f;h||i(p),a==null||a(p)}else if(h){const p=Array.isArray(s)?s:[],w=p.includes(f)?p.filter(u=>u!==f):[...p,f];a==null||a(w)}else c(p=>{const w=new Set(p);return w.has(f)?w.delete(f):w.add(f),w})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(f=>e.jsx(Ee,{title:f.title,open:g(f.id),onToggle:()=>x(f.id),icon:f.icon,children:f.content},f.id))})}vr.displayName="Accordion",Ee.displayName="AccordionItem";const gr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],_t={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},Yt={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},Xt={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Ot={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function pr({src:r,name:t,size:o="md",status:s,className:a=""}){const n=_t[o],l=t?t.split(" ").map(d=>d[0]).join("").slice(0,2).toUpperCase():"?",i=t?gr[t.length%gr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${a}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover`}):e.jsx("div",{className:`${n.box} rounded-full ${i} text-primary-foreground flex items-center justify-center`,style:n.font,children:l}),s&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Yt[o]} ${Xt[s]} rounded-full border-2 border-card`})]})}function xr({children:r,max:t,className:o=""}){const s=b.Children.toArray(r),a=t?s.slice(0,t):s,n=t&&s.length>t?s.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[a.map((l,i)=>e.jsx("div",{className:"relative",style:{zIndex:a.length-i},children:l},i)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...Ot,zIndex:0},children:["+",n]})]})}pr.displayName="Avatar",xr.displayName="AvatarGroup";const Ut={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Pt({items:r,separator:t="chevron",size:o="md",maxItems:s}){const a=t==="slash"?e.jsx(v.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(v.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(v.ChevronRight,{size:12,className:"text-muted-foreground"}),n=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",l=Ut[o];let i=r;if(s&&r.length>s){const d=r.slice(0,1),c=r.slice(-(s-1));i=[...d,{label:"…"},...c]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:i.map((d,c)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[c>0&&e.jsx("span",{className:"mx-0.5",children:a}),d.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(v.MoreHorizontal,{size:14})}):c===i.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[d.icon,d.label]}):e.jsxs("a",{href:d.href||"#",onClick:h=>h.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[d.icon,d.label]})]},c))})})}const Gt={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function mr({children:r,className:t,hover:o,elevation:s="none"}){return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden ${Gt[s]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}mr.displayName="Card";function yr({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}yr.displayName="CardHeader";function wr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}wr.displayName="CardBody";function Nr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}Nr.displayName="CardFooter";const Kt=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#0ea5e9","#e11d48","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#0369a1","#9f1239","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#bae6fd","#fecdd3"];function Zt(r){const t=parseInt(r.slice(1,3),16),o=parseInt(r.slice(3,5),16),s=parseInt(r.slice(5,7),16);return`rgb(${t}, ${o}, ${s})`}function qt(r){const t=parseInt(r.slice(1,3),16)/255,o=parseInt(r.slice(3,5),16)/255,s=parseInt(r.slice(5,7),16)/255,a=Math.max(t,o,s),n=Math.min(t,o,s),l=(a+n)/2;if(a===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const i=a-n,d=l>.5?i/(2-a-n):i/(a+n);let c=0;return a===t?c=((o-s)/i+(o<s?6:0))/6:a===o?c=((s-t)/i+2)/6:c=((t-o)/i+4)/6,`hsl(${Math.round(c*360)}, ${Math.round(d*100)}%, ${Math.round(l*100)}%)`}const Jt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Qt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Sr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Vt({value:r,onChange:t,label:o,presets:s,showInput:a=!0,showFormats:n,size:l="md"}){const[i,d]=b.useState(!1),c=b.useRef(null),h=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",g=s||Kt,x=f=>{navigator.clipboard.writeText(f).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})};return e.jsxs("div",{className:"space-y-3",children:[o&&e.jsx("label",{className:"block text-foreground",style:Jt,children:o}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var f;return(f=c.current)==null?void 0:f.click()}}),e.jsx("input",{ref:c,type:"color",value:r,onChange:f=>t(f.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),a&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:f=>{(/^#[0-9a-fA-F]{0,6}$/.test(f.target.value)||f.target.value==="#")&&t(f.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:Sr,maxLength:7}),e.jsx("button",{onClick:()=>x(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:i?e.jsx(v.Check,{size:14,className:"text-chart-2"}):e.jsx(v.Copy,{size:14})})]})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(f=>e.jsx("button",{onClick:()=>t(f),className:`${h} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
57
57
  ${r===f?"border-foreground ring-1 ring-foreground/20":"border-transparent"}`,style:{backgroundColor:f},title:f},f))}),n&&e.jsx("div",{className:"space-y-1",children:[{label:"HEX",val:r.toUpperCase()},{label:"RGB",val:Zt(r)},{label:"HSL",val:qt(r)}].map(f=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-8 text-muted-foreground",style:Qt,children:f.label}),e.jsx("code",{className:"text-foreground",style:Sr,children:f.val}),e.jsx("button",{onClick:()=>x(f.val),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.Copy,{size:12})})]},f.label))})]})}const Rt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function kr({label:r,orientation:t="horizontal",dashed:o,spacing:s="md",className:a=""}){const n={sm:"my-2",md:"my-4",lg:"my-8"},l=o?"border-dashed":"border-solid";return t==="vertical"?e.jsx("div",{className:`inline-block h-full min-h-[24px] border-l border-border ${l} mx-3 ${a}`}):r?e.jsxs("div",{className:`flex items-center gap-3 ${n[s]} ${a}`,children:[e.jsx("div",{className:`flex-1 border-t border-border ${l}`}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0",style:Rt,children:r}),e.jsx("div",{className:`flex-1 border-t border-border ${l}`})]}):e.jsx("hr",{className:`border-t border-border ${l} ${n[s]} ${a}`})}kr.displayName="Divider";const eo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function $r({open:r,onClose:t,title:o,children:s,side:a="right",size:n="md",footer:l,className:i=""}){if(!r)return null;const d={sm:"w-72",md:"w-96",lg:"w-[480px]"},c={sm:"h-48",md:"h-72",lg:"h-96"},h={right:`top-0 right-0 h-full ${d[n]} animate-[slideRight_0.2s_ease]`,left:`top-0 left-0 h-full ${d[n]} animate-[slideLeft_0.2s_ease]`,top:`top-0 left-0 w-full ${c[n]} animate-[slideTop_0.2s_ease]`,bottom:`bottom-0 left-0 w-full ${c[n]} animate-[slideBottom_0.2s_ease]`};return e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/20",onClick:t}),e.jsxs("div",{className:`absolute bg-card border border-border shadow-elevation-sm flex flex-col ${h[a]} ${i}`,children:[o&&e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between flex-shrink-0",children:[e.jsx("span",{className:"text-foreground",style:eo,children:o}),e.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:s}),l&&e.jsx("div",{className:"px-5 py-3 border-t border-border flex items-center gap-2 flex-shrink-0",children:l})]}),e.jsx("style",{children:`
58
58
  @keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
59
59
  @keyframes slideLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@@ -83,7 +83,7 @@
83
83
  ${s?"opacity-50 pointer-events-none":""}
84
84
  ${f?"border-primary bg-primary/5":"border-border hover:border-primary/40 hover:bg-accent/30"}`,children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(v.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:ze,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:Cr,children:[l||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${Wr(t)}`]})]})]}),e.jsx("input",{ref:w,type:"file",className:"hidden",accept:r,multiple:o,onChange:y=>m(y.target.files)}),u.length>0&&e.jsx(Lr,{files:u,onRemove:F})]})}const fo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ho={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function bo({images:r,initialIndex:t=0}){const[o,s]=b.useState(!1),[a,n]=b.useState(t),[l,i]=b.useState(1),[d,c]=b.useState(0),h=r[a],g=()=>{n(u=>(u-1+r.length)%r.length),i(1),c(0)},x=()=>{n(u=>(u+1)%r.length),i(1),c(0)},f=()=>i(u=>Math.min(u+.25,3)),p=()=>i(u=>Math.max(u-.25,.5)),w=()=>c(u=>(u+90)%360);return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((u,m)=>e.jsx("button",{onClick:()=>{n(m),s(!0),i(1),c(0)},className:`rounded-[var(--radius-md)] overflow-hidden border-2 transition-all cursor-pointer hover:opacity-80
85
85
  ${a===m&&o?"border-primary":"border-border"}`,children:e.jsx("div",{className:"w-20 h-20 bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:u.thumbnail||u.src,alt:u.alt,className:"w-full h-full object-cover",loading:"lazy"})})},m))}),o&&e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Image preview: ${h.alt}`,className:"fixed inset-0 z-[60] bg-foreground/80 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-foreground/20",children:[e.jsxs("span",{className:"text-primary-foreground",style:fo,children:[h.alt," (",a+1,"/",r.length,")"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:p,"aria-label":"Zoom out",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.ZoomOut,{size:16})}),e.jsxs("span",{className:"text-primary-foreground/70 px-2",style:ho,"aria-live":"polite","aria-label":`Zoom level ${Math.round(l*100)}%`,children:[Math.round(l*100),"%"]}),e.jsx("button",{onClick:f,"aria-label":"Zoom in",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.ZoomIn,{size:16})}),e.jsx("button",{onClick:w,"aria-label":"Rotate clockwise",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.RotateCw,{size:16})}),e.jsx("div",{className:"w-px h-5 bg-primary-foreground/20 mx-1"}),e.jsx("button",{onClick:()=>{s(!1),i(1),c(0)},"aria-label":"Close preview",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(v.X,{size:16})})]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",onClick:u=>{u.target===u.currentTarget&&(s(!1),i(1),c(0))},children:[r.length>1&&e.jsx("button",{onClick:g,"aria-label":"Previous image",className:"absolute left-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(v.ChevronLeft,{size:20})}),e.jsx("img",{src:h.src,alt:h.alt,className:"max-w-[90%] max-h-[80vh] object-contain transition-transform",style:{transform:`scale(${l}) rotate(${d}deg)`}}),r.length>1&&e.jsx("button",{onClick:x,"aria-label":"Next image",className:"absolute right-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(v.ChevronRight,{size:20})})]}),r.length>1&&e.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-foreground/20",children:r.map((u,m)=>e.jsx("button",{onClick:()=>{n(m),i(1),c(0)},className:`w-12 h-12 rounded-[var(--radius-sm)] overflow-hidden border-2 cursor-pointer transition-all
86
- ${m===a?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:u.thumbnail||u.src,alt:u.alt,className:"w-full h-full object-cover"})},m))})]})]})}const uo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},vo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function po({items:r,parentRect:t}){const o=b.useRef(null),[s,a]=b.useState({top:t.top,left:t.right+4});return b.useEffect(()=>{if(!o.current)return;const l=o.current.getBoundingClientRect();let i=t.top,d=t.right+4;d+l.width>window.innerWidth-8&&(d=t.left-l.width-4),i+l.height>window.innerHeight-8&&(i=window.innerHeight-l.height-8),a({top:i,left:d})},[t]),Se.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:s.top,left:s.left},children:r.map((n,l)=>e.jsx(Mr,{item:n},l))}),document.body)}function Mr({item:r}){const[t,o]=b.useState(!1),s=b.useRef(null),a=b.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:go,children:r.label});const n=r.children&&r.children.length>0,l=()=>{a.current&&clearTimeout(a.current),n&&o(!0)},i=()=>{a.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:s,className:"relative",onMouseEnter:l,onMouseLeave:i,children:[e.jsxs("button",{onClick:()=>{var d;n||(d=r.onClick)==null||d.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...uo},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:vo,children:r.shortcut}),n&&e.jsx(v.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&s.current&&e.jsx(po,{items:r.children,parentRect:s.current.getBoundingClientRect()})]})}function jr({items:r,open:t,onClose:o,triggerRef:s,className:a=""}){const n=b.useRef(null),[l,i]=b.useState({top:0,left:0});return b.useEffect(()=>{if(!t||!s.current)return;const d=s.current.getBoundingClientRect();let c=d.bottom+4,h=d.left;requestAnimationFrame(()=>{if(!n.current)return;const g=n.current.getBoundingClientRect();h+g.width>window.innerWidth-8&&(h=d.right-g.width),c+g.height>window.innerHeight-8&&(c=d.top-g.height-4),i({top:c,left:h})}),i({top:c,left:h})},[t,s]),b.useEffect(()=>{if(!t)return;const d=c=>{var h,g;(h=s.current)!=null&&h.contains(c.target)||(g=n.current)!=null&&g.contains(c.target)||o()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t,o,s]),t?Se.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${a}`,style:{top:l.top,left:l.left},children:[r.map((d,c)=>e.jsx(Mr,{item:d},c)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}jr.displayName="Menu";const Ar={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Be={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Fe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Dr({type:r="info",title:t,message:o,closable:s=!0,onClose:a,action:n,avatar:l,time:i,read:d}){const c={info:e.jsx(v.Info,{size:16,className:"text-primary"}),success:e.jsx(v.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(v.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(v.XCircle,{size:16,className:"text-destructive"})},h={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${h[r]} ${d===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:Be,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:c[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:Be,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[i&&e.jsx("span",{className:"text-muted-foreground",style:xo,children:i}),d===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),s&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Ar,children:o}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:Fe,children:[n.label," ",e.jsx(v.ExternalLink,{size:12})]})]})]})}function mo({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:s,onClearAll:a}){const[n,l]=b.useState(r),i=t!==void 0||o!==void 0,d=i?r:n,c=d.filter(f=>!f.read).length,h=()=>{o&&o(),i||l(f=>f.map(p=>({...p,read:!0})))},g=f=>{s&&s(f),i||l(p=>p.filter(w=>w.id!==f))},x=f=>{t&&t(f),i||l(p=>p.map(w=>w.id===f?{...w,read:!0}:w))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:Be,children:"Notifications"}),c>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:Fe,children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx("button",{onClick:h,className:"text-primary cursor-pointer",style:Fe,children:"Mark all read"}),d.length>0&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:Fe,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:d.map(f=>e.jsx("div",{className:`px-3 py-2 ${f.read?"":"bg-primary/5"}`,onClick:()=>!f.read&&x(f.id),children:e.jsx(Dr,{type:f.type,title:f.title,message:f.message,time:f.time,read:f.read,closable:!!s,onClose:()=>g(f.id)})},f.id))}),d.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(v.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:Ar,children:"No notifications"})]})]})}const yo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function wo({trigger:r,children:t,placement:o="bottom",title:s,open:a,onOpenChange:n}){const[l,i]=b.useState(!1),d=a!==void 0?a:l,c=x=>{n==null||n(x),a===void 0&&i(x)},h=b.useRef(null);b.useEffect(()=>{if(!d)return;const x=f=>{h.current&&!h.current.contains(f.target)&&c(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[d]);const g={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:h,children:[e.jsx("div",{onClick:()=>c(!d),className:"cursor-pointer",children:r}),d&&e.jsx("div",{className:`absolute z-50 ${g[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[s&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:yo,children:s}),e.jsx("button",{onClick:()=>c(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const No={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},So={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Tr({value:r,max:t=100,size:o="md",color:s,label:a,showValue:n,indeterminate:l,className:i=""}){const d={sm:"h-1.5",md:"h-2.5",lg:"h-4"},c=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${i}`,children:[(a||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a&&e.jsx("span",{className:"text-foreground",style:No,children:a}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:So,children:[Math.round(c),"%"]})]}),e.jsx("div",{className:`w-full ${d[o]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:s??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,backgroundColor:s??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}Tr.displayName="ProgressBar";const ko={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},$o={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function zo({value:r=0,onChange:t,max:o=5,size:s="md",disabled:a,readOnly:n,icon:l="star",showValue:i,label:d}){const[c,h]=b.useState(0),g=s==="sm"?16:s==="lg"?28:20,x=s==="sm"?"gap-0.5":s==="lg"?"gap-1.5":"gap-1",f=l==="heart"?v.Heart:l==="thumb"?v.ThumbsUp:v.Star,p=l==="heart"?"text-destructive":"text-chart-5",w=Array.from({length:o},(u,m)=>m+1);return e.jsxs("div",{className:`inline-flex items-center ${x} ${a?"opacity-50 pointer-events-none":""}`,children:[d&&e.jsx("span",{className:"text-foreground mr-2",style:ko,children:d}),w.map(u=>{const m=u<=(c||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||a?"":"cursor-pointer hover:scale-110"} ${m?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!a&&h(u),onMouseLeave:()=>h(0),onClick:()=>!n&&!a&&(t==null?void 0:t(u===r?0:u)),disabled:a||n,children:e.jsx(f,{size:g,fill:m?"currentColor":"none"})},u)}),i&&e.jsxs("span",{className:"text-foreground ml-1",style:$o,children:[r,"/",o]})]})}const Fo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function He({children:r,content:t,placement:o="top",className:s=""}){const[a,n]=b.useState(!1),[l,i]=b.useState({top:0,left:0}),d=b.useRef(null),c=()=>{if(!d.current)return;const p=d.current.getBoundingClientRect(),w=8;let u=0,m=0;o==="right"?(u=p.top+p.height/2,m=p.right+w):o==="left"?(u=p.top+p.height/2,m=p.left-w):o==="bottom"?(u=p.bottom+w,m=p.left+p.width/2):(u=p.top-w,m=p.left+p.width/2),i({top:u,left:m})},h=()=>{c(),n(!0)},g=()=>n(!1);b.useEffect(()=>{if(!a)return;const p=()=>c();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]);const x=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},f=a?e.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,zIndex:9999,pointerEvents:"none",...x},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Fo,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:d,className:`relative inline-flex ${s}`,onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,children:r}),typeof document<"u"&&Se.createPortal(f,document.body)]})}He.displayName="Tooltip";const Ir={fontFamily:"var(--font-label)",fontSize:"18px",fontWeight:"500",lineHeight:"1"},Co={fontFamily:"var(--font-label)",fontSize:"14px",fontWeight:"var(--weight-label)",lineHeight:"1"},Wo={fontFamily:"var(--font-label)",fontSize:"14px",fontWeight:"var(--weight-label)",lineHeight:"1"};function _e({item:r,size:t=40}){const o=t+"px",s=Math.round(t*.4)+"px";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const a=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:s,fontWeight:"600",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:a})}function Ye({company:r,branch:t,provider:o,companies:s=[],branches:a=[],providers:n=[],onCompanyChange:l,onBranchChange:i,onProviderChange:d,collapsed:c=!1}){const[h,g]=b.useState(!1),x=b.useRef(null);b.useEffect(()=>{if(!h)return;const u=m=>{x.current&&!x.current.contains(m.target)&&g(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[h]);const f=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),w=u=>{l==null||l(u),g(!1)};return c?e.jsx("button",{onClick:()=>g(!h),title:(f==null?void 0:f.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f?e.jsx(_e,{item:f,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"14px",fontWeight:"600"},children:"S"})}):e.jsxs("div",{ref:x,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>g(!h),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[f?e.jsx(_e,{item:f,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"16px",fontWeight:"600",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...Ir,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(f==null?void 0:f.name)??"Select Company"}),p&&e.jsx("span",{style:{...Co,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(v.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:h?"rotate(0deg)":"rotate(180deg)"}})]}),h&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:s.map(u=>{const m=(r==null?void 0:r.id)===u.id;return e.jsxs("button",{onClick:()=>w(u),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:m?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{m||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=m?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(_e,{item:u,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...Ir,fontSize:"16px",color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name}),u.handle&&e.jsx("div",{style:{...Wo,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:u.handle})]}),m&&e.jsx(v.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},u.id)})})})]})}Ye.displayName="SidebarAccountSwitcher";const Lo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Mo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},jo={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ao={fontFamily:"var(--font-label)",fontSize:"16px",fontWeight:"var(--weight-label)"},Do={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Er({brand:r,accountSwitcher:t,groups:o,activeItem:s,onNavigate:a,collapsed:n=!1,onCollapsedChange:l,showCollapseToggle:i=!0,version:d,versionDate:c,className:h=""}){const[g,x]=b.useState(new Set),f=p=>{x(w=>{const u=new Set(w);return u.has(p)?u.delete(p):u.add(p),u})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 ${h}`,style:{width:n?"64px":"256px",minWidth:n?"64px":"256px",transition:"width 0.25s cubic-bezier(0.4,0,0.2,1), min-width 0.25s cubic-bezier(0.4,0,0.2,1)",overflow:"visible"},children:[t?e.jsx("div",{className:`${n?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${n?"justify-center":""}`,children:e.jsx(Ye,{...t,collapsed:n})}):r&&e.jsxs("div",{className:`${n?"px-2":"px-4"} py-4 border-b border-sidebar-border flex items-center ${n?"justify-center":"gap-2"}`,children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:jo,children:r.name.charAt(0).toUpperCase()}),!n&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:Lo,children:r.name})]}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${n?"px-1.5":"px-2"}`,children:o.map(p=>{const w=g.has(p.label);return e.jsxs("div",{className:"mb-4",children:[!n&&e.jsxs("button",{onClick:()=>f(p.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:Ao,children:[e.jsx("span",{children:p.label}),e.jsx(v.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:w?"rotate(180deg)":"rotate(0deg)"}})]}),n&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!w&&e.jsx("div",{className:"space-y-0.5",children:p.items.map(u=>{const m=s===u.id,F=e.jsxs("button",{onClick:()=>a==null?void 0:a(u),className:`w-full flex items-center ${n?"justify-center":"gap-2"} ${n?"px-0":"px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${m?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Mo,children:[e.jsx("span",{className:`flex-shrink-0 ${m?"text-sidebar-primary":"text-muted-foreground"}`,children:u.icon}),!n&&e.jsx("span",{className:"truncate flex-1 text-left",children:u.label}),!n&&u.badge&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-badge)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:u.badge})]},u.id);return n?e.jsx("div",{className:"w-full flex",children:e.jsx(He,{content:u.label,placement:"right",className:"flex-1",children:F})},u.id):F})})]},p.label)})}),(i&&l||d)&&e.jsxs("div",{className:`${n?"px-1.5":"px-3"} py-3 border-t border-sidebar-border flex flex-col gap-1`,children:[i&&l&&e.jsxs("button",{onClick:()=>l(!n),className:`w-full flex items-center ${n?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Do,title:n?"Expand sidebar":"Collapse sidebar",children:[n?e.jsx(v.PanelLeftOpen,{size:16}):e.jsx(v.PanelLeftClose,{size:16}),!n&&e.jsx("span",{children:"Collapse"})]}),d&&!n&&e.jsxs("div",{className:"px-2 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"12px",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:d}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:c})]})]}),d&&n&&e.jsx("div",{className:"flex justify-center text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"10px",fontWeight:"var(--weight-label)"},title:`${d}${c?` · ${c}`:""}`,children:d})]})]})}Er.displayName="Sidebar";function Q({width:r,height:t,variant:o="rectangular",animate:s=!0,className:a}){const n="bg-muted",l=s?"animate-pulse":"",i=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${i} ${a??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function To(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(Q,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{variant:"text",width:"60%",height:20}),e.jsx(Q,{variant:"text",width:"100%",height:14}),e.jsx(Q,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Q,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:"40%",height:14}),e.jsx(Q,{variant:"text",width:"25%",height:12})]})]})]})}function Io(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(Q,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(Q,{variant:"circular",width:28,height:28}),e.jsx(Q,{variant:"text",width:100+r*15,height:14}),e.jsx(Q,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(Q,{variant:"rounded",width:60,height:22}),e.jsx(Q,{variant:"text",width:80,height:14})]},r))]})}function Eo(){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:[0,1,2].map(r=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(Q,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:`${60+r*10}%`,height:14}),e.jsx(Q,{variant:"text",width:`${40+r*5}%`,height:12})]}),e.jsx(Q,{variant:"rounded",width:50,height:24})]},r))})}const Bo={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function Br({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Bo[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}Br.displayName="Spinner";const Xe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_r={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ho={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function _o({title:r,value:t,prefix:o,suffix:s,trend:a,trendLabel:n,icon:l,size:i="md",loading:d}){const c=Ho[i],h=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",g=(a==null?void 0:a.direction)==="up"?v.ArrowUpRight:(a==null?void 0:a.direction)==="down"?v.ArrowDownRight:v.Minus;return d?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:Xe,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:Hr,children:o}),e.jsx("span",{className:"text-foreground",style:c,children:typeof t=="number"?t.toLocaleString():t}),s&&e.jsx("span",{className:"text-muted-foreground",style:Xe,children:s})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${h}`,children:[e.jsx(g,{size:14}),e.jsxs("span",{style:Yr,children:[a.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:_r,children:n})]})]})}function Yo({title:r,value:t,prefix:o,trend:s,trendLabel:a,icon:n,iconBg:l}){const i=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",d=(s==null?void 0:s.direction)==="up"?v.ArrowUpRight:(s==null?void 0:s.direction)==="down"?v.ArrowDownRight:v.Minus;return e.jsx("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:Xe,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:Hr,children:o}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${i}`,children:[e.jsx(d,{size:12}),e.jsxs("span",{style:Yr,children:[s.value,"%"]}),a&&e.jsx("span",{className:"text-muted-foreground",style:_r,children:a})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const Xo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Xr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Or={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ur={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Pr({steps:r,current:t,orientation:o="horizontal",onStepClick:s,className:a=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:"flex gap-3",onClick:()=>s==null?void 0:s(l),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${s?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Ur,children:i?e.jsx(v.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${i?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${d?"text-foreground":"text-muted-foreground"}`,style:d?Xr:Xo,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:Or,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>s==null?void 0:s(l),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${s?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Ur,children:i?e.jsx(v.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${d?"text-foreground":"text-muted-foreground"}`,style:d?Xr:Or,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${i?"bg-primary":"bg-border"}`})]},l)})})}Pr.displayName="Stepper";const Oo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Uo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Po={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Go={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ko={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Zo({checked:r,onChange:t,label:o,description:s,size:a="md",disabled:n,color:l="primary"}){const i=Po[a],d=Ko[a];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${i.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Go[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:d.w,height:d.h,top:"50%",transform:`translateY(-50%) translateX(${r?d.on:2}px)`,left:0}})}),(o||s)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Oo,children:o}),s&&e.jsx("span",{className:"text-muted-foreground block",style:Uo,children:s})]})]})}const qo={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Jo={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qo={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function Gr({children:r,color:t="default",size:o="md",icon:s,closable:a,onClose:n,className:l=""}){const i=qo[t],d=Jo[o],c=Qo[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${i} ${d} ${l}`,style:c,children:[s&&e.jsx("span",{className:"flex-shrink-0",children:s}),r,a&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(v.X,{size:o==="sm"?10:12})})]})}Gr.displayName="Tag";const Vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ro={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function Kr({tags:r,onChange:t,placeholder:o,disabled:s,maxTags:a,variant:n="default",className:l=""}){const[i,d]=b.useState(""),c=()=>{const g=i.trim();!g||r.includes(g)||a&&r.length>=a||(t([...r,g]),d(""))},h=g=>{t(r.filter(x=>x!==g))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[n]} transition-colors focus-within:border-primary ${s?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(g=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:Ro,children:[g,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>h(g),children:e.jsx(v.X,{size:12})})]},g)),e.jsx("input",{value:i,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),c()),g.key==="Backspace"&&!i&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Vo,disabled:s})]})}Kr.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Zr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Oe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const s=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",a=o==="sm"?12:o==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-primary-foreground":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${s} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:a}):e.jsx(v.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:Zr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Oe,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Oe,children:l.description})]})]},i))}):e.jsx("div",{className:"relative",children:r.map((l,i)=>{const d=t==="alternate"&&i%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${d?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${s} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:a}):e.jsx(v.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${d?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${d?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Zr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Oe,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},i)})})}const ye={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function qr({brand:r,breadcrumbs:t,title:o,actions:s,user:a,height:n="72px",showSearch:l=!1,searchPlaceholder:i="Search... (Ctrl+K)",onSearchClick:d,notificationCount:c,onNotificationClick:h,onMobileMenuClick:g,onSidebarToggle:x,onUserClick:f,onBreadcrumbClick:p,className:w=""}){const u=a!=null&&a.name?a.name.split(" ").map(m=>m[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${w}`,style:{height:n},children:[x&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:x,title:"Toggle sidebar",children:e.jsx(v.Menu,{size:18})}),!x&&g&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:g,children:e.jsx(v.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ye,children:r.name.charAt(0).toUpperCase()})}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:ye,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:ye,children:t.map((m,F)=>e.jsxs(b.Fragment,{children:[F>0&&e.jsx(v.ChevronRight,{size:12}),m.href||p?e.jsx("span",{className:`cursor-pointer ${F===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>p==null?void 0:p(m,F),children:m.label}):e.jsx("span",{className:F===t.length-1?"text-foreground":"",children:m.label})]},F))}),e.jsx("div",{className:"flex-1"}),l&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:d,children:[e.jsx(v.Search,{size:14}),e.jsx("span",{style:ye,children:i})]}),s,h&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:h,children:[e.jsx(v.Bell,{size:16}),c!==void 0&&c>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),a&&e.jsx("div",{className:"cursor-pointer",onClick:f,children:a.avatar?e.jsx("img",{src:a.avatar,alt:a.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:ye,children:u})})]})}qr.displayName="TopNavbar";const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ss={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ue={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Jr({title:r,items:t,selected:o,onToggle:s,search:a,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:ss,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:Ue,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(v.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:a,onChange:i=>n(i.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Ue})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:Ue,children:"No items"}),t.map(i=>e.jsxs("button",{onClick:()=>!i.disabled&&s(i.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
86
+ ${m===a?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:u.thumbnail||u.src,alt:u.alt,className:"w-full h-full object-cover"})},m))})]})]})}const uo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},vo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function po({items:r,parentRect:t}){const o=b.useRef(null),[s,a]=b.useState({top:t.top,left:t.right+4});return b.useEffect(()=>{if(!o.current)return;const l=o.current.getBoundingClientRect();let i=t.top,d=t.right+4;d+l.width>window.innerWidth-8&&(d=t.left-l.width-4),i+l.height>window.innerHeight-8&&(i=window.innerHeight-l.height-8),a({top:i,left:d})},[t]),Se.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:s.top,left:s.left},children:r.map((n,l)=>e.jsx(Mr,{item:n},l))}),document.body)}function Mr({item:r}){const[t,o]=b.useState(!1),s=b.useRef(null),a=b.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:go,children:r.label});const n=r.children&&r.children.length>0,l=()=>{a.current&&clearTimeout(a.current),n&&o(!0)},i=()=>{a.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:s,className:"relative",onMouseEnter:l,onMouseLeave:i,children:[e.jsxs("button",{onClick:()=>{var d;n||(d=r.onClick)==null||d.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...uo},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:vo,children:r.shortcut}),n&&e.jsx(v.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&s.current&&e.jsx(po,{items:r.children,parentRect:s.current.getBoundingClientRect()})]})}function jr({items:r,open:t,onClose:o,triggerRef:s,className:a=""}){const n=b.useRef(null),[l,i]=b.useState({top:0,left:0});return b.useEffect(()=>{if(!t||!s.current)return;const d=s.current.getBoundingClientRect();let c=d.bottom+4,h=d.left;requestAnimationFrame(()=>{if(!n.current)return;const g=n.current.getBoundingClientRect();h+g.width>window.innerWidth-8&&(h=d.right-g.width),c+g.height>window.innerHeight-8&&(c=d.top-g.height-4),i({top:c,left:h})}),i({top:c,left:h})},[t,s]),b.useEffect(()=>{if(!t)return;const d=c=>{var h,g;(h=s.current)!=null&&h.contains(c.target)||(g=n.current)!=null&&g.contains(c.target)||o()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t,o,s]),t?Se.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${a}`,style:{top:l.top,left:l.left},children:[r.map((d,c)=>e.jsx(Mr,{item:d},c)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}jr.displayName="Menu";const Ar={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Be={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Fe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Dr({type:r="info",title:t,message:o,closable:s=!0,onClose:a,action:n,avatar:l,time:i,read:d}){const c={info:e.jsx(v.Info,{size:16,className:"text-primary"}),success:e.jsx(v.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(v.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(v.XCircle,{size:16,className:"text-destructive"})},h={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${h[r]} ${d===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:Be,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:c[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:Be,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[i&&e.jsx("span",{className:"text-muted-foreground",style:xo,children:i}),d===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),s&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Ar,children:o}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:Fe,children:[n.label," ",e.jsx(v.ExternalLink,{size:12})]})]})]})}function mo({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:s,onClearAll:a}){const[n,l]=b.useState(r),i=t!==void 0||o!==void 0,d=i?r:n,c=d.filter(f=>!f.read).length,h=()=>{o&&o(),i||l(f=>f.map(p=>({...p,read:!0})))},g=f=>{s&&s(f),i||l(p=>p.filter(w=>w.id!==f))},x=f=>{t&&t(f),i||l(p=>p.map(w=>w.id===f?{...w,read:!0}:w))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:Be,children:"Notifications"}),c>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:Fe,children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx("button",{onClick:h,className:"text-primary cursor-pointer",style:Fe,children:"Mark all read"}),d.length>0&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:Fe,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:d.map(f=>e.jsx("div",{className:`px-3 py-2 ${f.read?"":"bg-primary/5"}`,onClick:()=>!f.read&&x(f.id),children:e.jsx(Dr,{type:f.type,title:f.title,message:f.message,time:f.time,read:f.read,closable:!!s,onClose:()=>g(f.id)})},f.id))}),d.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(v.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:Ar,children:"No notifications"})]})]})}const yo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function wo({trigger:r,children:t,placement:o="bottom",title:s,open:a,onOpenChange:n}){const[l,i]=b.useState(!1),d=a!==void 0?a:l,c=x=>{n==null||n(x),a===void 0&&i(x)},h=b.useRef(null);b.useEffect(()=>{if(!d)return;const x=f=>{h.current&&!h.current.contains(f.target)&&c(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[d]);const g={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:h,children:[e.jsx("div",{onClick:()=>c(!d),className:"cursor-pointer",children:r}),d&&e.jsx("div",{className:`absolute z-50 ${g[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[s&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:yo,children:s}),e.jsx("button",{onClick:()=>c(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(v.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const No={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},So={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Tr({value:r,max:t=100,size:o="md",color:s,label:a,showValue:n,indeterminate:l,className:i=""}){const d={sm:"h-1.5",md:"h-2.5",lg:"h-4"},c=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${i}`,children:[(a||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a&&e.jsx("span",{className:"text-foreground",style:No,children:a}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:So,children:[Math.round(c),"%"]})]}),e.jsx("div",{className:`w-full ${d[o]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:s??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,backgroundColor:s??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}Tr.displayName="ProgressBar";const ko={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},$o={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function zo({value:r=0,onChange:t,max:o=5,size:s="md",disabled:a,readOnly:n,icon:l="star",showValue:i,label:d}){const[c,h]=b.useState(0),g=s==="sm"?16:s==="lg"?28:20,x=s==="sm"?"gap-0.5":s==="lg"?"gap-1.5":"gap-1",f=l==="heart"?v.Heart:l==="thumb"?v.ThumbsUp:v.Star,p=l==="heart"?"text-destructive":"text-chart-5",w=Array.from({length:o},(u,m)=>m+1);return e.jsxs("div",{className:`inline-flex items-center ${x} ${a?"opacity-50 pointer-events-none":""}`,children:[d&&e.jsx("span",{className:"text-foreground mr-2",style:ko,children:d}),w.map(u=>{const m=u<=(c||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||a?"":"cursor-pointer hover:scale-110"} ${m?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!a&&h(u),onMouseLeave:()=>h(0),onClick:()=>!n&&!a&&(t==null?void 0:t(u===r?0:u)),disabled:a||n,children:e.jsx(f,{size:g,fill:m?"currentColor":"none"})},u)}),i&&e.jsxs("span",{className:"text-foreground ml-1",style:$o,children:[r,"/",o]})]})}const Fo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function He({children:r,content:t,placement:o="top",className:s=""}){const[a,n]=b.useState(!1),[l,i]=b.useState({top:0,left:0}),d=b.useRef(null),c=()=>{if(!d.current)return;const p=d.current.getBoundingClientRect(),w=8;let u=0,m=0;o==="right"?(u=p.top+p.height/2,m=p.right+w):o==="left"?(u=p.top+p.height/2,m=p.left-w):o==="bottom"?(u=p.bottom+w,m=p.left+p.width/2):(u=p.top-w,m=p.left+p.width/2),i({top:u,left:m})},h=()=>{c(),n(!0)},g=()=>n(!1);b.useEffect(()=>{if(!a)return;const p=()=>c();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]);const x=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},f=a?e.jsx("div",{style:{position:"fixed",top:l.top,left:l.left,zIndex:9999,pointerEvents:"none",...x},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Fo,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:d,className:`relative inline-flex ${s}`,onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,children:r}),typeof document<"u"&&Se.createPortal(f,document.body)]})}He.displayName="Tooltip";const Ir={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},Co={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},Wo={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function _e({item:r,size:t=40}){const o=t+"px",s=Math.round(t*.4)+"px";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const a=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:s,fontWeight:"600",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:a})}function Ye({company:r,branch:t,provider:o,companies:s=[],branches:a=[],providers:n=[],onCompanyChange:l,onBranchChange:i,onProviderChange:d,collapsed:c=!1}){const[h,g]=b.useState(!1),x=b.useRef(null);b.useEffect(()=>{if(!h)return;const u=m=>{x.current&&!x.current.contains(m.target)&&g(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[h]);const f=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),w=u=>{l==null||l(u),g(!1)};return c?e.jsx("button",{onClick:()=>g(!h),title:(f==null?void 0:f.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f?e.jsx(_e,{item:f,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"14px",fontWeight:"600"},children:"S"})}):e.jsxs("div",{ref:x,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>g(!h),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[f?e.jsx(_e,{item:f,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"16px",fontWeight:"600",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...Ir,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(f==null?void 0:f.name)??"Select Company"}),p&&e.jsx("span",{style:{...Co,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(v.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:h?"rotate(0deg)":"rotate(180deg)"}})]}),h&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:s.map(u=>{const m=(r==null?void 0:r.id)===u.id;return e.jsxs("button",{onClick:()=>w(u),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:m?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{m||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=m?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(_e,{item:u,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...Ir,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name}),u.handle&&e.jsx("div",{style:{...Wo,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:u.handle})]}),m&&e.jsx(v.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},u.id)})})})]})}Ye.displayName="SidebarAccountSwitcher";const Lo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Mo={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},jo={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ao={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Do={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Er({brand:r,accountSwitcher:t,groups:o,activeItem:s,onNavigate:a,collapsed:n=!1,onCollapsedChange:l,showCollapseToggle:i=!0,version:d,versionDate:c,className:h=""}){const[g,x]=b.useState(new Set),f=p=>{x(w=>{const u=new Set(w);return u.has(p)?u.delete(p):u.add(p),u})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 ${h}`,style:{width:n?"64px":"256px",minWidth:n?"64px":"256px",transition:"width 0.25s cubic-bezier(0.4,0,0.2,1), min-width 0.25s cubic-bezier(0.4,0,0.2,1)",overflow:"visible"},children:[t?e.jsx("div",{className:`${n?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${n?"justify-center":""}`,children:e.jsx(Ye,{...t,collapsed:n})}):r&&e.jsxs("div",{className:`${n?"px-2":"px-4"} py-4 border-b border-sidebar-border flex items-center ${n?"justify-center":"gap-2"}`,children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:jo,children:r.name.charAt(0).toUpperCase()}),!n&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:Lo,children:r.name})]}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${n?"px-1.5":"px-2"}`,children:o.map(p=>{const w=g.has(p.label);return e.jsxs("div",{className:"mb-4",children:[!n&&e.jsxs("button",{onClick:()=>f(p.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:Ao,children:[e.jsx("span",{children:p.label}),e.jsx(v.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:w?"rotate(180deg)":"rotate(0deg)"}})]}),n&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!w&&e.jsx("div",{className:"space-y-0.5",children:p.items.map(u=>{const m=s===u.id,F=e.jsxs("button",{onClick:()=>a==null?void 0:a(u),className:`w-full flex items-center ${n?"justify-center":"gap-2"} ${n?"px-0":"px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${m?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Mo,children:[e.jsx("span",{className:`flex-shrink-0 ${m?"text-sidebar-primary":"text-muted-foreground"}`,children:u.icon}),!n&&e.jsx("span",{className:"truncate flex-1 text-left",children:u.label}),!n&&u.badge&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-badge)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:u.badge})]},u.id);return n?e.jsx("div",{className:"w-full flex",children:e.jsx(He,{content:u.label,placement:"right",className:"flex-1",children:F})},u.id):F})})]},p.label)})}),(i&&l||d)&&e.jsxs("div",{className:`${n?"px-1.5":"px-3"} py-3 border-t border-sidebar-border flex flex-col gap-1`,children:[i&&l&&e.jsxs("button",{onClick:()=>l(!n),className:`w-full flex items-center ${n?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Do,title:n?"Expand sidebar":"Collapse sidebar",children:[n?e.jsx(v.PanelLeftOpen,{size:16}):e.jsx(v.PanelLeftClose,{size:16}),!n&&e.jsx("span",{children:"Collapse"})]}),d&&!n&&e.jsxs("div",{className:"px-2 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:d}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:c})]})]}),d&&n&&e.jsx("div",{className:"flex justify-center text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${d}${c?` · ${c}`:""}`,children:d})]})]})}Er.displayName="Sidebar";function Q({width:r,height:t,variant:o="rectangular",animate:s=!0,className:a}){const n="bg-muted",l=s?"animate-pulse":"",i=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${i} ${a??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function To(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(Q,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{variant:"text",width:"60%",height:20}),e.jsx(Q,{variant:"text",width:"100%",height:14}),e.jsx(Q,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Q,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:"40%",height:14}),e.jsx(Q,{variant:"text",width:"25%",height:12})]})]})]})}function Io(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(Q,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(Q,{variant:"circular",width:28,height:28}),e.jsx(Q,{variant:"text",width:100+r*15,height:14}),e.jsx(Q,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(Q,{variant:"rounded",width:60,height:22}),e.jsx(Q,{variant:"text",width:80,height:14})]},r))]})}function Eo(){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:[0,1,2].map(r=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(Q,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:`${60+r*10}%`,height:14}),e.jsx(Q,{variant:"text",width:`${40+r*5}%`,height:12})]}),e.jsx(Q,{variant:"rounded",width:50,height:24})]},r))})}const Bo={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function Br({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Bo[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}Br.displayName="Spinner";const Xe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_r={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ho={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function _o({title:r,value:t,prefix:o,suffix:s,trend:a,trendLabel:n,icon:l,size:i="md",loading:d}){const c=Ho[i],h=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",g=(a==null?void 0:a.direction)==="up"?v.ArrowUpRight:(a==null?void 0:a.direction)==="down"?v.ArrowDownRight:v.Minus;return d?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:Xe,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:Hr,children:o}),e.jsx("span",{className:"text-foreground",style:c,children:typeof t=="number"?t.toLocaleString():t}),s&&e.jsx("span",{className:"text-muted-foreground",style:Xe,children:s})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${h}`,children:[e.jsx(g,{size:14}),e.jsxs("span",{style:Yr,children:[a.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:_r,children:n})]})]})}function Yo({title:r,value:t,prefix:o,trend:s,trendLabel:a,icon:n,iconBg:l}){const i=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",d=(s==null?void 0:s.direction)==="up"?v.ArrowUpRight:(s==null?void 0:s.direction)==="down"?v.ArrowDownRight:v.Minus;return e.jsx("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:Xe,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:Hr,children:o}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${i}`,children:[e.jsx(d,{size:12}),e.jsxs("span",{style:Yr,children:[s.value,"%"]}),a&&e.jsx("span",{className:"text-muted-foreground",style:_r,children:a})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const Xo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Xr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Or={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ur={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Pr({steps:r,current:t,orientation:o="horizontal",onStepClick:s,className:a=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:"flex gap-3",onClick:()=>s==null?void 0:s(l),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${s?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Ur,children:i?e.jsx(v.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${i?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${d?"text-foreground":"text-muted-foreground"}`,style:d?Xr:Xo,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:Or,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>s==null?void 0:s(l),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${s?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Ur,children:i?e.jsx(v.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${d?"text-foreground":"text-muted-foreground"}`,style:d?Xr:Or,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${i?"bg-primary":"bg-border"}`})]},l)})})}Pr.displayName="Stepper";const Oo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Uo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Po={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Go={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ko={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Zo({checked:r,onChange:t,label:o,description:s,size:a="md",disabled:n,color:l="primary"}){const i=Po[a],d=Ko[a];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${i.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Go[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:d.w,height:d.h,top:"50%",transform:`translateY(-50%) translateX(${r?d.on:2}px)`,left:0}})}),(o||s)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Oo,children:o}),s&&e.jsx("span",{className:"text-muted-foreground block",style:Uo,children:s})]})]})}const qo={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Jo={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qo={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function Gr({children:r,color:t="default",size:o="md",icon:s,closable:a,onClose:n,className:l=""}){const i=qo[t],d=Jo[o],c=Qo[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${i} ${d} ${l}`,style:c,children:[s&&e.jsx("span",{className:"flex-shrink-0",children:s}),r,a&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(v.X,{size:o==="sm"?10:12})})]})}Gr.displayName="Tag";const Vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ro={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function Kr({tags:r,onChange:t,placeholder:o,disabled:s,maxTags:a,variant:n="default",className:l=""}){const[i,d]=b.useState(""),c=()=>{const g=i.trim();!g||r.includes(g)||a&&r.length>=a||(t([...r,g]),d(""))},h=g=>{t(r.filter(x=>x!==g))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[n]} transition-colors focus-within:border-primary ${s?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(g=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:Ro,children:[g,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>h(g),children:e.jsx(v.X,{size:12})})]},g)),e.jsx("input",{value:i,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),c()),g.key==="Backspace"&&!i&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Vo,disabled:s})]})}Kr.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Zr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Oe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const s=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",a=o==="sm"?12:o==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-primary-foreground":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${s} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:a}):e.jsx(v.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:Zr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Oe,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Oe,children:l.description})]})]},i))}):e.jsx("div",{className:"relative",children:r.map((l,i)=>{const d=t==="alternate"&&i%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${d?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${s} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(v.CheckCircle2,{size:a}):e.jsx(v.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${d?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${d?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Zr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Oe,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},i)})})}const ye={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function qr({brand:r,breadcrumbs:t,title:o,actions:s,user:a,height:n="72px",showSearch:l=!1,searchPlaceholder:i="Search... (Ctrl+K)",onSearchClick:d,notificationCount:c,onNotificationClick:h,onMobileMenuClick:g,onSidebarToggle:x,onUserClick:f,onBreadcrumbClick:p,className:w=""}){const u=a!=null&&a.name?a.name.split(" ").map(m=>m[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${w}`,style:{height:n},children:[x&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:x,title:"Toggle sidebar",children:e.jsx(v.Menu,{size:18})}),!x&&g&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:g,children:e.jsx(v.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ye,children:r.name.charAt(0).toUpperCase()})}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:ye,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:ye,children:t.map((m,F)=>e.jsxs(b.Fragment,{children:[F>0&&e.jsx(v.ChevronRight,{size:12}),m.href||p?e.jsx("span",{className:`cursor-pointer ${F===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>p==null?void 0:p(m,F),children:m.label}):e.jsx("span",{className:F===t.length-1?"text-foreground":"",children:m.label})]},F))}),e.jsx("div",{className:"flex-1"}),l&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:d,children:[e.jsx(v.Search,{size:14}),e.jsx("span",{style:ye,children:i})]}),s,h&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:h,children:[e.jsx(v.Bell,{size:16}),c!==void 0&&c>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),a&&e.jsx("div",{className:"cursor-pointer",onClick:f,children:a.avatar?e.jsx("img",{src:a.avatar,alt:a.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:ye,children:u})})]})}qr.displayName="TopNavbar";const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ss={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ue={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Jr({title:r,items:t,selected:o,onToggle:s,search:a,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:ss,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:Ue,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(v.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:a,onChange:i=>n(i.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Ue})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:Ue,children:"No items"}),t.map(i=>e.jsxs("button",{onClick:()=>!i.disabled&&s(i.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
87
87
  ${o.has(i.id)?"bg-primary/10":"hover:bg-accent"}
88
88
  ${i.disabled?"opacity-40 pointer-events-none":""}`,style:os,children:[e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0
89
89
  ${o.has(i.id)?"bg-primary border-primary":"border-border"}`,children:o.has(i.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:i.label})]},i.id))]})]})}function as({sourceTitle:r="Available",targetTitle:t="Selected",items:o,defaultTarget:s=[],searchable:a,value:n,onChange:l}){const[i,d]=b.useState(new Set(s)),c=n!==void 0?new Set(n):i,h=L=>{l&&l(Array.from(L)),n===void 0&&d(L)},[g,x]=b.useState(new Set),[f,p]=b.useState(new Set),[w,u]=b.useState(""),[m,F]=b.useState(""),y=o.filter(L=>!c.has(L.id)),S=o.filter(L=>c.has(L.id)),z=w?y.filter(L=>L.label.toLowerCase().includes(w.toLowerCase())):y,M=m?S.filter(L=>L.label.toLowerCase().includes(m.toLowerCase())):S,T=()=>{const L=new Set(c);g.forEach(C=>L.add(C)),h(L),x(new Set)},E=()=>{const L=new Set(c);f.forEach(C=>L.delete(C)),h(L),p(new Set)},j=()=>{h(new Set(o.filter(L=>!L.disabled).map(L=>L.id))),x(new Set)},W=()=>{h(new Set),p(new Set)},P=(L,C,A)=>{const _=new Set(C);_.has(L)?_.delete(L):_.add(L),A(_)};return e.jsxs("div",{className:"flex items-stretch gap-3 flex-wrap",children:[e.jsx(Jr,{title:r,items:z,selected:g,onToggle:L=>P(L,g,x),search:w,onSearch:u,searchable:a}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1.5 py-4",children:[e.jsx("button",{onClick:j,disabled:y.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronsRight,{size:14})}),e.jsx("button",{onClick:T,disabled:g.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronRight,{size:14})}),e.jsx("button",{onClick:E,disabled:f.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronLeft,{size:14})}),e.jsx("button",{onClick:W,disabled:S.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(v.ChevronsLeft,{size:14})})]}),e.jsx(Jr,{title:t,items:M,selected:f,onToggle:L=>P(L,f,p),search:m,onSearch:F,searchable:a})]})}const ns={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Qr({node:r,level:t,expanded:o,selected:s,onToggle:a,onSelect:n,selectable:l,showLines:i}){const d=r.children&&r.children.length>0,c=o.has(r.id),h=s.has(r.id),g=d?c?e.jsx(v.FolderOpen,{size:14,className:"text-chart-5"}):e.jsx(v.Folder,{size:14,className:"text-chart-5"}):e.jsx(v.File,{size:14,className:"text-muted-foreground"});return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1.5 py-1 px-2 rounded-[var(--radius-sm)] transition-colors
@@ -91,5 +91,5 @@
91
91
  ${h?"bg-primary/10 text-primary":"text-foreground"}`,style:{paddingLeft:`${t*20+8}px`,...ns},onClick:()=>{d&&a(r.id),l&&n(r.id)},children:[d?e.jsx("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:c?e.jsx(v.ChevronDown,{size:12}):e.jsx(v.ChevronRight,{size:12})}):e.jsx("span",{className:"w-4"}),l&&e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0 ${h?"bg-primary border-primary":"border-border"}`,children:h&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"flex-shrink-0",children:r.icon||g}),e.jsx("span",{className:"truncate",children:r.label})]}),d&&c&&e.jsx("div",{className:i?"border-l border-border ml-[22px]":"",children:r.children.map(x=>e.jsx(Qr,{node:x,level:t+1,expanded:o,selected:s,onToggle:a,onSelect:n,selectable:l,showLines:i},x.id))})]})}function ls({data:r,selectable:t,showLines:o,defaultExpanded:s,expandedItems:a,onExpandChange:n,selectedItems:l,onSelect:i}){const[d,c]=b.useState(new Set(s||[])),[h,g]=b.useState(new Set),x=a!==void 0?new Set(a):d,f=l!==void 0?new Set(l):h,p=u=>{const m=new Set(x);m.has(u)?m.delete(u):m.add(u),n&&n(Array.from(m)),a===void 0&&c(m)},w=u=>{const m=new Set(f);m.has(u)?m.delete(u):m.add(u),i&&i(Array.from(m)),l===void 0&&g(m)};return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-1",children:r.map(u=>e.jsx(Qr,{node:u,level:0,expanded:x,selected:f,onToggle:p,onSelect:w,selectable:t,showLines:o},u.id))})}const is={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Pe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Vr=b.createContext({name:""});function ds(){return b.useContext(Vr)}function Ge({htmlFor:r,required:t,children:o,className:s=""}){return e.jsxs("label",{htmlFor:r,className:`block text-foreground mb-1.5 ${s}`,style:is,children:[o,t&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]})}function Rr({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-destructive ${t}`,style:Pe,role:"alert",children:[e.jsx(v.AlertCircle,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function et({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-chart-2 ${t}`,style:Pe,role:"status",children:[e.jsx(v.CheckCircle2,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function rt({children:r,className:t=""}){return e.jsx("p",{className:`mt-1.5 text-muted-foreground ${t}`,style:Pe,children:r})}function cs({name:r,label:t,required:o,error:s,successMessage:a,helperText:n,layout:l="vertical",labelWidth:i="160px",children:d,className:c=""}){const h=l==="horizontal",g=s?e.jsx(Rr,{message:s}):a?e.jsx(et,{message:a}):n?e.jsx(rt,{children:n}):null;return e.jsx(Vr.Provider,{value:{name:r,error:s},children:h?e.jsxs("div",{className:`flex items-start gap-4 ${c}`,children:[t&&e.jsx("div",{style:{width:i,flexShrink:0,paddingTop:"6px"},children:e.jsx(Ge,{htmlFor:r,required:o,children:t})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[d,g]})]}):e.jsxs("div",{className:`${c}`,children:[t&&e.jsx(Ge,{htmlFor:r,required:o,children:t}),d,g]})})}const fs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},hs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},bs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},us={sm:"h-8",md:"h-10",lg:"h-12"},tt={sm:14,md:16,lg:18};function vs({value:r,defaultValue:t=0,onChange:o,min:s,max:a,step:n=1,disabled:l,size:i="md",label:d,placeholder:c,error:h,className:g=""}){const[x,f]=b.useState(t),p=r??x,w=F=>{const y=Math.max(s??-1/0,Math.min(a??1/0,F));o&&o(y),r===void 0&&f(y)},u=s===void 0||p-n>=s,m=a===void 0||p+n<=a;return e.jsxs("div",{className:g,children:[d&&e.jsx("label",{className:"block text-foreground mb-1.5",style:fs,children:d}),e.jsxs("div",{className:`inline-flex items-center rounded-[var(--radius-md)] border ${h?"border-destructive":"border-border"} bg-background overflow-hidden ${l?"opacity-50 pointer-events-none":""}`,children:[e.jsx("button",{type:"button",onClick:()=>w(p-n),disabled:l||!u,className:"flex items-center justify-center px-2.5 border-r border-border text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(v.Minus,{size:tt[i]})}),e.jsx("input",{type:"number",value:p,placeholder:c,onChange:F=>{const y=parseFloat(F.target.value);isNaN(y)||w(y)},disabled:l,className:`w-20 text-center bg-transparent outline-none text-foreground ${us[i]} [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,style:hs}),e.jsx("button",{type:"button",onClick:()=>w(p+n),disabled:l||!m,className:"flex items-center justify-center px-2.5 border-l border-border text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(v.Plus,{size:tt[i]})})]}),h&&e.jsx("p",{className:"mt-1.5 text-destructive",style:bs,children:h})]})}const gs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ps={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},xs={sm:"w-9 h-9",md:"w-11 h-11",lg:"w-14 h-14"};function ms({length:r=6,value:t,onChange:o,onComplete:s,disabled:a,error:n,size:l="md",label:i,masked:d,className:c=""}){const[h,g]=b.useState(()=>"".padEnd(r,"")),x=b.useRef([]),p=(t??h).padEnd(r,"").split("").slice(0,r),w=b.useCallback(y=>{o&&o(y),t===void 0&&g(y),y.replace(/ /g,"").length===r&&s&&s(y)},[o,s,t,r]),u=(y,S)=>{var T;if(!/^\d$/.test(S))return;const z=p.slice();z[y]=S;const M=z.join("");w(M),y<r-1&&((T=x.current[y+1])==null||T.focus())},m=(y,S)=>{var z,M,T;if(S.key==="Backspace"){S.preventDefault();const E=p.slice();E[y]!==" "&&E[y]!==""?(E[y]=" ",w(E.join(""))):y>0&&(E[y-1]=" ",w(E.join("")),(z=x.current[y-1])==null||z.focus())}else S.key==="ArrowLeft"&&y>0?(M=x.current[y-1])==null||M.focus():S.key==="ArrowRight"&&y<r-1&&((T=x.current[y+1])==null||T.focus())},F=y=>{var z;y.preventDefault();const S=y.clipboardData.getData("text").replace(/\D/g,"").slice(0,r);if(S){w(S.padEnd(r," "));const M=Math.min(S.length,r-1);(z=x.current[M])==null||z.focus()}};return e.jsxs("div",{className:c,children:[i&&e.jsx("label",{className:"block text-foreground mb-2",style:gs,children:i}),e.jsx("div",{className:"flex gap-2",onPaste:F,children:p.map((y,S)=>e.jsx("input",{ref:z=>{x.current[S]=z},type:d?"password":"text",inputMode:"numeric",maxLength:1,value:y===" "?"":y,disabled:a,onChange:z=>{const M=z.target.value;M&&u(S,M[M.length-1])},onKeyDown:z=>m(S,z),onFocus:z=>z.target.select(),className:`${xs[l]} text-center rounded-[var(--radius-md)] border outline-none transition-all
92
92
  ${n?"border-destructive focus:ring-2 focus:ring-destructive/30":"border-border focus:border-primary focus:ring-2 focus:ring-primary/20"}
93
93
  ${a?"opacity-50 pointer-events-none bg-muted":"bg-background"}
94
- text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},S))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:ps,children:n})]})}const ys={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},ws={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 24px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},Ns={fontFamily:"var(--font-caption, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-caption, 20px)"};function Ss({title:r,subtitle:t,breadcrumb:o,actions:s,tabs:a,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-background border-b border-border ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:Ns,children:o}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:ys,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:ws,children:t})]}),s&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:s})]})]}),a&&e.jsx("div",{className:"px-6",children:a})]})}const ks={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ce={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function $s({config:r,value:t,onChange:o}){var c;const[s,a]=b.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,i=b.useCallback(h=>{if(r.type==="single"){const g=n[0]===h?null:h;o(r.key,g),a(!1)}else{const g=n.includes(h)?n.filter(x=>x!==h):[...n,h];o(r.key,g.length?g:null)}},[r,n,o]),d=n.length===1?(c=r.options.find(h=>h.value===n[0]))==null?void 0:c.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(h=>!h),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:ks,children:[d,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground text-[10px] font-bold",children:n.length}),e.jsx(v.ChevronDown,{size:14,className:`transition-transform ${s?"rotate-180":""}`})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm min-w-[160px] py-1 overflow-hidden",children:r.options.map(h=>{const g=n.includes(h.value);return e.jsxs("button",{type:"button",onClick:()=>i(h.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${g?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ce,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${g?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:g&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),h.label]},h.value)})})]})]})}function zs({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:s,onFilterChange:a,className:n=""}){const[l,i]=b.useState({search:"",filters:{}}),d=s??l,c=b.useCallback(w=>{i(w),a==null||a(w)},[a]),h=b.useCallback(w=>{c({...d,search:w.target.value})},[d,c]),g=b.useCallback((w,u)=>{c({...d,filters:{...d.filters,[w]:u}})},[d,c]),x=b.useCallback(()=>{c({search:"",filters:{}})},[c]),f=Object.values(d.filters).filter(w=>w!==null&&(!Array.isArray(w)||w.length>0)).length,p=f>0||d.search&&d.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background)] border border-[var(--border)] rounded-lg px-3 py-2 ${n}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(v.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:d.search??"",onChange:h,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] placeholder:text-[var(--muted-foreground)] focus:outline-none focus:border-[var(--primary)] focus:ring-1 focus:ring-[var(--primary)] transition-colors min-w-[200px]",style:Ce})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(v.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(w=>e.jsx($s,{config:w,value:d.filters[w.key]??null,onChange:g},w.key)),f>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary)]/10 text-[var(--primary)]",style:Ce,children:[f," active"]}),p&&e.jsxs("button",{type:"button",onClick:x,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] transition-colors cursor-pointer ml-auto",style:Ce,children:[e.jsx(v.X,{size:12}),"Clear all"]})]})}const ot={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ke={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ce={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},oe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Fs({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function Cs({columns:r,hidden:t,onToggle:o}){const[s,a]=b.useState(!1),n=b.useRef(null);b.useEffect(()=>{function i(d){n.current&&!n.current.contains(d.target)&&a(!1)}return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);const l=r.filter(i=>i.hideable!==!1);return e.jsxs("div",{ref:n,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(i=>!i),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--muted-foreground)] hover:bg-[var(--muted)] hover:text-[var(--foreground)] transition-colors cursor-pointer",style:ce,children:[e.jsx(v.Columns3,{size:14}),"Columns"]}),s&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm w-44 py-1",children:l.map(i=>{const d=!t.has(i.key);return e.jsxs("button",{type:"button",onClick:()=>o(i.key),className:"w-full flex items-center justify-between gap-2 px-3 py-2 hover:bg-[var(--muted)] text-[var(--foreground)] transition-colors cursor-pointer",style:ce,children:[e.jsx("span",{children:i.header}),d&&e.jsx(v.Check,{size:13,className:"text-[var(--primary)]"})]},i.key)})})]})}function Ws({count:r,actions:t,selectedKeys:o,onClear:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-[var(--primary)]/8 border-b border-[var(--primary)]/20",children:[e.jsxs("span",{className:"text-[var(--primary)] flex-shrink-0",style:ot,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((a,n)=>e.jsxs("button",{type:"button",onClick:()=>a.onClick(o),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${a.variant==="destructive"?"border-[var(--destructive)] text-[var(--destructive)] hover:bg-[var(--destructive)]/10":"border-[var(--primary)] text-[var(--primary)] hover:bg-[var(--primary)]/10"}`,style:{...ce,fontWeight:500},children:[a.icon,a.label]},n))}),e.jsx("button",{type:"button",onClick:s,className:"text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(v.X,{size:14})})]})}const Ls=[10,20,50,100];function Ms({meta:r,onPageChange:t}){const{page:o,pageSize:s,totalCount:a}=r,n=Math.max(1,Math.ceil(a/s)),l=a===0?0:(o-1)*s+1,i=Math.min(o*s,a),d=b.useMemo(()=>{const c=[];if(n<=7)for(let h=1;h<=n;h++)c.push(h);else{c.push(1),o>3&&c.push("...");for(let h=Math.max(2,o-1);h<=Math.min(n-1,o+1);h++)c.push(h);o<n-2&&c.push("..."),c.push(n)}return c},[o,n]);return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[var(--border)] flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[var(--muted-foreground)] whitespace-nowrap",style:ce,children:[l,"–",i," of ",a.toLocaleString()]}),e.jsx("select",{value:s,onChange:c=>t(1,Number(c.target.value)),className:"h-7 px-2 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] focus:outline-none focus:border-[var(--primary)] cursor-pointer",style:ce,children:Ls.map(c=>e.jsxs("option",{value:c,children:[c," / page"]},c))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ze,{disabled:o===1,onClick:()=>t(o-1,s),label:"‹ Prev"}),d.map((c,h)=>c==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ce,children:"…"},`ellipsis-${h}`):e.jsx(Ze,{active:c===o,onClick:()=>t(c,s),label:String(c)},c)),e.jsx(Ze,{disabled:o===n,onClick:()=>t(o+1,s),label:"Next ›"})]})]})}function Ze({label:r,active:t,disabled:o,onClick:s}){return e.jsx("button",{type:"button",onClick:s,disabled:o,className:`min-w-[28px] h-7 px-2 rounded-md border transition-colors cursor-pointer ${t?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":o?"border-transparent text-[var(--muted-foreground)] cursor-not-allowed":"border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:{...ce,fontWeight:t?600:400},children:r})}function js({columns:r,data:t,rowKey:o="id",pagination:s,sortBy:a,sortOrder:n,onPageChange:l,onSortChange:i,selectable:d=!1,selectedRows:c,onSelectionChange:h,bulkActions:g=[],onRowClick:x,expandedRowRender:f,loading:p=!1,loadingRows:w=5,error:u,emptyMessage:m="No data found",emptyDescription:F,showColumnToggle:y=!1,size:S="md",stickyHeader:z=!1,className:M=""}){const[T,E]=b.useState(new Set(r.filter($=>$.defaultHidden).map($=>$.key))),j=b.useCallback($=>{E(O=>{const Y=new Set(O);return Y.has($)?Y.delete($):Y.add($),Y})},[]),W=b.useMemo(()=>r.filter($=>!T.has($.key)),[r,T]),[P,L]=b.useState(new Set),C=c??P,A=b.useCallback($=>{c||L($);const O=t.filter(Y=>$.has(Y[o]));h==null||h($,O)},[c,t,o,h]),_=b.useMemo(()=>t.map($=>$[o]),[t,o]),K=_.length>0&&_.every($=>C.has($)),Z=C.size>0&&!K,G=b.useCallback(()=>{A(K?new Set:new Set(_))},[K,_,A]),R=b.useCallback($=>{const O=new Set(C);O.has($)?O.delete($):O.add($),A(O)},[C,A]),[q,se]=b.useState(new Set),re=b.useCallback($=>{se(O=>{const Y=new Set(O);return Y.has($)?Y.delete($):Y.add($),Y})},[]),ae=b.useCallback($=>{i&&(a===$?i($,n==="asc"?"desc":"asc"):i($,"asc"))},[a,n,i]),ne=b.useMemo(()=>{const $={};let O=0;d&&(O+=48),f&&(O+=40);for(const Y of W)if(Y.frozen){$[Y.key]=O;const ee=typeof Y.width=="number"?Y.width:parseInt(Y.width??"120");O+=isNaN(ee)?120:ee}return $},[W,d,f]),le=W.length+(d?1:0)+(f?1:0),X="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-lg)] border border-[var(--border)] overflow-hidden ${M}`,children:[y&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-2.5 border-b border-[var(--border)] bg-[var(--background)]",children:e.jsx(Cs,{columns:r,hidden:T,onToggle:j})}),d&&C.size>0&&g.length>0&&e.jsx(Ws,{count:C.size,actions:g,selectedKeys:Array.from(C),onClear:()=>A(new Set)}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:"100%"},children:[e.jsx("thead",{className:z?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[f&&e.jsx("th",{className:`${oe[S]} w-10`}),d&&e.jsx("th",{className:`${oe[S]} w-12`,children:e.jsx(be,{size:"sm",checked:K,indeterminate:Z&&!K,onChange:G})}),W.map($=>{const O=$.frozen&&$.key in ne,Y=a===$.key;return e.jsx("th",{className:`${oe[S]} text-${$.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${$.sortable&&i?"cursor-pointer hover:text-[var(--primary)]":""} ${O?X:""}`,style:{...ot,width:$.width,minWidth:$.minWidth??80,...O?{left:ne[$.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>$.sortable&&ae($.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[$.header,$.sortable&&i&&e.jsx("span",{className:Y?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:Y?n==="asc"?e.jsx(v.ChevronUp,{size:13}):e.jsx(v.ChevronDown,{size:13}):e.jsx(v.ChevronsUpDown,{size:12})})]})},$.key)})]})}),e.jsxs("tbody",{children:[u&&e.jsx("tr",{children:e.jsx("td",{colSpan:le,className:`${oe[S]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(v.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:Ke,children:u})]})})}),!u&&p&&Array.from({length:w}).map(($,O)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[f&&e.jsx("td",{className:`${oe[S]} w-10`}),d&&e.jsx("td",{className:`${oe[S]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),W.map(Y=>e.jsx("td",{className:`${oe[S]}`,children:e.jsx(Fs,{width:Y.align==="right"?"60%":Y.align==="center"?"50%":"75%"})},Y.key))]},`skel-${O}`)),!u&&!p&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:le,className:`${oe[S]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[var(--muted)] flex items-center justify-center text-[var(--muted-foreground)]",children:e.jsx(v.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:Ke,children:m}),F&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ce,children:F})]})})}),!u&&!p&&t.map(($,O)=>{const Y=$[o],ee=C.has(Y),de=q.has(Y),we=!!x||!!f;return e.jsxs(b.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${ee?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${we?"cursor-pointer":""}`,onClick:()=>{x==null||x($),f&&re(Y)},children:[f&&e.jsx("td",{className:`${oe[S]} w-10 text-center`,onClick:B=>{B.stopPropagation(),re(Y)},children:e.jsx(v.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${de?"rotate-90":""}`})}),d&&e.jsx("td",{className:`${oe[S]} w-12`,onClick:B=>B.stopPropagation(),children:e.jsx(be,{size:"sm",checked:ee,onChange:()=>R(Y)})}),W.map(B=>{const fe=B.frozen&&B.key in ne,Ne=fe?ee?"sticky z-[1] bg-primary/5":"sticky z-[1] bg-[var(--card)] group-hover/row:bg-[var(--row-hover-bg)] transition-colors":"";return e.jsx("td",{className:`${oe[S]} text-${B.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...Ke,...fe?{left:ne[B.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:B.render?B.render($[B.key],$,O):$[B.key]},B.key)})]}),f&&de&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:le,className:"px-6 py-4",children:f($)})})]},Y??O)})]})]})}),s&&l&&!p&&!u&&e.jsx(Ms,{meta:s,onPageChange:l})]})}k.Accordion=vr,k.AccordionItem=Ee,k.AdvancedDataTable=js,k.Alert=ar,k.Avatar=pr,k.AvatarGroup=xr,k.Badge=gt,k.Breadcrumb=Pt,k.Button=Ae,k.ButtonGroup=ct,k.Card=mr,k.CardBody=wr,k.CardFooter=Nr,k.CardHeader=yr,k.Checkbox=be,k.CheckboxGroup=xt,k.ColorPicker=Vt,k.ConfirmDialog=Ct,k.DSButton=Ae,k.DSCheckbox=be,k.DSInput=De,k.DSRadio=dr,k.DSTable=ur,k.DSTextarea=Te,k.DatePicker=zt,k.Divider=kr,k.Drawer=$r,k.Dropdown=zr,k.EmptyState=ao,k.FileUpload=co,k.FilterBar=zs,k.FormError=Rr,k.FormField=cs,k.FormHelperText=rt,k.FormLabel=Ge,k.FormSuccess=et,k.IconButton=rr,k.ImagePreview=bo,k.Input=De,k.Menu=jr,k.Modal=br,k.Notification=Dr,k.NotificationCenter=mo,k.NumberInput=vs,k.OTPInput=ms,k.PageHeader=Ss,k.Pagination=jt,k.Popover=wo,k.ProgressBar=Tr,k.Radio=dr,k.RadioGroup=yt,k.Rating=zo,k.SearchField=Tt,k.Sidebar=Er,k.SidebarAccountSwitcher=Ye,k.Skeleton=Q,k.SkeletonCard=To,k.SkeletonList=Eo,k.SkeletonTable=Io,k.Spinner=Br,k.StatCard=Yo,k.Statistic=_o,k.Stepper=Pr,k.Switch=Zo,k.Table=ur,k.Tabs=Et,k.Tag=Gr,k.TagInput=Kr,k.Textarea=Te,k.Timeline=ts,k.ToastContainer=ht,k.Tooltip=He,k.TopNavbar=qr,k.TransferList=as,k.Tree=ls,k.toast=he,k.useFormField=ds,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
94
+ text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},S))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:ps,children:n})]})}const ys={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},ws={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 20px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},Ns={fontFamily:"var(--font-caption, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-caption, 14px)"};function Ss({title:r,subtitle:t,breadcrumb:o,actions:s,tabs:a,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-background border-b border-border ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:Ns,children:o}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:ys,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:ws,children:t})]}),s&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:s})]})]}),a&&e.jsx("div",{className:"px-6",children:a})]})}const ks={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ce={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function $s({config:r,value:t,onChange:o}){var c;const[s,a]=b.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,i=b.useCallback(h=>{if(r.type==="single"){const g=n[0]===h?null:h;o(r.key,g),a(!1)}else{const g=n.includes(h)?n.filter(x=>x!==h):[...n,h];o(r.key,g.length?g:null)}},[r,n,o]),d=n.length===1?(c=r.options.find(h=>h.value===n[0]))==null?void 0:c.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(h=>!h),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:ks,children:[d,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground text-[10px] font-bold",children:n.length}),e.jsx(v.ChevronDown,{size:14,className:`transition-transform ${s?"rotate-180":""}`})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm min-w-[160px] py-1 overflow-hidden",children:r.options.map(h=>{const g=n.includes(h.value);return e.jsxs("button",{type:"button",onClick:()=>i(h.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${g?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ce,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${g?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:g&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),h.label]},h.value)})})]})]})}function zs({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:s,onFilterChange:a,className:n=""}){const[l,i]=b.useState({search:"",filters:{}}),d=s??l,c=b.useCallback(w=>{i(w),a==null||a(w)},[a]),h=b.useCallback(w=>{c({...d,search:w.target.value})},[d,c]),g=b.useCallback((w,u)=>{c({...d,filters:{...d.filters,[w]:u}})},[d,c]),x=b.useCallback(()=>{c({search:"",filters:{}})},[c]),f=Object.values(d.filters).filter(w=>w!==null&&(!Array.isArray(w)||w.length>0)).length,p=f>0||d.search&&d.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background)] border border-[var(--border)] rounded-lg px-3 py-2 ${n}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(v.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:d.search??"",onChange:h,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] placeholder:text-[var(--muted-foreground)] focus:outline-none focus:border-[var(--primary)] focus:ring-1 focus:ring-[var(--primary)] transition-colors min-w-[200px]",style:Ce})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(v.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(w=>e.jsx($s,{config:w,value:d.filters[w.key]??null,onChange:g},w.key)),f>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary)]/10 text-[var(--primary)]",style:Ce,children:[f," active"]}),p&&e.jsxs("button",{type:"button",onClick:x,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] transition-colors cursor-pointer ml-auto",style:Ce,children:[e.jsx(v.X,{size:12}),"Clear all"]})]})}const ot={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ke={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ce={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},oe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Fs({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function Cs({columns:r,hidden:t,onToggle:o}){const[s,a]=b.useState(!1),n=b.useRef(null);b.useEffect(()=>{function i(d){n.current&&!n.current.contains(d.target)&&a(!1)}return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);const l=r.filter(i=>i.hideable!==!1);return e.jsxs("div",{ref:n,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(i=>!i),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--muted-foreground)] hover:bg-[var(--muted)] hover:text-[var(--foreground)] transition-colors cursor-pointer",style:ce,children:[e.jsx(v.Columns3,{size:14}),"Columns"]}),s&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-[var(--card)] border border-[var(--border)] rounded-lg shadow-elevation-sm w-44 py-1",children:l.map(i=>{const d=!t.has(i.key);return e.jsxs("button",{type:"button",onClick:()=>o(i.key),className:"w-full flex items-center justify-between gap-2 px-3 py-2 hover:bg-[var(--muted)] text-[var(--foreground)] transition-colors cursor-pointer",style:ce,children:[e.jsx("span",{children:i.header}),d&&e.jsx(v.Check,{size:13,className:"text-[var(--primary)]"})]},i.key)})})]})}function Ws({count:r,actions:t,selectedKeys:o,onClear:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-[var(--primary)]/8 border-b border-[var(--primary)]/20",children:[e.jsxs("span",{className:"text-[var(--primary)] flex-shrink-0",style:ot,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((a,n)=>e.jsxs("button",{type:"button",onClick:()=>a.onClick(o),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${a.variant==="destructive"?"border-[var(--destructive)] text-[var(--destructive)] hover:bg-[var(--destructive)]/10":"border-[var(--primary)] text-[var(--primary)] hover:bg-[var(--primary)]/10"}`,style:{...ce,fontWeight:500},children:[a.icon,a.label]},n))}),e.jsx("button",{type:"button",onClick:s,className:"text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(v.X,{size:14})})]})}const Ls=[10,20,50,100];function Ms({meta:r,onPageChange:t}){const{page:o,pageSize:s,totalCount:a}=r,n=Math.max(1,Math.ceil(a/s)),l=a===0?0:(o-1)*s+1,i=Math.min(o*s,a),d=b.useMemo(()=>{const c=[];if(n<=7)for(let h=1;h<=n;h++)c.push(h);else{c.push(1),o>3&&c.push("...");for(let h=Math.max(2,o-1);h<=Math.min(n-1,o+1);h++)c.push(h);o<n-2&&c.push("..."),c.push(n)}return c},[o,n]);return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[var(--border)] flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[var(--muted-foreground)] whitespace-nowrap",style:ce,children:[l,"–",i," of ",a.toLocaleString()]}),e.jsx("select",{value:s,onChange:c=>t(1,Number(c.target.value)),className:"h-7 px-2 rounded-md border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)] focus:outline-none focus:border-[var(--primary)] cursor-pointer",style:ce,children:Ls.map(c=>e.jsxs("option",{value:c,children:[c," / page"]},c))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ze,{disabled:o===1,onClick:()=>t(o-1,s),label:"‹ Prev"}),d.map((c,h)=>c==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ce,children:"…"},`ellipsis-${h}`):e.jsx(Ze,{active:c===o,onClick:()=>t(c,s),label:String(c)},c)),e.jsx(Ze,{disabled:o===n,onClick:()=>t(o+1,s),label:"Next ›"})]})]})}function Ze({label:r,active:t,disabled:o,onClick:s}){return e.jsx("button",{type:"button",onClick:s,disabled:o,className:`min-w-[28px] h-7 px-2 rounded-md border transition-colors cursor-pointer ${t?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":o?"border-transparent text-[var(--muted-foreground)] cursor-not-allowed":"border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:{...ce,fontWeight:t?600:400},children:r})}function js({columns:r,data:t,rowKey:o="id",pagination:s,sortBy:a,sortOrder:n,onPageChange:l,onSortChange:i,selectable:d=!1,selectedRows:c,onSelectionChange:h,bulkActions:g=[],onRowClick:x,expandedRowRender:f,loading:p=!1,loadingRows:w=5,error:u,emptyMessage:m="No data found",emptyDescription:F,showColumnToggle:y=!1,size:S="md",stickyHeader:z=!1,className:M=""}){const[T,E]=b.useState(new Set(r.filter($=>$.defaultHidden).map($=>$.key))),j=b.useCallback($=>{E(O=>{const Y=new Set(O);return Y.has($)?Y.delete($):Y.add($),Y})},[]),W=b.useMemo(()=>r.filter($=>!T.has($.key)),[r,T]),[P,L]=b.useState(new Set),C=c??P,A=b.useCallback($=>{c||L($);const O=t.filter(Y=>$.has(Y[o]));h==null||h($,O)},[c,t,o,h]),_=b.useMemo(()=>t.map($=>$[o]),[t,o]),K=_.length>0&&_.every($=>C.has($)),Z=C.size>0&&!K,G=b.useCallback(()=>{A(K?new Set:new Set(_))},[K,_,A]),R=b.useCallback($=>{const O=new Set(C);O.has($)?O.delete($):O.add($),A(O)},[C,A]),[q,se]=b.useState(new Set),re=b.useCallback($=>{se(O=>{const Y=new Set(O);return Y.has($)?Y.delete($):Y.add($),Y})},[]),ae=b.useCallback($=>{i&&(a===$?i($,n==="asc"?"desc":"asc"):i($,"asc"))},[a,n,i]),ne=b.useMemo(()=>{const $={};let O=0;d&&(O+=48),f&&(O+=40);for(const Y of W)if(Y.frozen){$[Y.key]=O;const ee=typeof Y.width=="number"?Y.width:parseInt(Y.width??"120");O+=isNaN(ee)?120:ee}return $},[W,d,f]),le=W.length+(d?1:0)+(f?1:0),X="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-lg)] border border-[var(--border)] overflow-hidden ${M}`,children:[y&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-2.5 border-b border-[var(--border)] bg-[var(--background)]",children:e.jsx(Cs,{columns:r,hidden:T,onToggle:j})}),d&&C.size>0&&g.length>0&&e.jsx(Ws,{count:C.size,actions:g,selectedKeys:Array.from(C),onClear:()=>A(new Set)}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:"100%"},children:[e.jsx("thead",{className:z?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-border",style:{backgroundColor:"color-mix(in srgb, var(--muted) 30%, var(--background) 70%)"},children:[f&&e.jsx("th",{className:`${oe[S]} w-10`}),d&&e.jsx("th",{className:`${oe[S]} w-12`,children:e.jsx(be,{size:"sm",checked:K,indeterminate:Z&&!K,onChange:G})}),W.map($=>{const O=$.frozen&&$.key in ne,Y=a===$.key;return e.jsx("th",{className:`${oe[S]} text-${$.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${$.sortable&&i?"cursor-pointer hover:text-[var(--primary)]":""} ${O?X:""}`,style:{...ot,width:$.width,minWidth:$.minWidth??80,...O?{left:ne[$.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>$.sortable&&ae($.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[$.header,$.sortable&&i&&e.jsx("span",{className:Y?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:Y?n==="asc"?e.jsx(v.ChevronUp,{size:13}):e.jsx(v.ChevronDown,{size:13}):e.jsx(v.ChevronsUpDown,{size:12})})]})},$.key)})]})}),e.jsxs("tbody",{children:[u&&e.jsx("tr",{children:e.jsx("td",{colSpan:le,className:`${oe[S]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(v.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:Ke,children:u})]})})}),!u&&p&&Array.from({length:w}).map(($,O)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[f&&e.jsx("td",{className:`${oe[S]} w-10`}),d&&e.jsx("td",{className:`${oe[S]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),W.map(Y=>e.jsx("td",{className:`${oe[S]}`,children:e.jsx(Fs,{width:Y.align==="right"?"60%":Y.align==="center"?"50%":"75%"})},Y.key))]},`skel-${O}`)),!u&&!p&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:le,className:`${oe[S]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[var(--muted)] flex items-center justify-center text-[var(--muted-foreground)]",children:e.jsx(v.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:Ke,children:m}),F&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ce,children:F})]})})}),!u&&!p&&t.map(($,O)=>{const Y=$[o],ee=C.has(Y),de=q.has(Y),we=!!x||!!f;return e.jsxs(b.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${ee?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${we?"cursor-pointer":""}`,onClick:()=>{x==null||x($),f&&re(Y)},children:[f&&e.jsx("td",{className:`${oe[S]} w-10 text-center`,onClick:B=>{B.stopPropagation(),re(Y)},children:e.jsx(v.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${de?"rotate-90":""}`})}),d&&e.jsx("td",{className:`${oe[S]} w-12`,onClick:B=>B.stopPropagation(),children:e.jsx(be,{size:"sm",checked:ee,onChange:()=>R(Y)})}),W.map(B=>{const fe=B.frozen&&B.key in ne,Ne=fe?ee?"sticky z-[1] bg-primary/5":"sticky z-[1] bg-[var(--card)] group-hover/row:bg-[var(--row-hover-bg)] transition-colors":"";return e.jsx("td",{className:`${oe[S]} text-${B.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...Ke,...fe?{left:ne[B.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:B.render?B.render($[B.key],$,O):$[B.key]},B.key)})]}),f&&de&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:le,className:"px-6 py-4",children:f($)})})]},Y??O)})]})]})}),s&&l&&!p&&!u&&e.jsx(Ms,{meta:s,onPageChange:l})]})}k.Accordion=vr,k.AccordionItem=Ee,k.AdvancedDataTable=js,k.Alert=ar,k.Avatar=pr,k.AvatarGroup=xr,k.Badge=gt,k.Breadcrumb=Pt,k.Button=Ae,k.ButtonGroup=ct,k.Card=mr,k.CardBody=wr,k.CardFooter=Nr,k.CardHeader=yr,k.Checkbox=be,k.CheckboxGroup=xt,k.ColorPicker=Vt,k.ConfirmDialog=Ct,k.DSButton=Ae,k.DSCheckbox=be,k.DSInput=De,k.DSRadio=dr,k.DSTable=ur,k.DSTextarea=Te,k.DatePicker=zt,k.Divider=kr,k.Drawer=$r,k.Dropdown=zr,k.EmptyState=ao,k.FileUpload=co,k.FilterBar=zs,k.FormError=Rr,k.FormField=cs,k.FormHelperText=rt,k.FormLabel=Ge,k.FormSuccess=et,k.IconButton=rr,k.ImagePreview=bo,k.Input=De,k.Menu=jr,k.Modal=br,k.Notification=Dr,k.NotificationCenter=mo,k.NumberInput=vs,k.OTPInput=ms,k.PageHeader=Ss,k.Pagination=jt,k.Popover=wo,k.ProgressBar=Tr,k.Radio=dr,k.RadioGroup=yt,k.Rating=zo,k.SearchField=Tt,k.Sidebar=Er,k.SidebarAccountSwitcher=Ye,k.Skeleton=Q,k.SkeletonCard=To,k.SkeletonList=Eo,k.SkeletonTable=Io,k.Spinner=Br,k.StatCard=Yo,k.Statistic=_o,k.Stepper=Pr,k.Switch=Zo,k.Table=ur,k.Tabs=Et,k.Tag=Gr,k.TagInput=Kr,k.Textarea=Te,k.Timeline=ts,k.ToastContainer=ht,k.Tooltip=He,k.TopNavbar=qr,k.TransferList=as,k.Tree=ls,k.toast=he,k.useFormField=ds,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
95
95
  //# sourceMappingURL=sellsuki-ds.umd.cjs.map