@uxuissk/design-system 0.8.13 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sellsuki-ds.css +1 -1
- package/dist/sellsuki-ds.js +1901 -1746
- package/dist/sellsuki-ds.umd.cjs +61 -61
- package/package.json +1 -1
package/dist/sellsuki-ds.umd.cjs
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("lucide-react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react","react-dom"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.SellsukiDS={},L.jsxRuntime,L.React,L.LucideReact,L.ReactDOM))})(this,(function(L,e,c,b,ze){"use strict";const ho={sm:"h-8 px-3 gap-1.5",md:"h-9 px-4 gap-2",lg:"h-10 px-5 gap-2",xl:"h-11 px-6 gap-2.5"},uo={sm:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xl:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}},zr={sm:14,md:16,lg:18,xl:20},Fr={primary:"bg-primary text-primary-foreground border border-primary hover:bg-primary/90 active:bg-primary/80 shadow-elevation-sm",secondary:"bg-secondary text-secondary-foreground border border-secondary hover:bg-secondary/90 active:bg-secondary/80 shadow-elevation-sm",outline:"bg-transparent text-foreground border border-border hover:bg-muted active:bg-muted/80",ghost:"bg-transparent text-foreground border border-transparent hover:bg-muted active:bg-muted/80",destructive:"bg-destructive text-destructive-foreground border border-destructive hover:bg-destructive/90 active:bg-destructive/80 shadow-elevation-sm",link:"bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 h-auto"},Ke=c.forwardRef(({variant:r="primary",size:t="md",loading:o=!1,loadingText:s,leftIcon:a,rightIcon:l,fullWidth:n=!1,active:d=!1,disabled:i,children:f,className:p="",...m},w)=>{const h=i||o;return e.jsx("button",{ref:w,disabled:h,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
2
2
|
${ho[t]}
|
|
3
3
|
${Fr[r]}
|
|
4
|
-
${
|
|
4
|
+
${n?"w-full":""}
|
|
5
5
|
${d?"ring-2 ring-ring/30":""}
|
|
6
6
|
${h?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
7
7
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
8
|
-
${
|
|
9
|
-
`,style:uo[t],...
|
|
10
|
-
${
|
|
8
|
+
${p}
|
|
9
|
+
`,style:uo[t],...m,children:o?e.jsxs(e.Fragment,{children:[e.jsx(b.Loader2,{size:zr[t],className:"animate-spin flex-shrink-0"}),s&&e.jsx("span",{children:s})]}):e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),f&&e.jsx("span",{className:"inline-flex items-center gap-2",children:f}),l&&e.jsx("span",{className:"flex-shrink-0",children:l})]})})});Ke.displayName="DSButton";const Lr=c.forwardRef(({variant:r="ghost",size:t="md",loading:o=!1,icon:s,disabled:a,className:l="",...n},d)=>{const i=a||o,f={sm:"w-8 h-8",md:"w-9 h-9",lg:"w-10 h-10",xl:"w-11 h-11"};return e.jsx("button",{ref:d,disabled:i,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
10
|
+
${f[t]}
|
|
11
11
|
${Fr[r]}
|
|
12
|
-
${
|
|
12
|
+
${i?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
13
13
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
14
14
|
${l}
|
|
15
|
-
`,...
|
|
16
|
-
${
|
|
15
|
+
`,...n,children:o?e.jsx(b.Loader2,{size:zr[t],className:"animate-spin"}):s})});Lr.displayName="IconButton";function po({children:r,className:t=""}){return e.jsx("div",{className:`inline-flex [&>button]:rounded-none [&>button:first-child]:rounded-l-[var(--radius-md)] [&>button:last-child]:rounded-r-[var(--radius-md)] [&>button:not(:last-child)]:border-r-0 ${t}`,children:r})}const Mr={sm:{wrapper:"h-9 px-2.5 gap-1.5",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14},md:{wrapper:"h-11 px-3 gap-2",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16},lg:{wrapper:"h-13 px-4 gap-2.5",textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},icon:18}},Wr={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},Dr={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},Be={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},qe=c.forwardRef(({label:r,helperText:t,errorMessage:o,successMessage:s,size:a="md",variant:l="default",state:n="default",leftIcon:d,rightIcon:i,prefix:f,suffix:p,clearable:m=!1,showPasswordToggle:w=!1,loading:h=!1,fullWidth:g=!0,required:x=!1,showCount:y=!1,onClear:S,disabled:F,type:u="text",value:N,defaultValue:v,onChange:$,className:z="",...A},M)=>{const[D,T]=c.useState(!1),[W,C]=c.useState(!1),[k,E]=c.useState(v??""),B=N!==void 0?N:k,O=String(B).length,P=A.maxLength,_=Mr[a],Q=Wr[l],I=o?"error":n,G=u==="password",te=G&&W?"text":u,X=c.useCallback(H=>{E(H.target.value),$==null||$(H)},[$]),re=c.useCallback(()=>{E(""),S==null||S()},[S]),Y=String(B).length>0;return e.jsxs("div",{className:`${g?"w-full":"inline-flex flex-col"} ${z}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,x&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`flex items-center rounded-[var(--radius-md)] transition-all duration-150
|
|
16
|
+
${_.wrapper}
|
|
17
17
|
${Q.base}
|
|
18
18
|
${F?"":Q.hover}
|
|
19
19
|
${D&&!F?Q.focus:""}
|
|
20
20
|
${F?"opacity-50 cursor-not-allowed":""}
|
|
21
|
-
${Dr[
|
|
22
|
-
`,children:[d&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:d}),
|
|
21
|
+
${Dr[I]}
|
|
22
|
+
`,children:[d&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:d}),f&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:Be,children:f}),e.jsx("input",{ref:M,type:te,disabled:F||h,value:B,onChange:X,onFocus:()=>T(!0),onBlur:()=>T(!1),className:"flex-1 min-w-0 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed",style:_.textStyle,...A}),p&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:Be,children:p}),m&&Y&&!F&&e.jsx("button",{type:"button",onClick:re,className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:e.jsx(b.X,{size:_.icon-2})}),G&&w&&e.jsx("button",{type:"button",onClick:()=>C(!W),className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:W?e.jsx(b.EyeOff,{size:_.icon}):e.jsx(b.Eye,{size:_.icon})}),i&&!G&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:i}),h&&e.jsx("span",{className:"flex-shrink-0",children:e.jsx("span",{className:"block w-4 h-4 border-2 border-muted-foreground border-t-transparent rounded-full animate-spin"})})]}),y&&P&&e.jsxs("div",{className:"flex justify-end mt-1",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",color:O>=P?"var(--destructive)":"var(--muted-foreground)"},children:[O," / ",P]}),(t||o||s)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[I==="error"&&e.jsx(b.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),I==="success"&&e.jsx(b.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${I==="error"?"text-destructive":I==="success"?"text-chart-2":"text-muted-foreground"}`,style:Be,children:o||s||t})]})]})});qe.displayName="DSInput";const Je=c.forwardRef(({label:r,helperText:t,errorMessage:o,successMessage:s,size:a="md",variant:l="default",state:n="default",showCharCount:d=!1,maxLength:i,required:f=!1,disabled:p,value:m,defaultValue:w,onChange:h,className:g="",...x},y)=>{const[S,F]=c.useState(!1),[u,N]=c.useState(String(w??"").length),v=Mr[a],$=Wr[l],z=o?"error":n,A=c.useCallback(M=>{N(M.target.value.length),h==null||h(M)},[h]);return e.jsxs("div",{className:`w-full ${g}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,f&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`transition-all duration-150 overflow-hidden rounded-[var(--radius-md)]
|
|
23
23
|
${$.base}
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${Dr[
|
|
28
|
-
`,children:[e.jsx("textarea",{ref:y,disabled:
|
|
29
|
-
${
|
|
24
|
+
${p?"":$.hover}
|
|
25
|
+
${S&&!p?$.focus:""}
|
|
26
|
+
${p?"opacity-50 cursor-not-allowed":""}
|
|
27
|
+
${Dr[z]}
|
|
28
|
+
`,children:[e.jsx("textarea",{ref:y,disabled:p,value:m,defaultValue:w,maxLength:i,onChange:A,onFocus:()=>F(!0),onBlur:()=>F(!1),className:"w-full min-h-[100px] px-3 py-2.5 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground resize-y disabled:cursor-not-allowed",style:v.textStyle,...x}),d&&e.jsxs("div",{className:"flex justify-end px-3 py-1.5 border-t border-border text-muted-foreground bg-muted/20",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[u,i?` / ${i}`:""," chars"]})]}),(t||o||s)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[z==="error"&&e.jsx(b.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),z==="success"&&e.jsx(b.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${z==="error"?"text-destructive":z==="success"?"text-chart-2":"text-muted-foreground"}`,style:Be,children:o||s||t})]})]})});Je.displayName="DSTextarea";const bo={info:{tint:"bg-primary/10",border:"border-primary/40",text:"text-primary",icon:e.jsx(b.Info,{size:18})},success:{tint:"bg-chart-2/10",border:"border-chart-2/40",text:"text-chart-2",icon:e.jsx(b.CheckCircle2,{size:18})},warning:{tint:"bg-chart-5/10",border:"border-chart-5/40",text:"text-chart-5",icon:e.jsx(b.AlertTriangle,{size:18})},error:{tint:"bg-destructive/10",border:"border-destructive/40",text:"text-destructive",icon:e.jsx(b.XCircle,{size:18})}};function Qe({variant:r="info",title:t,children:o,dismissible:s=!1,onDismiss:a,action:l,icon:n,className:d=""}){const[i,f]=c.useState(!0),p=bo[r];if(!i)return null;const m=()=>{f(!1),a==null||a()};return e.jsxs("div",{className:`relative flex gap-3 p-4 rounded-[var(--radius)] border bg-card/90 backdrop-blur-sm ${p.border} ${d}`,role:"alert",children:[e.jsx("div",{className:`absolute inset-0 rounded-[var(--radius)] pointer-events-none ${p.tint}`}),e.jsx("span",{className:`relative flex-shrink-0 mt-0.5 ${p.text}`,children:n??p.icon}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[t&&e.jsx("span",{className:`block ${p.text}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:t}),e.jsx("span",{className:"text-foreground block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:o}),l&&e.jsx("div",{className:"mt-2",children:l})]}),s&&e.jsx("button",{onClick:m,className:"relative flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer","aria-label":"Dismiss",children:e.jsx(b.X,{size:16})})]})}let Ar=[],je=[];function jr(){Ar.forEach(r=>r([...je]))}const ye={show:r=>{const t={...r,id:`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`};je=[...je,t],jr(),setTimeout(()=>{ye.dismiss(t.id)},r.duration??4e3)},info:(r,t)=>ye.show({variant:"info",message:r,title:t}),success:(r,t)=>ye.show({variant:"success",message:r,title:t}),warning:(r,t)=>ye.show({variant:"warning",message:r,title:t}),error:(r,t)=>ye.show({variant:"error",message:r,title:t}),dismiss:r=>{je=je.filter(t=>t.id!==r),jr()}};function Er(){const[r,t]=c.useState([]),o=c.useRef(!1);return o.current||(o.current=!0,Ar.push(t)),r.length===0?null:e.jsx("div",{className:"fixed bottom-4 right-4 z-[200] flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:r.map(s=>e.jsx("div",{className:"pointer-events-auto animate-in slide-in-from-right fade-in duration-300",children:e.jsx(Qe,{variant:s.variant,title:s.title,dismissible:!0,onDismiss:()=>ye.dismiss(s.id),children:s.message})},s.id))})}const go={default:"bg-primary/15 text-primary",secondary:"bg-secondary/15 text-secondary",outline:"bg-transparent border border-border text-foreground",destructive:"bg-destructive/15 text-destructive",success:"bg-chart-2/15 text-chart-2",warning:"bg-chart-5/15 text-chart-5"},vo={sm:{className:"px-1.5 py-0.5 gap-1",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:400},iconSize:10},md:{className:"px-2.5 py-0.5 gap-1.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:400},iconSize:12},lg:{className:"px-3 py-1 gap-1.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:400},iconSize:14}},xo={default:"bg-primary",secondary:"bg-secondary",outline:"bg-foreground",destructive:"bg-destructive",success:"bg-chart-2",warning:"bg-chart-5"};function mo({children:r,variant:t="default",size:o="md",icon:s,dot:a,removable:l,onRemove:n,className:d=""}){const i=vo[o];return e.jsxs("span",{className:`inline-flex items-center rounded-full whitespace-nowrap ${go[t]} ${i.className} ${d}`,style:{...i.style,lineHeight:"1.2"},children:[a&&e.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${xo[t]}`}),s&&e.jsx("span",{className:"flex-shrink-0",children:s}),e.jsx("span",{children:r}),l&&e.jsx("button",{onClick:n,className:"flex-shrink-0 hover:opacity-70 transition-opacity cursor-pointer rounded-full -mr-0.5","aria-label":"Remove",children:e.jsx(b.X,{size:i.iconSize})})]})}const yo={sm:{box:"w-4 h-4",icon:10,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{box:"w-5 h-5",icon:12,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{box:"w-6 h-6",icon:14,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function Fe({checked:r,indeterminate:t=!1,defaultChecked:o=!1,onChange:s,label:a,description:l,size:n="md",disabled:d=!1,error:i,className:f="",id:p}){const[m,w]=c.useState(o),h=r??m,g=yo[n],x=p??`cb-${c.useId()}`,y=()=>{if(d)return;const F=!h;r===void 0&&w(F),s==null||s(F)},S=h||t;return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${d?"opacity-50":""} ${f}`,children:[e.jsx("button",{id:x,role:"checkbox","aria-checked":t?"mixed":h,disabled:d,onClick:y,className:`${g.box} flex-shrink-0 rounded-[var(--radius-sm)] border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
29
|
+
${S?"bg-primary border-primary text-primary-foreground":i?"border-destructive bg-card":"border-border bg-card hover:border-primary/50"}
|
|
30
30
|
${d?"!cursor-not-allowed":""}
|
|
31
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(
|
|
31
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(b.Minus,{size:g.icon,strokeWidth:3}):h?e.jsx(b.Check,{size:g.icon,strokeWidth:3}):null}),(a||l)&&e.jsxs("div",{className:"min-w-0",children:[a&&e.jsx("label",{htmlFor:x,className:`text-foreground block cursor-pointer ${d?"!cursor-not-allowed":""}`,style:g.labelStyle,onClick:y,children:a}),l&&e.jsx("span",{className:"text-muted-foreground block",style:g.descStyle,children:l}),i&&e.jsx("span",{className:"text-destructive block mt-0.5",style:g.descStyle,children:i})]})]})}function wo({label:r,children:t,direction:o="vertical",className:s=""}){return e.jsxs("fieldset",{className:`${s}`,children:[r&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:r}),e.jsx("div",{className:`flex ${o==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:t})]})}const Tr=c.createContext(null),No={sm:{outer:"w-4 h-4",inner:"w-1.5 h-1.5",labelStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{outer:"w-5 h-5",inner:"w-2 h-2",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{outer:"w-6 h-6",inner:"w-2.5 h-2.5",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function Br({value:r,label:t,description:o,disabled:s,size:a,className:l=""}){const n=c.useContext(Tr),d=n?n.value===r:!1,i=s??(n==null?void 0:n.disabled)??!1,f=a??(n==null?void 0:n.size)??"md",p=No[f],m=()=>{i||n==null||n.onChange(r)};return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${i?"opacity-50":""} ${l}`,children:[e.jsx("button",{role:"radio","aria-checked":d,disabled:i,onClick:m,className:`${p.outer} flex-shrink-0 rounded-full border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
32
32
|
${d?"border-primary":"border-border hover:border-primary/50"}
|
|
33
|
-
${
|
|
34
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:d&&e.jsx("span",{className:`${
|
|
33
|
+
${i?"!cursor-not-allowed":""}
|
|
34
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:d&&e.jsx("span",{className:`${p.inner} rounded-full bg-primary transition-transform scale-100`})}),(t||o)&&e.jsxs("div",{className:"min-w-0",children:[t&&e.jsx("span",{className:`text-foreground block cursor-pointer ${i?"!cursor-not-allowed":""}`,style:p.labelStyle,onClick:m,children:t}),o&&e.jsx("span",{className:"text-muted-foreground block",style:p.descStyle,children:o})]})]})}function Co({name:r,value:t,defaultValue:o="",onChange:s,label:a,size:l="md",disabled:n=!1,direction:d="vertical",children:i,error:f,className:p=""}){const[m,w]=c.useState(o),h=t??m,g=x=>{t===void 0&&w(x),s==null||s(x)};return e.jsx(Tr.Provider,{value:{value:h,onChange:g,size:l,disabled:n,name:r},children:e.jsxs("fieldset",{className:p,role:"radiogroup",children:[a&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:a}),e.jsx("div",{className:`flex ${d==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:i}),f&&e.jsx("span",{className:"text-destructive block mt-1.5",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:f})]})})}const So=["Su","Mo","Tu","We","Th","Fr","Sa"],Ve=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ee(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function Ir(r,t,o){if(!t||!o)return!1;const s=r.getTime();return s>t.getTime()&&s<o.getTime()}function Hr(r,t,o,s){return!!(t&&r<new Date(t.getFullYear(),t.getMonth(),t.getDate())||o&&r>new Date(o.getFullYear(),o.getMonth(),o.getDate())||s!=null&&s.some(a=>Ee(a,r)))}function $o(r,t){return new Date(r,t+1,0).getDate()}function _r(r,t){const o=new Date(r,t,1).getDay(),s=$o(r,t),a=[];for(let l=0;l<o;l++)a.push(null);for(let l=1;l<=s;l++)a.push(new Date(r,t,l));return a}function Ie(r,t){if(!r)return"";const o=String(r.getDate()).padStart(2,"0"),s=String(r.getMonth()+1).padStart(2,"0"),a=r.getFullYear();let l=`${o}/${s}/${a}`;if(t){const n=String(r.getHours()).padStart(2,"0"),d=String(r.getMinutes()).padStart(2,"0");l+=` ${n}:${d}`}return l}const ko={sm:{trigger:"h-8 px-2.5",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14,cell:"w-7 h-7"},md:{trigger:"h-10 px-3",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,cell:"w-9 h-9"},lg:{trigger:"h-12 px-4",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:18,cell:"w-10 h-10"}},zo={default:"bg-input-background border border-border",outlined:"bg-transparent border-2 border-border",filled:"bg-muted/30 border border-transparent",ghost:"bg-transparent border border-transparent"},Fo={default:"focus-within:ring-2 focus-within:ring-ring/30 focus-within:border-primary",error:"ring-2 ring-destructive/30 border-destructive",success:"ring-2 ring-chart-2/30 border-chart-2"};function Lo({value:r=null,rangeValue:t,onChange:o,onRangeChange:s,mode:a="single",label:l,placeholder:n,helperText:d,errorMessage:i,successMessage:f,size:p="md",variant:m="default",state:w="default",disabled:h=!1,required:g=!1,clearable:x=!1,showTime:y=!1,minDate:S,maxDate:F,disabledDates:u,showToday:N=!0,footer:v,fullWidth:$=!1}){const[z,A]=c.useState(!1),[M,D]=c.useState(()=>r??new Date),[T,W]=c.useState("days"),[C,k]=c.useState(null),[E,B]=c.useState(()=>r?r.getHours():0),[O,P]=c.useState(()=>r?r.getMinutes():0),_=c.useRef(null),Q=c.useRef(null),I=c.useRef(null),[G,te]=c.useState(null),X=ko[p];c.useEffect(()=>{if(!z||!Q.current)return;const U=()=>{const ee=Q.current.getBoundingClientRect(),pe=a==="range"?560:300,oe=y?390:360,Se=ee.left+pe>window.innerWidth?Math.max(8,window.innerWidth-pe-8):ee.left,ce=ee.bottom+6+oe>window.innerHeight?ee.top-oe-2:ee.bottom+6;te({top:ce,left:Se})};return U(),window.addEventListener("scroll",U,!0),window.addEventListener("resize",U),()=>{window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U)}},[z,a,y]),c.useEffect(()=>{function U(ee){var ce,$e;const pe=ee.target,oe=((ce=_.current)==null?void 0:ce.contains(pe))??!1,Se=(($e=I.current)==null?void 0:$e.contains(pe))??!1;!oe&&!Se&&(A(!1),W("days"))}return z&&document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[z]),c.useMemo(()=>_r(M.getFullYear(),M.getMonth()),[M]);const re=c.useMemo(()=>new Date,[]),Y=()=>D(new Date(M.getFullYear(),M.getMonth()-1,1)),H=()=>D(new Date(M.getFullYear(),M.getMonth()+1,1)),V=()=>D(new Date(M.getFullYear()-1,M.getMonth(),1)),J=()=>D(new Date(M.getFullYear()+1,M.getMonth(),1)),ne=c.useCallback(U=>{if(!Hr(U,S,F,u))if(a==="single"){let ee=new Date(U);y&&ee.setHours(E,O),o==null||o(ee),y||(A(!1),W("days"))}else{const ee=t==null?void 0:t.start,pe=t==null?void 0:t.end;!ee||ee&&pe?s==null||s({start:U,end:null}):(U<ee?s==null||s({start:U,end:ee}):s==null||s({start:ee,end:U}),A(!1),W("days"))}},[a,o,s,t,S,F,u,y,E,O]),xe=U=>{U.stopPropagation(),a==="single"?o==null||o(null):s==null||s({start:null,end:null})},Te=()=>{const U=new Date;if(D(U),a==="single"){const ee=new Date(U);y&&ee.setHours(E,O),o==null||o(ee),y||(A(!1),W("days"))}},q=()=>{if(r){const U=new Date(r);U.setHours(E,O),o==null||o(U)}A(!1),W("days")},me=c.useMemo(()=>a==="single"?Ie(r,y):t!=null&&t.start&&(t!=null&&t.end)?`${Ie(t.start)} – ${Ie(t.end)}`:t!=null&&t.start?`${Ie(t.start)} – ...`:"",[a,r,t,y]),Ne=a==="single"?!!r:!!(t!=null&&t.start||t!=null&&t.end),ue=w==="error"?e.jsx(b.AlertCircle,{size:X.icon,className:"text-destructive flex-shrink-0"}):w==="success"?e.jsx(b.CheckCircle2,{size:X.icon,className:"text-chart-2 flex-shrink-0"}):null,We=w==="error"?i:w==="success"?f:d,Xe=w==="error"?"text-destructive":w==="success"?"text-chart-2":"text-muted-foreground",$r={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ce={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},se={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},de=Math.floor(M.getFullYear()/12)*12;return e.jsxs("div",{className:`relative ${$?"w-full":""}`,ref:_,children:[l&&e.jsxs("label",{className:"block text-foreground mb-1.5",style:$r,children:[l,g&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{ref:Q,type:"button",onClick:()=>!h&&A(!z),disabled:h,className:`
|
|
35
35
|
w-full flex items-center gap-2 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
36
|
-
${
|
|
37
|
-
${
|
|
36
|
+
${X.trigger}
|
|
37
|
+
${zo[m]}
|
|
38
38
|
${Fo[w]}
|
|
39
39
|
${h?"opacity-50 cursor-not-allowed":"hover:border-primary/50"}
|
|
40
|
-
`,style:
|
|
41
|
-
${
|
|
40
|
+
`,style:X.text,children:[e.jsx(b.Calendar,{size:X.icon,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:`flex-1 text-left truncate ${Ne?"text-foreground":"text-muted-foreground"}`,children:Ne?me:n||(a==="range"?"Select date range…":"Select date…")}),ue,x&&Ne&&!h&&e.jsx("span",{onClick:xe,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.X,{size:X.icon-2})})]}),We&&e.jsx("p",{className:`mt-1.5 ${Xe}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:We}),z&&G&&ze.createPortal(e.jsxs("div",{ref:I,className:"bg-popover border border-border rounded-[var(--radius-md)] shadow-elevation-sm overflow-hidden",style:{position:"fixed",zIndex:9999,top:G.top,left:G.left,minWidth:a==="range"?"560px":"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:V,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous year",children:e.jsx(b.ChevronsLeft,{size:16})}),e.jsx("button",{onClick:Y,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous month",children:e.jsx(b.ChevronLeft,{size:16})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>W(T==="months"?"days":"months"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:se,children:Ve[M.getMonth()]}),e.jsx("button",{onClick:()=>W(T==="years"?"days":"years"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:se,children:M.getFullYear()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:H,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next month",children:e.jsx(b.ChevronRight,{size:16})}),e.jsx("button",{onClick:J,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next year",children:e.jsx(b.ChevronsRight,{size:16})})]})]}),T==="days"&&e.jsx("div",{className:`p-3 ${a==="range"?"flex gap-3":""}`,children:(a==="range"?[0,1]:[0]).map(U=>{const ee=new Date(M.getFullYear(),M.getMonth()+U,1),pe=_r(ee.getFullYear(),ee.getMonth());return e.jsxs("div",{className:"flex-1",children:[U>0&&e.jsxs("div",{className:"text-center mb-2 text-foreground",style:se,children:[Ve[ee.getMonth()]," ",ee.getFullYear()]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:So.map(oe=>e.jsx("div",{className:"text-center text-muted-foreground py-1",style:Ce,children:oe},`${U}-${oe}`))}),e.jsx("div",{className:"grid grid-cols-7",children:pe.map((oe,Se)=>{if(!oe)return e.jsx("div",{},`empty-${U}-${Se}`);const ce=Hr(oe,S,F,u),$e=Ee(oe,re),ke=a==="single"?r&&Ee(oe,r):(t==null?void 0:t.start)&&Ee(oe,t.start)||(t==null?void 0:t.end)&&Ee(oe,t.end),De=a==="range"&&(Ir(oe,(t==null?void 0:t.start)??null,(t==null?void 0:t.end)??null)||(t==null?void 0:t.start)&&!(t!=null&&t.end)&&C&&Ir(oe,t.start,C>t.start?C:null));return e.jsx("button",{onClick:()=>ne(oe),onMouseEnter:()=>a==="range"&&k(oe),disabled:ce,className:`
|
|
41
|
+
${X.cell} flex items-center justify-center rounded-[var(--radius-sm)] transition-all cursor-pointer
|
|
42
42
|
${ce?"opacity-30 cursor-not-allowed":"hover:bg-muted"}
|
|
43
|
-
${
|
|
44
|
-
${De&&!
|
|
45
|
-
${$e&&!
|
|
46
|
-
`,style:
|
|
43
|
+
${ke?"bg-primary text-primary-foreground hover:bg-primary/90":""}
|
|
44
|
+
${De&&!ke?"bg-accent text-accent-foreground":""}
|
|
45
|
+
${$e&&!ke?"border border-primary text-primary":""}
|
|
46
|
+
`,style:se,children:oe.getDate()},`${U}-${oe.getTime()}`)})})]},U)})}),T==="months"&&e.jsx("div",{className:"p-3 grid grid-cols-3 gap-2",children:Ve.map((U,ee)=>e.jsx("button",{onClick:()=>{D(new Date(M.getFullYear(),ee,1)),W("days")},className:`
|
|
47
47
|
py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
48
|
-
${
|
|
49
|
-
`,style:
|
|
48
|
+
${M.getMonth()===ee?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"}
|
|
49
|
+
`,style:se,children:U.substring(0,3)},U))}),T==="years"&&e.jsxs("div",{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{onClick:()=>D(new Date(M.getFullYear()-12,M.getMonth(),1)),className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.ChevronLeft,{size:16})}),e.jsxs("span",{className:"text-foreground",style:se,children:[de," – ",de+11]}),e.jsx("button",{onClick:()=>D(new Date(M.getFullYear()+12,M.getMonth(),1)),className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.ChevronRight,{size:16})})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Array.from({length:12},(U,ee)=>de+ee).map(U=>e.jsx("button",{onClick:()=>{D(new Date(U,M.getMonth(),1)),W("months")},className:`
|
|
50
50
|
py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
51
|
-
${
|
|
52
|
-
${
|
|
53
|
-
`,style:
|
|
54
|
-
${
|
|
51
|
+
${M.getFullYear()===U?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"}
|
|
52
|
+
${U===re.getFullYear()&&M.getFullYear()!==U?"border border-primary text-primary":""}
|
|
53
|
+
`,style:se,children:U},U))})]}),y&&a==="single"&&T==="days"&&e.jsxs("div",{className:"px-4 py-3 border-t border-border flex items-center gap-3",children:[e.jsx(b.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(E).padStart(2,"0"),onChange:U=>B(Math.max(0,Math.min(23,Number(U.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:se}),e.jsx("span",{className:"text-muted-foreground",style:se,children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:String(O).padStart(2,"0"),onChange:U=>P(Math.max(0,Math.min(59,Number(U.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:se})]}),e.jsx("button",{onClick:q,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:se,children:"Apply"})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-card flex items-center justify-between",children:[N?e.jsx("button",{onClick:Te,className:"text-primary hover:underline cursor-pointer",style:se,children:"Today"}):e.jsx("span",{}),v??e.jsx("button",{onClick:()=>{A(!1),W("days")},className:"text-muted-foreground hover:text-foreground cursor-pointer",style:se,children:"Close"})]})]}),document.body)]})}const Mo={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 Pr({open:r,onClose:t,title:o,description:s,size:a="md",children:l,footer:n,closeOnOverlay:d=!0,showCloseButton:i=!0,className:f=""}){const p=c.useRef(null);return c.useEffect(()=>{if(!r)return;const m=w=>{w.key==="Escape"&&t()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[r,t]),c.useEffect(()=>{r&&p.current&&p.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:d?t:void 0}),e.jsxs("div",{ref:p,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":o?"modal-title":void 0,className:`relative w-full ${Mo[a]} bg-card rounded-[var(--radius-md)] 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]"} ${f}`,children:[(o||i)&&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})]}),i&&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(b.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:l}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-border flex-shrink-0",children:n})]})]}):null}function Wo({open:r,onClose:t,onConfirm:o,title:s="Are you sure?",description:a="This action cannot be undone.",confirmLabel:l="Confirm",cancelLabel:n="Cancel",variant:d="default"}){const i={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx(Pr,{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:i,children:n}),e.jsx("button",{onClick:()=>{o(),t()},className:`px-4 py-2 rounded-[var(--radius-md)] text-primary-foreground transition-colors cursor-pointer ${d==="destructive"?"bg-destructive hover:bg-destructive/90":"bg-primary hover:bg-primary/90"}`,style:i,children:l})]})})}const Do={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"}},Ao={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 jo(r,t,o){return c.useMemo(()=>{if(o*2+5>=t)return Array.from({length:t},(f,p)=>p+1);const a=Math.max(r-o,1),l=Math.min(r+o,t),n=a>2,d=l<t-1;if(!n&&d){const f=3+2*o;return[...Array.from({length:f},(m,w)=>w+1),"dots-right",t]}if(n&&!d){const f=3+2*o;return[1,"dots-left",...Array.from({length:f},(m,w)=>t-f+w+1)]}return[1,"dots-left",...Array.from({length:l-a+1},(f,p)=>a+p),"dots-right",t]},[r,t,o])}function Eo({currentPage:r,totalPages:t,onPageChange:o,siblingCount:s=1,showFirstLast:a=!1,showPrevNext:l=!0,showPageSize:n=!1,pageSizeOptions:d=[10,20,50,100],pageSize:i=10,onPageSizeChange:f,totalItems:p,size:m="md",variant:w="default",disabled:h=!1,showPageInfo:g=!1,showItemsInfo:x=!1,prevLabel:y,nextLabel:S}){const F=jo(r,t,s),u=Do[m],N=Ao[w],v=c.useCallback(D=>{!h&&D>=1&&D<=t&&o(D)},[h,t,o]),$=(D,T)=>`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all cursor-pointer select-none
|
|
54
|
+
${u.btn}
|
|
55
55
|
${T?"opacity-40 pointer-events-none cursor-default":""}
|
|
56
|
-
${D?N.active:`${N.base} ${T?"":N.hover}`}`,C=b?(r-1)*n+1:0,A=b?Math.min(r*n,b):0,L={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:[m&&b!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:L,children:[C,"–",A," of ",b]}),i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:L,children:"Rows per page:"}),e.jsx("select",{value:n,onChange:D=>u==null?void 0:u(Number(D.target.value)),disabled:h,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:d.map(D=>e.jsx("option",{value:D,children:D},D))})]})]}),e.jsxs("nav",{className:`flex items-center ${c.gap}`,"aria-label":"Pagination",role:"navigation",children:[s&&e.jsx("button",{onClick:()=>v(1),disabled:h||r<=1,className:$(!1,h||r<=1),style:c.text,"aria-label":"First page",title:"First page",children:e.jsx(g.ChevronsLeft,{size:c.icon})}),l&&e.jsx("button",{onClick:()=>v(r-1),disabled:h||r<=1,className:$(!1,h||r<=1),style:c.text,"aria-label":"Previous page",children:y??e.jsx(g.ChevronLeft,{size:c.icon})}),F.map((D,T)=>D==="dots-left"||D==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${c.btn}`,style:c.text,children:e.jsx(g.MoreHorizontal,{size:c.icon})},D):e.jsx("button",{onClick:()=>v(D),disabled:h,className:$(D===r,h),style:c.text,"aria-label":`Page ${D}`,"aria-current":D===r?"page":void 0,children:D},D)),l&&e.jsx("button",{onClick:()=>v(r+1),disabled:h||r>=t,className:$(!1,h||r>=t),style:c.text,"aria-label":"Next page",children:k??e.jsx(g.ChevronRight,{size:c.icon})}),s&&e.jsx("button",{onClick:()=>v(t),disabled:h||r>=t,className:$(!1,h||r>=t),style:c.text,"aria-label":"Last page",title:"Last page",children:e.jsx(g.ChevronsRight,{size:c.icon})})]}),p&&e.jsxs("span",{className:"text-muted-foreground",style:L,children:["Page ",r," of ",t]})]})}const To={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)"}}},Io={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 Bo({value:r,onChange:t,onSearch:o,placeholder:a="Search...",size:s="md",variant:l="default",loading:i=!1,suggestions:d=[],onSuggestionSelect:n,clearable:u=!0,disabled:b=!1,autoFocus:x=!1,debounce:w=0,className:h=""}){const[p,m]=f.useState(""),[y,k]=f.useState(!1),[F,c]=f.useState(-1),N=r??p,v=f.useRef(null),$=f.useRef(null),C=f.useRef(void 0),A=To[s],L=f.useCallback(S=>{r===void 0&&m(S),t==null||t(S),w>0&&(clearTimeout(C.current),C.current=setTimeout(()=>o==null?void 0:o(S),w))},[r,t,o,w]),D=S=>{S.key==="Enter"?F>=0&&d[F]?(n==null||n(d[F]),k(!1)):o==null||o(N):S.key==="ArrowDown"?(S.preventDefault(),c(z=>Math.min(z+1,d.length-1))):S.key==="ArrowUp"?(S.preventDefault(),c(z=>Math.max(z-1,-1))):S.key==="Escape"&&k(!1)};f.useEffect(()=>{const S=z=>{$.current&&!$.current.contains(z.target)&&k(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),f.useEffect(()=>{k(d.length>0&&N.length>0),c(-1)},[d,N]);const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},M={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:$,className:`relative ${h}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Io[l]} ${b?"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(g.Search,{size:A.icon})}),e.jsx("input",{ref:v,type:"text",value:N,onChange:S=>L(S.target.value),onKeyDown:D,onFocus:()=>d.length>0&&N.length>0&&k(!0),placeholder:a,disabled:b,autoFocus:x,className:`w-full ${A.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:A.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[i&&e.jsx(g.Loader2,{size:A.icon,className:"animate-spin text-muted-foreground"}),u&&N&&!i&&e.jsx("button",{onClick:()=>{var S;L(""),(S=v.current)==null||S.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(g.X,{size:A.icon})})]})]}),y&&d.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:d.map((S,z)=>e.jsxs("button",{onClick:()=>{n==null||n(S),k(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${z===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:[S.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:S.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:T,children:S.label}),S.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...M},children:S.description})]})]},S.id))})]})}const we={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Or({columns:r,data:t,size:o="md",striped:a=!1,hoverable:s=!0,bordered:l=!1,selectable:i=!1,selectedRows:d,onSelectionChange:n,loading:u=!1,error:b,emptyMessage:x="No data available",stickyHeader:w=!1,flush:h=!1,className:p=""}){const[m,y]=f.useState(null),[k,F]=f.useState("asc"),[c,N]=f.useState(new Set),v=d??c,$=E=>{d||N(E),n==null||n(E)},C=f.useMemo(()=>m?[...t].sort((E,I)=>{const O=E[m],P=I[m];if(O==null)return 1;if(P==null)return-1;const H=typeof O=="string"?O.localeCompare(P):O-P;return k==="asc"?H:-H}):t,[t,m,k]),A=E=>{m===E?F(I=>I==="asc"?"desc":"asc"):(y(E),F("asc"))},L=t.length>0&&v.size===t.length,D=v.size>0&&!L,T=()=>{$(L?new Set:new Set(t.map((E,I)=>I)))},M=E=>{const I=new Set(v);I.has(E)?I.delete(E):I.add(E),$(I)},S={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},z={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${h?"":"rounded-[var(--radius-md)] border border-border"} overflow-hidden ${p}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:w?"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:[i&&e.jsx("th",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:L,indeterminate:D,onChange:T})}),r.map(E=>e.jsx("th",{className:`${we[o]} text-${E.align??"left"} text-foreground ${E.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${l?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...z,width:E.width},onClick:()=>E.sortable&&A(E.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[E.header,E.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:m===E.key?k==="asc"?e.jsx(g.ChevronUp,{size:14}):e.jsx(g.ChevronDown,{size:14}):e.jsx(g.ChevronsUpDown,{size:12})})]})},E.key))]})}),e.jsx("tbody",{children:u?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(i?1:0),className:`${we[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:S,children:"Loading..."})]})})}):b?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(i?1:0),className:`${we[o]} text-center py-12`,children:e.jsx("div",{className:"flex flex-col items-center gap-2",children:e.jsx("span",{style:{...S,color:"var(--destructive)"},children:b})})})}):C.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(i?1:0),className:`${we[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:S,children:x})})}):C.map((E,I)=>{const O=v.has(I);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${O?"bg-primary/5":a&&I%2===1?"bg-muted/20":"bg-card"} ${s?"hover:bg-[var(--row-hover-bg)]":""}`,children:[i&&e.jsx("td",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:O,onChange:()=>M(I)})}),r.map(P=>e.jsx("td",{className:`${we[o]} text-${P.align??"left"} text-foreground ${l?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:S,children:P.render?P.render(E[P.key],E,I):E[P.key]},P.key))]},I)})})]})})})}const _o={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 Ho({tabs:r=[],variant:t="default",size:o="md",defaultTab:a,activeTab:s,onChange:l,fullWidth:i=!1,className:d=""}){var F,c;const[n,u]=f.useState(a??((F=r[0])==null?void 0:F.id)??""),b=s??n,x=f.useRef(null),[w,h]=f.useState({left:0,width:0}),p=N=>{s||u(N),l==null||l(N)};f.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const N=x.current;if(!N)return;const v=N.querySelector(`[data-tab-id="${b}"]`);v&&h({left:v.offsetLeft,width:v.offsetWidth})},[b,t]);const m=(c=r.find(N=>N.id===b))==null?void 0:c.content,y=(()=>{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"}})(),k=(N,v)=>{const $="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(v)return`${$} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${$} rounded-[var(--radius-sm)] ${N?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${$} rounded-[var(--radius)] ${N?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${$} ${N?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${$} ${N?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:d,children:[e.jsxs("div",{ref:x,className:`flex ${i?"":"inline-flex"} ${y}`,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:w.left,width:w.width}}),r.map(N=>{const v=b===N.id;return e.jsxs("button",{"data-tab-id":N.id,role:"tab","aria-selected":v,disabled:N.disabled,onClick:()=>!N.disabled&&p(N.id),className:`${k(v,!!N.disabled)} ${i?"flex-1 justify-center":""}`,style:_o[o],children:[N.icon&&e.jsx("span",{className:"flex-shrink-0",children:N.icon}),e.jsx("span",{children:N.label}),N.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${v&&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:N.badge})]},N.id)})]}),m&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:m})]})}const Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Oo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Re({title:r,children:t,open:o,onToggle:a,icon:s,disabled:l=!1}){return e.jsxs("div",{className:`border-b border-border last:border-b-0 ${l?"opacity-50":""}`,children:[e.jsxs("button",{onClick:l?void 0:a,disabled:l,className:`w-full flex items-center gap-3 px-4 py-3 text-left transition-colors ${l?"cursor-not-allowed":"hover:bg-muted/20 cursor-pointer"}`,children:[s&&e.jsx("span",{className:"text-primary flex-shrink-0",children:s}),e.jsx("span",{className:"flex-1 text-foreground",style:Po,children:r}),e.jsx(g.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:Oo,children:t})})]})}function Yr({type:r="single",items:t,defaultOpen:o,value:a,onChange:s,className:l=""}){const[i,d]=f.useState(typeof o=="string"?o:null),[n,u]=f.useState(Array.isArray(o)?new Set(o):new Set),b=a!==void 0,x=h=>b?r==="single"?a===h:Array.isArray(a)&&a.includes(h):r==="single"?i===h:n.has(h),w=h=>{if(r==="single"){const p=(b?a===h:i===h)?null:h;b||d(p),s==null||s(p)}else if(b){const p=Array.isArray(a)?a:[],m=p.includes(h)?p.filter(y=>y!==h):[...p,h];s==null||s(m)}else u(p=>{const m=new Set(p);return m.has(h)?m.delete(h):m.add(h),m})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${l}`,children:t.map(h=>e.jsx(Re,{title:h.title,open:x(h.id),onToggle:()=>w(h.id),icon:h.icon,disabled:h.disabled,children:h.content},h.id))})}Yr.displayName="Accordion",Re.displayName="AccordionItem";const Gr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],Yo={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)"}}},Go={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"},Uo={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Xo={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Ur({src:r,name:t,size:o="md",status:a,className:s=""}){const l=Yo[o],i=t?t.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase():"?",d=t?Gr[t.length%Gr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${s}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${l.box} rounded-full object-cover`}):e.jsx("div",{className:`${l.box} rounded-full ${d} text-primary-foreground flex items-center justify-center`,style:l.font,children:i}),a&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Go[o]} ${Uo[a]} rounded-full border-2 border-card`})]})}function Xr({children:r,max:t,className:o=""}){const a=f.Children.toArray(r),s=t?a.slice(0,t):a,l=t&&a.length>t?a.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[s.map((i,d)=>e.jsx("div",{className:"relative",style:{zIndex:s.length-d},children:i},d)),l>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:{...Xo,zIndex:0},children:["+",l]})]})}Ur.displayName="Avatar",Xr.displayName="AvatarGroup";const Ko={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 Zo({items:r,separator:t="chevron",size:o="md",maxItems:a}){const s=t==="slash"?e.jsx(g.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(g.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(g.ChevronRight,{size:12,className:"text-muted-foreground"}),l=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",i=Ko[o];let d=r;if(a&&r.length>a){const n=r.slice(0,1),u=r.slice(-(a-1));d=[...n,{label:"…"},...u]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${l}`,children:d.map((n,u)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[u>0&&e.jsx("span",{className:"mx-0.5",children:s}),n.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(g.MoreHorizontal,{size:14})}):u===d.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...i,fontWeight:"var(--weight-button)"},children:[n.icon,n.label]}):e.jsxs("a",{href:n.href||"#",onClick:b=>b.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:i,children:[n.icon,n.label]})]},u))})})}const qo={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function Kr({children:r,className:t,hover:o,elevation:a="none"}){return e.jsx("div",{className:`rounded-[var(--radius-md)] border border-border bg-card overflow-hidden ${qo[a]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}Kr.displayName="Card";function Zr({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]})}Zr.displayName="CardHeader";function qr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}qr.displayName="CardBody";function Jr({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})}Jr.displayName="CardFooter";const Jo=["#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 Qo(r){const t=parseInt(r.slice(1,3),16),o=parseInt(r.slice(3,5),16),a=parseInt(r.slice(5,7),16);return`rgb(${t}, ${o}, ${a})`}function Vo(r){const t=parseInt(r.slice(1,3),16)/255,o=parseInt(r.slice(3,5),16)/255,a=parseInt(r.slice(5,7),16)/255,s=Math.max(t,o,a),l=Math.min(t,o,a),i=(s+l)/2;if(s===l)return`hsl(0, 0%, ${Math.round(i*100)}%)`;const d=s-l,n=i>.5?d/(2-s-l):d/(s+l);let u=0;return s===t?u=((o-a)/d+(o<a?6:0))/6:s===o?u=((a-t)/d+2)/6:u=((t-o)/d+4)/6,`hsl(${Math.round(u*360)}, ${Math.round(n*100)}%, ${Math.round(i*100)}%)`}const Ro={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ea={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Qr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ra({value:r,onChange:t,label:o,presets:a,showInput:s=!0,showFormats:l,size:i="md",disabled:d=!1}){const[n,u]=f.useState(!1),b=f.useRef(null),x=i==="sm"?"w-5 h-5":i==="lg"?"w-8 h-8":"w-6 h-6",w=a||Jo,h=p=>{navigator.clipboard.writeText(p).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})};return e.jsxs("div",{className:`space-y-3 ${d?"opacity-50 pointer-events-none":""}`,children:[o&&e.jsx("label",{className:"block text-foreground",style:Ro,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 p;return(p=b.current)==null?void 0:p.click()}}),e.jsx("input",{ref:b,type:"color",value:r,onChange:p=>t(p.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),s&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:p=>{(/^#[0-9a-fA-F]{0,6}$/.test(p.target.value)||p.target.value==="#")&&t(p.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:Qr,maxLength:7}),e.jsx("button",{onClick:()=>h(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:n?e.jsx(g.Check,{size:14,className:"text-chart-2"}):e.jsx(g.Copy,{size:14})})]})]}),w.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(p=>e.jsx("button",{onClick:()=>t(p),className:`${x} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
-
${r===
|
|
56
|
+
${D?N.active:`${N.base} ${T?"":N.hover}`}`,z=p?(r-1)*i+1:0,A=p?Math.min(r*i,p):0,M={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:[x&&p!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:M,children:[z,"–",A," of ",p]}),n&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:M,children:"Rows per page:"}),e.jsx("select",{value:i,onChange:D=>f==null?void 0:f(Number(D.target.value)),disabled:h,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:d.map(D=>e.jsx("option",{value:D,children:D},D))})]})]}),e.jsxs("nav",{className:`flex items-center ${u.gap}`,"aria-label":"Pagination",role:"navigation",children:[a&&e.jsx("button",{onClick:()=>v(1),disabled:h||r<=1,className:$(!1,h||r<=1),style:u.text,"aria-label":"First page",title:"First page",children:e.jsx(b.ChevronsLeft,{size:u.icon})}),l&&e.jsx("button",{onClick:()=>v(r-1),disabled:h||r<=1,className:$(!1,h||r<=1),style:u.text,"aria-label":"Previous page",children:y??e.jsx(b.ChevronLeft,{size:u.icon})}),F.map((D,T)=>D==="dots-left"||D==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${u.btn}`,style:u.text,children:e.jsx(b.MoreHorizontal,{size:u.icon})},D):e.jsx("button",{onClick:()=>v(D),disabled:h,className:$(D===r,h),style:u.text,"aria-label":`Page ${D}`,"aria-current":D===r?"page":void 0,children:D},D)),l&&e.jsx("button",{onClick:()=>v(r+1),disabled:h||r>=t,className:$(!1,h||r>=t),style:u.text,"aria-label":"Next page",children:S??e.jsx(b.ChevronRight,{size:u.icon})}),a&&e.jsx("button",{onClick:()=>v(t),disabled:h||r>=t,className:$(!1,h||r>=t),style:u.text,"aria-label":"Last page",title:"Last page",children:e.jsx(b.ChevronsRight,{size:u.icon})})]}),g&&e.jsxs("span",{className:"text-muted-foreground",style:M,children:["Page ",r," of ",t]})]})}const To={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)"}}},Bo={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 Io({value:r,onChange:t,onSearch:o,placeholder:s="Search...",size:a="md",variant:l="default",loading:n=!1,suggestions:d=[],onSuggestionSelect:i,clearable:f=!0,disabled:p=!1,autoFocus:m=!1,debounce:w=0,className:h=""}){const[g,x]=c.useState(""),[y,S]=c.useState(!1),[F,u]=c.useState(-1),N=r??g,v=c.useRef(null),$=c.useRef(null),z=c.useRef(void 0),A=To[a],M=c.useCallback(C=>{r===void 0&&x(C),t==null||t(C),w>0&&(clearTimeout(z.current),z.current=setTimeout(()=>o==null?void 0:o(C),w))},[r,t,o,w]),D=C=>{C.key==="Enter"?F>=0&&d[F]?(i==null||i(d[F]),S(!1)):o==null||o(N):C.key==="ArrowDown"?(C.preventDefault(),u(k=>Math.min(k+1,d.length-1))):C.key==="ArrowUp"?(C.preventDefault(),u(k=>Math.max(k-1,-1))):C.key==="Escape"&&S(!1)};c.useEffect(()=>{const C=k=>{$.current&&!$.current.contains(k.target)&&S(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]),c.useEffect(()=>{S(d.length>0&&N.length>0),u(-1)},[d,N]);const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},W={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsxs("div",{ref:$,className:`relative ${h}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Bo[l]} ${p?"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(b.Search,{size:A.icon})}),e.jsx("input",{ref:v,type:"text",value:N,onChange:C=>M(C.target.value),onKeyDown:D,onFocus:()=>d.length>0&&N.length>0&&S(!0),placeholder:s,disabled:p,autoFocus:m,className:`w-full ${A.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:A.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[n&&e.jsx(b.Loader2,{size:A.icon,className:"animate-spin text-muted-foreground"}),f&&N&&!n&&e.jsx("button",{onClick:()=>{var C;M(""),(C=v.current)==null||C.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(b.X,{size:A.icon})})]})]}),y&&d.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:d.map((C,k)=>e.jsxs("button",{onClick:()=>{i==null||i(C),S(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${k===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:T,children:C.label}),C.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...W},children:C.description})]})]},C.id))})]})}const we={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Or({columns:r,data:t,size:o="md",striped:s=!1,hoverable:a=!0,bordered:l=!1,selectable:n=!1,selectedRows:d,onSelectionChange:i,loading:f=!1,error:p,emptyMessage:m="No data available",stickyHeader:w=!1,flush:h=!1,className:g=""}){const[x,y]=c.useState(null),[S,F]=c.useState("asc"),[u,N]=c.useState(new Set),v=d??u,$=E=>{d||N(E),i==null||i(E)},z=c.useMemo(()=>x?[...t].sort((E,B)=>{const O=E[x],P=B[x];if(O==null)return 1;if(P==null)return-1;const _=typeof O=="string"?O.localeCompare(P):O-P;return S==="asc"?_:-_}):t,[t,x,S]),A=E=>{x===E?F(B=>B==="asc"?"desc":"asc"):(y(E),F("asc"))},M=t.length>0&&v.size===t.length,D=v.size>0&&!M,T=()=>{$(M?new Set:new Set(t.map((E,B)=>B)))},W=E=>{const B=new Set(v);B.has(E)?B.delete(E):B.add(E),$(B)},C={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},k={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`${h?"":"rounded-[var(--radius-md)] border border-border"} overflow-hidden ${g}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:w?"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:[n&&e.jsx("th",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:M,indeterminate:D,onChange:T})}),r.map(E=>e.jsx("th",{className:`${we[o]} text-${E.align??"left"} text-foreground ${E.sortable?"cursor-pointer select-none hover:text-primary transition-colors":""} ${l?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...k,width:E.width},onClick:()=>E.sortable&&A(E.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[E.header,E.sortable&&e.jsx("span",{className:"text-muted-foreground/50",children:x===E.key?S==="asc"?e.jsx(b.ChevronUp,{size:14}):e.jsx(b.ChevronDown,{size:14}):e.jsx(b.ChevronsUpDown,{size:12})})]})},E.key))]})}),e.jsx("tbody",{children:f?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(n?1:0),className:`${we[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:C,children:"Loading..."})]})})}):p?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(n?1:0),className:`${we[o]} text-center py-12`,children:e.jsx("div",{className:"flex flex-col items-center gap-2",children:e.jsx("span",{style:{...C,color:"var(--destructive)"},children:p})})})}):z.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(n?1:0),className:`${we[o]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:C,children:m})})}):z.map((E,B)=>{const O=v.has(B);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${O?"bg-primary/5":s&&B%2===1?"bg-muted/20":"bg-card"} ${a?"hover:bg-[var(--row-hover-bg)]":""}`,children:[n&&e.jsx("td",{className:`${we[o]} w-12`,children:e.jsx(Fe,{size:"sm",checked:O,onChange:()=>W(B)})}),r.map(P=>e.jsx("td",{className:`${we[o]} text-${P.align??"left"} text-foreground ${l?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:C,children:P.render?P.render(E[P.key],E,B):E[P.key]},P.key))]},B)})})]})})})}const Ho={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 _o({tabs:r=[],variant:t="default",size:o="md",defaultTab:s,activeTab:a,onChange:l,fullWidth:n=!1,className:d=""}){var F,u;const[i,f]=c.useState(s??((F=r[0])==null?void 0:F.id)??""),p=a??i,m=c.useRef(null),[w,h]=c.useState({left:0,width:0}),g=N=>{a||f(N),l==null||l(N)};c.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const N=m.current;if(!N)return;const v=N.querySelector(`[data-tab-id="${p}"]`);v&&h({left:v.offsetLeft,width:v.offsetWidth})},[p,t]);const x=(u=r.find(N=>N.id===p))==null?void 0:u.content,y=(()=>{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"}})(),S=(N,v)=>{const $="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(v)return`${$} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${$} rounded-[var(--radius-sm)] ${N?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${$} rounded-[var(--radius)] ${N?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${$} ${N?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${$} ${N?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:d,children:[e.jsxs("div",{ref:m,className:`flex ${n?"":"inline-flex"} ${y}`,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:w.left,width:w.width}}),r.map(N=>{const v=p===N.id;return e.jsxs("button",{"data-tab-id":N.id,role:"tab","aria-selected":v,disabled:N.disabled,onClick:()=>!N.disabled&&g(N.id),className:`${S(v,!!N.disabled)} ${n?"flex-1 justify-center":""}`,style:Ho[o],children:[N.icon&&e.jsx("span",{className:"flex-shrink-0",children:N.icon}),e.jsx("span",{children:N.label}),N.badge!==void 0&&e.jsx("span",{className:`ml-1 rounded-full min-w-[18px] text-center inline-flex items-center justify-center ${v&&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:N.badge})]},N.id)})]}),x&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:x})]})}const Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Oo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Re({title:r,children:t,open:o,onToggle:s,icon:a,disabled:l=!1}){return e.jsxs("div",{className:`border-b border-border last:border-b-0 ${l?"opacity-50":""}`,children:[e.jsxs("button",{onClick:l?void 0:s,disabled:l,className:`w-full flex items-center gap-3 px-4 py-3 text-left transition-colors ${l?"cursor-not-allowed":"hover:bg-muted/20 cursor-pointer"}`,children:[a&&e.jsx("span",{className:"text-primary flex-shrink-0",children:a}),e.jsx("span",{className:"flex-1 text-foreground",style:Po,children:r}),e.jsx(b.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:Oo,children:t})})]})}function Ur({type:r="single",items:t,defaultOpen:o,value:s,onChange:a,className:l=""}){const[n,d]=c.useState(typeof o=="string"?o:null),[i,f]=c.useState(Array.isArray(o)?new Set(o):new Set),p=s!==void 0,m=h=>p?r==="single"?s===h:Array.isArray(s)&&s.includes(h):r==="single"?n===h:i.has(h),w=h=>{if(r==="single"){const g=(p?s===h:n===h)?null:h;p||d(g),a==null||a(g)}else if(p){const g=Array.isArray(s)?s:[],x=g.includes(h)?g.filter(y=>y!==h):[...g,h];a==null||a(x)}else f(g=>{const x=new Set(g);return x.has(h)?x.delete(h):x.add(h),x})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${l}`,children:t.map(h=>e.jsx(Re,{title:h.title,open:m(h.id),onToggle:()=>w(h.id),icon:h.icon,disabled:h.disabled,children:h.content},h.id))})}Ur.displayName="Accordion",Re.displayName="AccordionItem";const Zr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],Uo={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)"}}},Zo={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"},Yo={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Go={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Yr({src:r,name:t,size:o="md",status:s,className:a=""}){const l=Uo[o],n=t?t.split(" ").map(i=>i[0]).join("").slice(0,2).toUpperCase():"?",d=t?Zr[t.length%Zr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${a}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${l.box} rounded-full object-cover`}):e.jsx("div",{className:`${l.box} rounded-full ${d} text-primary-foreground flex items-center justify-center`,style:l.font,children:n}),s&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Zo[o]} ${Yo[s]} rounded-full border-2 border-card`})]})}function Gr({children:r,max:t,className:o=""}){const s=c.Children.toArray(r),a=t?s.slice(0,t):s,l=t&&s.length>t?s.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${o}`,children:[a.map((n,d)=>e.jsx("div",{className:"relative",style:{zIndex:a.length-d},children:n},d)),l>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:{...Go,zIndex:0},children:["+",l]})]})}Yr.displayName="Avatar",Gr.displayName="AvatarGroup";const Xo={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 Ko({items:r,separator:t="chevron",size:o="md",maxItems:s}){const a=t==="slash"?e.jsx(b.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(b.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(b.ChevronRight,{size:12,className:"text-muted-foreground"}),l=o==="sm"?"gap-1":o==="lg"?"gap-2.5":"gap-1.5",n=Xo[o];let d=r;if(s&&r.length>s){const i=r.slice(0,1),f=r.slice(-(s-1));d=[...i,{label:"…"},...f]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${l}`,children:d.map((i,f)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[f>0&&e.jsx("span",{className:"mx-0.5",children:a}),i.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(b.MoreHorizontal,{size:14})}):f===d.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...n,fontWeight:"var(--weight-button)"},children:[i.icon,i.label]}):e.jsxs("a",{href:i.href||"#",onClick:p=>p.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:n,children:[i.icon,i.label]})]},f))})})}const qo={none:"",sm:"shadow-elevation-sm",md:"shadow-elevation-sm",lg:"shadow-elevation-sm"};function Xr({children:r,className:t,hover:o,elevation:s="none"}){return e.jsx("div",{className:`rounded-[var(--radius-md)] border border-border bg-card overflow-hidden ${qo[s]??""} ${o?"hover:border-primary/40 hover:shadow-elevation-sm transition-all cursor-pointer":""} ${t??""}`,children:r})}Xr.displayName="Card";function Kr({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]})}Kr.displayName="CardHeader";function qr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}qr.displayName="CardBody";function Jr({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})}Jr.displayName="CardFooter";const Jo=["#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 Qo(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 Vo(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),l=Math.min(t,o,s),n=(a+l)/2;if(a===l)return`hsl(0, 0%, ${Math.round(n*100)}%)`;const d=a-l,i=n>.5?d/(2-a-l):d/(a+l);let f=0;return a===t?f=((o-s)/d+(o<s?6:0))/6:a===o?f=((s-t)/d+2)/6:f=((t-o)/d+4)/6,`hsl(${Math.round(f*360)}, ${Math.round(i*100)}%, ${Math.round(n*100)}%)`}const Ro={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},es={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Qr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rs({value:r,onChange:t,label:o,presets:s,showInput:a=!0,showFormats:l,size:n="md",disabled:d=!1}){const[i,f]=c.useState(!1),p=c.useRef(null),m=n==="sm"?"w-5 h-5":n==="lg"?"w-8 h-8":"w-6 h-6",w=s||Jo,h=g=>{navigator.clipboard.writeText(g).then(()=>{f(!0),setTimeout(()=>f(!1),1500)})};return e.jsxs("div",{className:`space-y-3 ${d?"opacity-50 pointer-events-none":""}`,children:[o&&e.jsx("label",{className:"block text-foreground",style:Ro,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 g;return(g=p.current)==null?void 0:g.click()}}),e.jsx("input",{ref:p,type:"color",value:r,onChange:g=>t(g.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:g=>{(/^#[0-9a-fA-F]{0,6}$/.test(g.target.value)||g.target.value==="#")&&t(g.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:Qr,maxLength:7}),e.jsx("button",{onClick:()=>h(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(b.Check,{size:14,className:"text-chart-2"}):e.jsx(b.Copy,{size:14})})]})]}),w.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(g=>e.jsx("button",{onClick:()=>t(g),className:`${m} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
+
${r===g?"border-foreground ring-1 ring-foreground/20":"border-transparent"}`,style:{backgroundColor:g},title:g},g))}),l&&e.jsx("div",{className:"space-y-1",children:[{label:"HEX",val:r.toUpperCase()},{label:"RGB",val:Qo(r)},{label:"HSL",val:Vo(r)}].map(g=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-8 text-muted-foreground",style:es,children:g.label}),e.jsx("code",{className:"text-foreground",style:Qr,children:g.val}),e.jsx("button",{onClick:()=>h(g.val),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.Copy,{size:12})})]},g.label))})]})}const ts={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Vr({label:r,orientation:t="horizontal",dashed:o,spacing:s="md",className:a=""}){const l={sm:"my-2",md:"my-4",lg:"my-8"},n=o?"border-dashed":"border-solid";return t==="vertical"?e.jsx("div",{className:`inline-block h-full min-h-[24px] border-l border-border ${n} mx-3 ${a}`}):r?e.jsxs("div",{className:`flex items-center gap-3 ${l[s]} ${a}`,children:[e.jsx("div",{className:`flex-1 border-t border-border ${n}`}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0",style:ts,children:r}),e.jsx("div",{className:`flex-1 border-t border-border ${n}`})]}):e.jsx("hr",{className:`border-t border-border ${n} ${l[s]} ${a}`})}Vr.displayName="Divider";const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Rr({open:r,onClose:t,title:o,children:s,side:a="right",size:l="md",footer:n,className:d=""}){if(!r)return null;const i={sm:"w-72",md:"w-96",lg:"w-[480px]"},f={sm:"h-48",md:"h-72",lg:"h-96"},p={right:`top-0 right-0 h-full ${i[l]} animate-[slideRight_0.2s_ease]`,left:`top-0 left-0 h-full ${i[l]} animate-[slideLeft_0.2s_ease]`,top:`top-0 left-0 w-full ${f[l]} animate-[slideTop_0.2s_ease]`,bottom:`bottom-0 left-0 w-full ${f[l]} 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 ${p[a]} ${d}`,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:os,children:o}),e.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.X,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:s}),n&&e.jsx("div",{className:"px-5 py-3 border-t border-border flex items-center gap-2 flex-shrink-0",children:n})]}),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); } }
|
|
60
60
|
@keyframes slideTop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
|
|
61
61
|
@keyframes slideBottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
|
|
62
|
-
`})]})}Rr.displayName="Drawer";const
|
|
63
|
-
${
|
|
64
|
-
${
|
|
62
|
+
`})]})}Rr.displayName="Drawer";const ss={sm:{trigger:"h-9 px-[var(--Spacing--Spacing-xl)] gap-[var(--Spacing--Spacing-sm)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-sm) var(--Spacing--Spacing-xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},icon:14,avatarSize:20},md:{trigger:"h-11 px-[var(--Spacing--Spacing-2xl)] gap-[var(--Spacing--Spacing-lg)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,avatarSize:24},lg:{trigger:"h-13 px-[var(--Spacing--Spacing-3xl)] gap-[var(--Spacing--Spacing-xl)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-lg) var(--Spacing--Spacing-3xl)"},textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:18,avatarSize:28}},as={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},ls={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},et=c.forwardRef(({options:r,value:t,defaultValue:o,onChange:s,placeholder:a="Select an option…",label:l,helperText:n,errorMessage:d,successMessage:i,size:f="md",variant:p="default",state:m="default",disabled:w=!1,loading:h=!1,searchable:g=!1,clearable:x=!1,multiple:y=!1,maxSelections:S,grouped:F=!1,required:u=!1,id:N,className:v="",showSelectAll:$=!1,tagLimit:z,creatable:A=!1,onCreateOption:M,createLabel:D='Create "{query}"',emptyState:T,footer:W,onSearch:C,searchDebounce:k=300,searchLoading:E=!1,renderOption:B},O)=>{const[P,_]=c.useState(!1),[Q,I]=c.useState(""),[G,te]=c.useState(-1),[X,re]=c.useState(o??(y?[]:"")),Y=t??X,H=c.useRef(null),V=c.useRef(null),J=c.useRef(null),ne=c.useRef(null),[xe,Te]=c.useState({top:0,left:0,width:0}),q=ss[f],me=as[p];c.useEffect(()=>{if(!P||!H.current)return;const j=()=>{const Z=H.current.getBoundingClientRect();Te({top:Z.bottom+4,left:Z.left,width:Z.width})};return j(),window.addEventListener("scroll",j,!0),window.addEventListener("resize",j),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",j)}},[P]);const Ne=c.useCallback(j=>{I(j),C&&(ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{C(j)},k))},[C,k]);c.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const ue=c.useMemo(()=>!Q||C?r:r.filter(j=>{var Z;return j.label.toLowerCase().includes(Q.toLowerCase())||((Z=j.description)==null?void 0:Z.toLowerCase().includes(Q.toLowerCase()))}),[r,Q,C]),We=c.useMemo(()=>{if(!F)return null;const j={};return ue.forEach(Z=>{const K=Z.group||"Other";j[K]||(j[K]=[]),j[K].push(Z)}),j},[ue,F]),Xe=c.useMemo(()=>{var j;return y&&Array.isArray(Y)?Y.map(Z=>{var K;return(K=r.find(Ae=>Ae.value===Z))==null?void 0:K.label}).filter(Boolean):(j=r.find(Z=>Z.value===Y))!=null&&j.label?[r.find(Z=>Z.value===Y).label]:[]},[Y,r,y]),$r=c.useCallback(j=>y&&Array.isArray(Y)?Y.includes(j):Y===j,[Y,y]),Ce=c.useCallback(j=>{if(y){const Z=Array.isArray(Y)?[...Y]:[],K=Z.indexOf(j);if(K>-1)Z.splice(K,1);else{if(S&&Z.length>=S)return;Z.push(j)}re(Z),s==null||s(Z)}else re(j),s==null||s(j),_(!1);I("")},[Y,y,S,s]),se=c.useMemo(()=>ue.filter(j=>!j.disabled).map(j=>j.value),[ue]),de=c.useMemo(()=>!y||!Array.isArray(Y)?!1:se.length>0&&se.every(j=>Y.includes(j)),[y,Y,se]),U=c.useMemo(()=>!y||!Array.isArray(Y)?!1:se.some(j=>Y.includes(j))&&!de,[y,Y,se,de]),ee=c.useCallback(()=>{if(y)if(de){const j=Array.isArray(Y)?Y.filter(Z=>!se.includes(Z)):[];re(j),s==null||s(j)}else{const j=Array.isArray(Y)?[...Y]:[];for(const Z of se)if(!j.includes(Z)){if(S&&j.length>=S)break;j.push(Z)}re(j),s==null||s(j)}},[y,de,Y,se,S,s]),pe=c.useCallback(()=>{Q.trim()&&(M==null||M(Q.trim()),I(""))},[Q,M]),oe=c.useMemo(()=>!A||!Q.trim()?!1:!r.some(j=>j.label.toLowerCase()===Q.toLowerCase()),[A,Q,r]),Se=c.useCallback(j=>{j.stopPropagation();const Z=y?[]:"";re(Z),s==null||s(Z)},[y,s]),ce=F?Object.values(We||{}).flat():ue,$e=c.useCallback(j=>{var Z;if(!(w||h))switch(j.key){case"ArrowDown":j.preventDefault(),P?te(K=>K<ce.length-1?K+1:0):_(!0);break;case"ArrowUp":j.preventDefault(),te(K=>K>0?K-1:ce.length-1);break;case"Enter":case" ":if(j.preventDefault(),P&&G>=0){const K=ce[G];K&&!K.disabled&&Ce(K.value)}else _(!0);break;case"Escape":_(!1),(Z=H.current)==null||Z.focus();break}},[w,h,P,G,ce,Ce]);c.useEffect(()=>{const j=Z=>{const K=Z.target;H.current&&!H.current.contains(K)&&V.current&&!V.current.contains(K)&&(_(!1),I(""))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),c.useEffect(()=>{P&&g&&setTimeout(()=>{var j;return(j=J.current)==null?void 0:j.focus()},50),P&&te(-1)},[P,g]);const ke=y?Array.isArray(Y)&&Y.length>0:!!Y,De=d?"error":m,Sl=()=>{const j=Xe,Z=z&&z>0?z:j.length,K=j.slice(0,Z),Ae=j.length-K.length;return e.jsxs("span",{className:"flex flex-wrap gap-1",children:[K.map(kr=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[kr,e.jsx(b.X,{size:10,className:"cursor-pointer hover:text-destructive transition-colors",onClick:$l=>{$l.stopPropagation();const fo=r.find(kl=>kl.label===kr);fo&&Ce(fo.value)}})]},kr)),Ae>0&&e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-[var(--radius-sm)] bg-muted text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:["+",Ae," more"]})]})},io=(j,Z)=>{const K=$r(j.value);return B?e.jsx("button",{type:"button",role:"option","aria-selected":K,disabled:j.disabled,className:`w-full ${q.option} transition-colors cursor-pointer
|
|
63
|
+
${K?"bg-[var(--Colors--Background--bg-brand-secondary)]":""}
|
|
64
|
+
${G===Z&&!K?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
65
65
|
${j.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
66
|
-
`,style:q.optionStyle,onClick:()=>!j.disabled&&
|
|
67
|
-
${
|
|
68
|
-
${
|
|
66
|
+
`,style:q.optionStyle,onClick:()=>!j.disabled&&Ce(j.value),onMouseEnter:()=>te(Z),children:B(j,K)},j.value):e.jsxs("button",{type:"button",role:"option","aria-selected":K,disabled:j.disabled,className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${q.option} transition-colors cursor-pointer
|
|
67
|
+
${K?"bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]":""}
|
|
68
|
+
${G===Z&&!K?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
69
69
|
${j.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
70
|
-
`,style:{...q.optionStyle,...q.textStyle},onClick:()=>!j.disabled&&
|
|
71
|
-
${
|
|
72
|
-
`,children:
|
|
73
|
-
${
|
|
74
|
-
${!w&&!h?
|
|
75
|
-
${P?
|
|
70
|
+
`,style:{...q.optionStyle,...q.textStyle},onClick:()=>!j.disabled&&Ce(j.value),onMouseEnter:()=>te(Z),children:[y&&e.jsx("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
71
|
+
${K?"bg-primary border-primary":"border-border"}
|
|
72
|
+
`,children:K&&e.jsx(b.Check,{size:10,className:"text-primary-foreground"})}),j.avatar&&e.jsx("img",{src:j.avatar,alt:"",className:"flex-shrink-0 rounded-full object-cover",style:{width:q.avatarSize,height:q.avatarSize}}),j.icon&&e.jsx("span",{className:"flex-shrink-0",children:j.icon}),e.jsxs("span",{className:"flex-1 text-left",children:[e.jsx("span",{className:"block",children:j.label}),j.description&&e.jsx("span",{className:"block text-muted-foreground",style:{marginTop:"var(--Spacing--Spacing-xxs)",...q.descStyle},children:j.description})]}),!y&&K&&e.jsx(b.Check,{size:q.icon,className:"text-primary flex-shrink-0"})]},j.value)};let co=0;return e.jsxs("div",{ref:O,className:`relative w-full ${v}`,id:N,children:[l&&e.jsxs("label",{className:"block mb-1.5 text-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[l,u&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{ref:H,type:"button",role:"combobox","aria-expanded":P,"aria-haspopup":"listbox",disabled:w||h,onClick:()=>!w&&!h&&_(!P),onKeyDown:$e,className:`w-full flex items-center rounded-[var(--radius-md)] transition-all duration-150 ${q.trigger}
|
|
73
|
+
${me.base}
|
|
74
|
+
${!w&&!h?me.hover:""}
|
|
75
|
+
${P?me.focus:""}
|
|
76
76
|
${w?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
77
77
|
${h?"opacity-70 cursor-wait":""}
|
|
78
|
-
${
|
|
79
|
-
`,style:q.textStyle,children:[h?e.jsx(
|
|
80
|
-
${de?"bg-primary border-primary":
|
|
81
|
-
`,children:[de&&e.jsx(
|
|
82
|
-
${
|
|
83
|
-
${
|
|
84
|
-
${h?"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(
|
|
85
|
-
${
|
|
86
|
-
${k===s?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover"})},k))})]})]})}const pa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},va={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ma={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xa({items:r,parentRect:t}){const o=f.useRef(null),[a,s]=f.useState({top:t.top,left:t.right+4});return f.useEffect(()=>{if(!o.current)return;const i=o.current.getBoundingClientRect();let d=t.top,n=t.right+4;n+i.width>window.innerWidth-8&&(n=t.left-i.width-4),d+i.height>window.innerHeight-8&&(d=window.innerHeight-i.height-8),s({top:d,left:n})},[t]),Ce.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:a.top,left:a.left},children:r.map((l,i)=>e.jsx(st,{item:l},i))}),document.body)}function st({item:r}){const[t,o]=f.useState(!1),a=f.useRef(null),s=f.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:ma,children:r.label});const l=r.children&&r.children.length>0,i=()=>{s.current&&clearTimeout(s.current),l&&o(!0)},d=()=>{s.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:a,className:"relative",onMouseEnter:i,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var n;l||(n=r.onClick)==null||n.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)",...pa},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:va,children:r.shortcut}),l&&e.jsx(g.ChevronRight,{size:14,className:"text-muted-foreground"})]}),l&&t&&a.current&&e.jsx(xa,{items:r.children,parentRect:a.current.getBoundingClientRect()})]})}function lt({items:r,open:t,onClose:o,triggerRef:a,className:s=""}){const l=f.useRef(null),[i,d]=f.useState({top:0,left:0});return f.useEffect(()=>{if(!t||!a.current)return;const n=a.current.getBoundingClientRect();let u=n.bottom+4,b=n.left;requestAnimationFrame(()=>{if(!l.current)return;const x=l.current.getBoundingClientRect();b+x.width>window.innerWidth-8&&(b=n.right-x.width),u+x.height>window.innerHeight-8&&(u=n.top-x.height-4),d({top:u,left:b})}),d({top:u,left:b})},[t,a]),f.useEffect(()=>{if(!t)return;const n=u=>{var b,x;(b=a.current)!=null&&b.contains(u.target)||(x=l.current)!=null&&x.contains(u.target)||o()};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[t,o,a]),t?Ce.createPortal(e.jsxs("div",{ref:l,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] ${s}`,style:{top:i.top,left:i.left},children:[r.map((n,u)=>e.jsx(st,{item:n},u)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}lt.displayName="Menu";const nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ya={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},He={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:a=!0,onClose:s,action:l,avatar:i,time:d,read:n}){const u={info:e.jsx(g.Info,{size:16,className:"text-primary"}),success:e.jsx(g.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(g.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(g.XCircle,{size:16,className:"text-destructive"})},b={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] ${b[r]} ${n===!1?"bg-primary/5":""}`,children:[i?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:i.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:u[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:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:ya,children:d}),n===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nt,children:o}),l&&e.jsxs("button",{onClick:l.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:He,children:[l.label," ",e.jsx(g.ExternalLink,{size:12})]})]})]})}function wa({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:a,onClearAll:s}){const[l,i]=f.useState(r),d=t!==void 0||o!==void 0,n=d?r:l,u=n.filter(h=>!h.read).length,b=()=>{o&&o(),d||i(h=>h.map(p=>({...p,read:!0})))},x=h=>{a&&a(h),d||i(p=>p.filter(m=>m.id!==h))},w=h=>{t&&t(h),d||i(p=>p.map(m=>m.id===h?{...m,read:!0}:m))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] 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(g.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),u>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:He,children:u})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[u>0&&e.jsx("button",{onClick:b,className:"text-primary cursor-pointer",style:He,children:"Mark all read"}),n.length>0&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:He,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:n.map(h=>e.jsx("div",{className:`px-3 py-2 ${h.read?"":"bg-primary/5"}`,onClick:()=>!h.read&&w(h.id),children:e.jsx(it,{type:h.type,title:h.title,message:h.message,time:h.time,read:h.read,closable:!!a,onClose:()=>x(h.id)})},h.id))}),n.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(g.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:nt,children:"No notifications"})]})]})}const Na={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Sa({trigger:r,children:t,placement:o="bottom",title:a,open:s,onOpenChange:l}){const[i,d]=f.useState(!1),n=s!==void 0?s:i,u=w=>{l==null||l(w),s===void 0&&d(w)},b=f.useRef(null);f.useEffect(()=>{if(!n)return;const w=h=>{b.current&&!b.current.contains(h.target)&&u(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n]);const x={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:b,children:[e.jsx("div",{onClick:()=>u(!n),className:"cursor-pointer",children:r}),n&&e.jsx("div",{className:`absolute z-50 ${x[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[a&&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:Na,children:a}),e.jsx("button",{onClick:()=>u(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const ka={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},$a={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:a,label:s,showValue:l,indeterminate:i,className:d=""}){const n={sm:"h-1.5",md:"h-2.5",lg:"h-4"},u=i?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(s||l)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s&&e.jsx("span",{className:"text-foreground",style:ka,children:s}),l&&!i&&e.jsxs("span",{className:"text-muted-foreground",style:$a,children:[Math.round(u),"%"]})]}),e.jsx("div",{className:`w-full ${n[o]} rounded-full bg-muted overflow-hidden`,children:i?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:a??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,backgroundColor:a??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const za={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ca={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Fa({value:r=0,onChange:t,max:o=5,size:a="md",disabled:s,readOnly:l,icon:i="star",showValue:d,label:n}){const[u,b]=f.useState(0),x=a==="sm"?16:a==="lg"?28:20,w=a==="sm"?"gap-0.5":a==="lg"?"gap-1.5":"gap-1",h=i==="heart"?g.Heart:i==="thumb"?g.ThumbsUp:g.Star,p=i==="heart"?"text-destructive":"text-chart-5",m=Array.from({length:o},(y,k)=>k+1);return e.jsxs("div",{className:`inline-flex items-center ${w} ${s?"opacity-50 pointer-events-none":""}`,children:[n&&e.jsx("span",{className:"text-foreground mr-2",style:za,children:n}),m.map(y=>{const k=y<=(u||r);return e.jsx("button",{type:"button",className:`transition-transform ${l||s?"":"cursor-pointer hover:scale-110"} ${k?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!l&&!s&&b(y),onMouseLeave:()=>b(0),onClick:()=>!l&&!s&&(t==null?void 0:t(y===r?0:y)),disabled:s||l,children:e.jsx(h,{size:x,fill:k?"currentColor":"none"})},y)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:Ca,children:[r,"/",o]})]})}const Wa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:a=""}){const[s,l]=f.useState(!1),[i,d]=f.useState({top:0,left:0}),n=f.useRef(null),u=()=>{if(!n.current)return;const p=n.current.getBoundingClientRect(),m=8;let y=0,k=0;o==="right"?(y=p.top+p.height/2,k=p.right+m):o==="left"?(y=p.top+p.height/2,k=p.left-m):o==="bottom"?(y=p.bottom+m,k=p.left+p.width/2):(y=p.top-m,k=p.left+p.width/2),d({top:y,left:k})},b=()=>{u(),l(!0)},x=()=>l(!1);f.useEffect(()=>{if(!s)return;const p=()=>u();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]);const w=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},h=s?e.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:9999,pointerEvents:"none",...w},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:Wa,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:n,className:`relative inline-flex ${a}`,onMouseEnter:b,onMouseLeave:x,onFocus:b,onBlur:x,children:r}),typeof document<"u"&&Ce.createPortal(h,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},La={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},Ma={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",a=t>=40?"var(--text-label)":"var(--text-caption)";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 s=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:a,fontWeight:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:s})}function or({company:r,branch:t,provider:o,companies:a=[],branches:s=[],providers:l=[],onCompanyChange:i,onBranchChange:d,onProviderChange:n,collapsed:u=!1}){const[b,x]=f.useState(!1),w=f.useRef(null);f.useEffect(()=>{if(!b)return;const y=k=>{w.current&&!w.current.contains(k.target)&&x(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[b]);const h=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),m=y=>{i==null||i(y),x(!1)};return u?e.jsx("button",{onClick:()=>x(!b),title:(h==null?void 0:h.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:h?e.jsx(tr,{item:h,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:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:w,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>x(!b),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:[h?e.jsx(tr,{item:h,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:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(h==null?void 0:h.name)??"Select Company"}),p&&e.jsx("span",{style:{...La,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(g.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:b?"rotate(0deg)":"rotate(180deg)"}})]}),b&&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:a.map(y=>{const k=(r==null?void 0:r.id)===y.id;return e.jsxs("button",{onClick:()=>m(y),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:k?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{k||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=k?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:y,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),y.handle&&e.jsx("div",{style:{...Ma,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:y.handle})]}),k&&e.jsx(g.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},y.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Da={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},Aa={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},ft={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ja={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ea={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Pe({brand:r,accountSwitcher:t,groups:o,activeItem:a,onNavigate:s,collapsed:l=!1,onCollapsedChange:i,showCollapseToggle:d=!1,utilityItems:n,version:u,versionDate:b,width:x,className:w=""}){const[h,p]=f.useState(new Set),m=v=>{p($=>{const C=new Set($);return C.has(v)?C.delete(v):C.add(v),C})},F=l?"var(--shell-sidebar-collapsed, 64px)":x??"var(--shell-sidebar-width, 200px)",c=v=>{const $=a===v.id,C=e.jsxs("button",{onClick:()=>s==null?void 0:s(v),className:`w-full flex items-center ${l?"justify-center px-0":"gap-2 px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${$?"bg-sidebar-accent text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Aa,children:[e.jsx("span",{className:`flex-shrink-0 ${$?"text-sidebar-primary":"text-muted-foreground"}`,children:v.icon}),!l&&e.jsx("span",{className:`truncate flex-1 text-left ${$?"text-sidebar-primary":""}`,children:v.label}),v.badge!=null&&!l&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(v.badge)})]},v.id);return l?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:v.label,placement:"right",className:"flex-1",children:C})},v.id):C},N=()=>{if(!r)return null;if(l){const v=r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] object-cover flex-shrink-0"}):r.logoFull?e.jsx("div",{className:"w-10 h-10 flex-shrink-0 overflow-hidden flex items-center",title:r.name,children:e.jsx("div",{style:{flexShrink:0},children:r.logoFull})}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()});return e.jsx("div",{className:"flex justify-center",children:v})}return r.logoFull?e.jsx("div",{className:"flex items-center",style:{height:"40px"},children:r.logoFull}):e.jsxs("div",{className:"flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"text-sidebar-foreground truncate",style:Da,children:r.name})]})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 h-full ${w}`,style:{width:F,minWidth:F,transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1)), min-width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",overflow:"visible"},children:[t?e.jsx("div",{className:`${l?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${l?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:l})}):r&&e.jsx("div",{className:`${l?"px-2 py-3":"px-4 py-3"} border-b border-sidebar-border`,children:N()}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${l?"px-1.5":"px-2"}`,children:o.map(v=>{const $=h.has(v.label);return e.jsxs("div",{className:"mb-4",children:[!l&&e.jsxs("button",{onClick:()=>m(v.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:ja,children:[e.jsx("span",{children:v.label}),e.jsx(g.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:$?"rotate(180deg)":"rotate(0deg)"}})]}),l&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!$&&e.jsx("div",{className:"space-y-0.5",children:v.items.map(C=>c(C))})]},v.label)})}),((n==null?void 0:n.length)||d&&i||u)&&e.jsxs("div",{className:`${l?"px-1.5":"px-2"} pb-3 border-t border-sidebar-border flex flex-col`,children:[n&&n.length>0&&e.jsx("div",{className:"pt-2 space-y-0.5",children:n.map(v=>c(v))}),d&&i&&e.jsx("div",{className:`${n!=null&&n.length?"mt-1":"pt-2"}`,children:e.jsxs("button",{onClick:()=>i(!l),className:`w-full flex items-center ${l?"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:Ea,title:l?"Expand sidebar":"Collapse sidebar",children:[l?e.jsx(g.PanelLeftOpen,{size:16}):e.jsx(g.PanelLeftClose,{size:16}),!l&&e.jsx("span",{children:"Collapse"})]})}),u&&!l&&e.jsxs("div",{className:"px-2 pt-1 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:u}),b&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:b})]})]}),u&&l&&e.jsx("div",{className:"flex justify-center pt-1 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${u}${b?` · ${b}`:""}`,children:u})]})]})}Pe.displayName="Sidebar";function se({width:r,height:t,variant:o="rectangular",animate:a=!0,className:s}){const l="bg-muted",i=a?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${l} ${i} ${d} ${s??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ta(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(se,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{variant:"text",width:"60%",height:20}),e.jsx(se,{variant:"text",width:"100%",height:14}),e.jsx(se,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:"40%",height:14}),e.jsx(se,{variant:"text",width:"25%",height:12})]})]})]})}function Ia(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] 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(se,{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(se,{variant:"circular",width:28,height:28}),e.jsx(se,{variant:"text",width:100+r*15,height:14}),e.jsx(se,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(se,{variant:"rounded",width:60,height:22}),e.jsx(se,{variant:"text",width:80,height:14})]},r))]})}function ar({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>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(se,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(se,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(se,{variant:"rounded",width:50,height:24})]},o))})}const Ba={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 ht({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Ba[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ht.displayName="Spinner";const sr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_a={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 Ha({title:r,value:t,prefix:o,suffix:a,trend:s,trendLabel:l,icon:i,size:d="md",loading:n}){const u=_a[d],b=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",x=(s==null?void 0:s.direction)==="up"?g.ArrowUpRight:(s==null?void 0:s.direction)==="down"?g.ArrowDownRight:g.Minus;return n?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:[i&&e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx("span",{className:"text-muted-foreground",style:sr,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),e.jsx("span",{className:"text-foreground",style:u,children:typeof t=="number"?t.toLocaleString():t}),a&&e.jsx("span",{className:"text-muted-foreground",style:sr,children:a})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${b}`,children:[e.jsx(x,{size:14}),e.jsxs("span",{style:gt,children:[s.value,"%"]}),l&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:l})]})]})}function Pa({title:r,value:t,prefix:o,trend:a,trendLabel:s,icon:l,iconBg:i}){const d=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",n=(a==null?void 0:a.direction)==="up"?g.ArrowUpRight:(a==null?void 0:a.direction)==="down"?g.ArrowDownRight:g.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] 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:sr,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,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})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(n,{size:12}),e.jsxs("span",{style:gt,children:[a.value,"%"]}),s&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:s})]})]}),l&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${i||"bg-primary/10 text-primary"}`,children:l})]})})}const Oa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},mt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xt({steps:r,current:t,orientation:o="horizontal",onStepClick:a,className:s=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t,u=l.disabled;return e.jsxs("div",{className:`flex gap-3 ${u?"opacity-50":""}`,onClick:()=>!u&&(a==null?void 0:a(i)),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 ${u?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),i<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${d?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${i===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:Oa,children:l.title}),l.description&&e.jsx("span",{className:"text-muted-foreground block",style:vt,children:l.description})]})]},i)})}):e.jsx("div",{className:`flex items-center ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t;return e.jsxs("div",{className:`flex items-center ${i<r.length-1?"flex-1":""} ${l.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!l.disabled&&(a==null?void 0:a(i)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${l.disabled?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),e.jsx("span",{className:`text-center ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:vt,children:l.title})]}),i<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},i)})})}xt.displayName="Stepper";const Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ua={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"}},Xa={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ka={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Za({checked:r,onChange:t,label:o,description:a,size:s="md",disabled:l,color:i="primary"}){const d=Ua[s],n=Ka[s];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${l?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:l,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Xa[i]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:n.w,height:n.h,top:"50%",transform:`translateY(-50%) translateX(${r?n.on:2}px)`,left:0}})}),(o||a)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Ya,children:o}),a&&e.jsx("span",{className:"text-muted-foreground block",style:Ga,children:a})]})]})}const qa={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"},Ja={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qa={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 yt({children:r,color:t="default",size:o="md",icon:a,closable:s,onClose:l,className:i=""}){const d=qa[t],n=Ja[o],u=Qa[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${n} ${i}`,style:u,children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),r,s&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:l,children:e.jsx(g.X,{size:o==="sm"?10:12})})]})}yt.displayName="Tag";const Va={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ra={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 wt({tags:r,onChange:t,placeholder:o,disabled:a,maxTags:s,variant:l="default",className:i=""}){const[d,n]=f.useState(""),u=()=>{const x=d.trim();!x||r.includes(x)||s&&r.length>=s||(t([...r,x]),n(""))},b=x=>{t(r.filter(w=>w!==x))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[l]} transition-colors focus-within:border-primary ${a?"opacity-50 pointer-events-none":""} ${i}`,children:[r.map(x=>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:Ra,children:[x,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>b(x),children:e.jsx(g.X,{size:12})})]},x)),e.jsx("input",{value:d,onChange:x=>n(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),u()),x.key==="Backspace"&&!d&&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:Va,disabled:a})]})}wt.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const a=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",s=o==="sm"?12:o==="lg"?18:14,l=i=>i==="completed"?"bg-chart-2 text-primary-foreground":i==="current"?"bg-primary text-primary-foreground":i==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((i,d)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center flex-shrink-0 ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),d<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:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lr,children:i.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((i,d)=>{const n=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${n?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),d<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 ${n?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${n?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:i.description}),i.children&&e.jsx("div",{className:"mt-2",children:i.children})]})]},d)})})}const Oe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},os={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"};function nr({brand:r,breadcrumbs:t,title:o,actions:a,user:s,height:l="56px",searchMode:i,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:n,notificationCount:u,onNotificationClick:b,onMobileMenuClick:x,onSidebarToggle:w,onAppSwitcherClick:h,onUserClick:p,onBreadcrumbClick:m,workspaceSwitcher:y,showSearch:k,className:F=""}){const c=i??(k?"bar":"none"),N=s!=null&&s.name?s.name.split(" ").map($=>$[0]).join("").slice(0,2).toUpperCase():"",v=(r==null?void 0:r.logoFull)??(r==null?void 0:r.logo);return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-4 gap-3 ${F}`,style:{height:l},children:[w&&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 flex-shrink-0",onClick:w,title:"Toggle sidebar",children:e.jsx(g.Menu,{size:18})}),!w&&x&&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 flex-shrink-0",onClick:x,children:e.jsx(g.Menu,{size:16})}),r&&v&&e.jsx("div",{className:"flex items-center flex-shrink-0 text-foreground",children:typeof v=="string"?e.jsx("img",{src:v,alt:r.name,style:{height:"40px",width:"auto"},className:"rounded-[var(--radius-sm)] object-contain"}):e.jsx("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:v})}),r&&!v&&e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Oe,children:r.name.charAt(0).toUpperCase()}),y&&e.jsx("div",{className:"flex items-center",children:y}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:os,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Oe,children:t.map(($,C)=>e.jsxs(f.Fragment,{children:[C>0&&e.jsx(g.ChevronRight,{size:12}),$.href||m?e.jsx("span",{className:`cursor-pointer ${C===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>m==null?void 0:m($,C),children:$.label}):e.jsx("span",{className:C===t.length-1?"text-foreground":"",children:$.label})]},C))}),e.jsx("div",{className:"flex-1"}),c==="bar"&&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:n,children:[e.jsx(g.Search,{size:14}),e.jsx("span",{style:Oe,children:d})]}),c==="icon"&&e.jsx("button",{className:"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:n,title:"Search",children:e.jsx(g.Search,{size:16})}),a,b&&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:b,children:[e.jsx(g.Bell,{size:16}),u!==void 0&&u>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),h&&e.jsx("button",{className:"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,title:"Switch app",children:e.jsx(g.LayoutGrid,{size:16})}),s&&e.jsx("div",{className:"cursor-pointer flex-shrink-0",onClick:p,children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.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:Oe,children:N})})]})}nr.displayName="TopNavbar";const as={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},St={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ir={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function kt({title:r,items:t,selected:o,onToggle:a,search:s,onSearch:l,searchable:i}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] 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:St,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),i&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(g.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:s,onChange:d=>l(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),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:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&a(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
78
|
+
${ls[De]}
|
|
79
|
+
`,style:q.textStyle,children:[h?e.jsx(b.Loader2,{size:q.icon,className:"animate-spin text-muted-foreground"}):null,e.jsx("span",{className:`flex-1 text-left min-w-0 ${y?"":"truncate"} ${ke?"text-foreground":"text-muted-foreground"}`,children:ke?y?Sl():Xe[0]:a}),x&&ke&&!w&&e.jsx(b.X,{size:q.icon,className:"flex-shrink-0 text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:Se}),e.jsx(b.ChevronDown,{size:q.icon,className:`flex-shrink-0 text-muted-foreground transition-transform duration-200 ${P?"rotate-180":""}`})]}),P&&ze.createPortal(e.jsxs("div",{ref:V,role:"listbox",className:"fixed z-[9999] bg-popover border border-border rounded-[var(--radius)] shadow-elevation-sm overflow-hidden",style:{top:xe.top,left:xe.left,width:xe.width||"auto"},children:[g&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(b.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{ref:J,type:"text",value:Q,onChange:j=>Ne(j.target.value),placeholder:"Search\\u2026",className:"w-full pl-8 pr-3 py-1.5 bg-background border border-border rounded-[var(--radius-sm)] outline-none placeholder:text-muted-foreground focus:border-ring focus:ring-1 focus:ring-ring/20 transition-colors",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},onKeyDown:$e})]})}),y&&$&&ue.length>0&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${q.option} border-b border-border transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...q.optionStyle,...q.textStyle},onClick:ee,children:[e.jsxs("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
80
|
+
${de?"bg-primary border-primary":U?"bg-primary/50 border-primary":"border-border"}
|
|
81
|
+
`,children:[de&&e.jsx(b.Check,{size:10,className:"text-primary-foreground"}),U&&!de&&e.jsx("span",{className:"w-2 h-0.5 bg-primary-foreground rounded-full"})]}),e.jsx("span",{className:"text-foreground",children:de?"Deselect All":"Select All"}),e.jsxs("span",{className:"ml-auto text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:[Array.isArray(Y)?Y.length:0,"/",ue.filter(j=>!j.disabled).length]})]}),e.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[E?e.jsxs("div",{className:"flex items-center justify-center py-6 gap-2 text-muted-foreground",children:[e.jsx(b.Loader2,{size:16,className:"animate-spin"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"Searching\\u2026"})]}):ue.length===0&&!oe?T?e.jsx("div",{className:"py-4 px-3",children:T}):e.jsxs("div",{className:"text-center py-6 text-muted-foreground flex flex-col items-center gap-2",children:[e.jsx(b.Inbox,{size:24,className:"opacity-40"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"No options found"})]}):F&&We?Object.entries(We).map(([j,Z])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:j}),Z.map(K=>{const Ae=io(K,co);return co++,Ae})]},j)):ue.map((j,Z)=>io(j,Z)),oe&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${q.option} text-primary transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...q.optionStyle,...q.textStyle},onClick:pe,children:[e.jsx(b.Plus,{size:q.icon,className:"flex-shrink-0"}),e.jsx("span",{children:D.replace("{query}",Q.trim())})]})]}),(W||y&&S)&&e.jsxs("div",{className:"border-t border-border",children:[y&&S&&e.jsxs("div",{className:"px-3 py-2 text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[Array.isArray(Y)?Y.length:0," / ",S," selected"]}),W&&e.jsx("div",{className:"px-3 py-2",children:W})]})]}),document.body),(n||d||i)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[De==="error"&&e.jsx(b.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),e.jsx("span",{className:`${De==="error"?"text-destructive":De==="success"?"text-chart-2":"text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:d||i||n})]})]})});et.displayName="Dropdown";const ns={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},rt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function is({icon:r,title:t,description:o,action:s,secondaryAction:a,size:l="md"}){const n=l==="sm"?"w-10 h-10":l==="lg"?"w-16 h-16":"w-12 h-12",d=l==="sm"?"py-6 px-4":l==="lg"?"py-14 px-8":"py-10 px-6";return e.jsxs("div",{className:`flex flex-col items-center text-center ${d}`,children:[r&&e.jsx("div",{className:`${n} rounded-full bg-muted flex items-center justify-center mb-4`,children:e.jsx("span",{className:"text-muted-foreground",children:r})}),e.jsx("h4",{className:"text-foreground",children:t}),o&&e.jsx("p",{className:"text-muted-foreground mt-1.5 max-w-sm",style:ns,children:o}),(s||a)&&e.jsxs("div",{className:"flex items-center gap-3 mt-5",children:[s&&e.jsxs("button",{onClick:s.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:rt,children:[s.icon,s.label]}),a&&e.jsx("button",{onClick:a.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-accent transition-colors cursor-pointer",style:rt,children:a.label})]})]})}const ds={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},He={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},tt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},cs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ot(r){return r<1024?r+" B":r<1024*1024?(r/1024).toFixed(1)+" KB":(r/(1024*1024)).toFixed(1)+" MB"}function fs(r){return r.startsWith("image/")?e.jsx(b.Image,{size:16,className:"text-chart-2"}):r.startsWith("video/")?e.jsx(b.Film,{size:16,className:"text-chart-5"}):r.includes("pdf")||r.includes("document")?e.jsx(b.FileText,{size:16,className:"text-destructive"}):e.jsx(b.File,{size:16,className:"text-muted-foreground"})}function st({files:r,onRemove:t}){return e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-[var(--radius-md)] border border-border bg-card",children:[fs(o.type),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-foreground truncate",style:ds,children:o.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:tt,children:ot(o.size)}),o.status==="uploading"&&e.jsx("div",{className:"flex-1 h-1 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${o.progress}%`}})}),o.status==="done"&&e.jsx(b.CheckCircle2,{size:12,className:"text-chart-2"})]})]}),e.jsx("button",{onClick:()=>t(o.id),className:"text-muted-foreground hover:text-destructive cursor-pointer",children:e.jsx(b.X,{size:14})})]},o.id))})}function hs({accept:r,maxSize:t,multiple:o,disabled:s,variant:a="dropzone",label:l,description:n,value:d,onChange:i,onUpload:f,onRemove:p}){const[m,w]=c.useState([]),[h,g]=c.useState(!1),x=c.useRef(null),y=d??m,S=u=>{if(!u)return;const N=Array.from(u);if(i&&i(N),d===void 0){const v=N.map($=>({id:Math.random().toString(36).slice(2),name:$.name,size:$.size,type:$.type,progress:0,status:"uploading"}));w($=>[...$,...v]),v.forEach($=>{let z=0;const A=setInterval(()=>{z+=Math.random()*30+10,z>=100&&(z=100,clearInterval(A)),w(M=>M.map(D=>D.id===$.id?{...D,progress:Math.min(z,100),status:z>=100?"done":"uploading"}:D)),z>=100&&f&&f({...$,progress:100,status:"done"})},300)})}},F=u=>{p&&p(u),d===void 0&&w(N=>N.filter(v=>v.id!==u))};return a==="button"?e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("label",{className:"block text-foreground",style:He,children:l}),e.jsxs("button",{onClick:()=>{var u;return(u=x.current)==null?void 0:u.click()},disabled:s,className:`inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border bg-background text-foreground hover:bg-accent transition-colors cursor-pointer ${s?"opacity-50 pointer-events-none":""}`,style:cs,children:[e.jsx(b.Upload,{size:14})," Choose File",o?"s":""]}),e.jsx("input",{ref:x,type:"file",className:"hidden",accept:r,multiple:o,onChange:u=>S(u.target.files)}),y.length>0&&e.jsx(st,{files:y,onRemove:F})]}):a==="avatar"?e.jsxs("div",{className:"space-y-2",children:[l&&e.jsx("label",{className:"block text-foreground",style:He,children:l}),e.jsx("div",{onClick:()=>{var u;return!s&&((u=x.current)==null?void 0:u.click())},className:`w-24 h-24 rounded-full border-2 border-dashed flex items-center justify-center cursor-pointer transition-colors
|
|
82
|
+
${s?"opacity-50 pointer-events-none":""} ${h?"border-primary bg-primary/5":"border-border hover:border-primary/40"}`,children:y.length>0&&y[y.length-1].status==="done"?e.jsx(b.CheckCircle2,{size:24,className:"text-chart-2"}):e.jsx(b.Upload,{size:20,className:"text-muted-foreground"})}),e.jsx("input",{ref:x,type:"file",className:"hidden",accept:r||"image/*",onChange:u=>S(u.target.files)})]}):e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("label",{className:"block text-foreground",style:He,children:l}),e.jsxs("div",{onDragOver:u=>{u.preventDefault(),g(!0)},onDragLeave:()=>g(!1),onDrop:u=>{u.preventDefault(),g(!1),S(u.dataTransfer.files)},onClick:()=>{var u;return!s&&((u=x.current)==null?void 0:u.click())},className:`relative flex flex-col items-center justify-center gap-2 px-6 py-10 rounded-[var(--radius-md)] border-2 border-dashed transition-all cursor-pointer
|
|
83
|
+
${s?"opacity-50 pointer-events-none":""}
|
|
84
|
+
${h?"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(b.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:He,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:tt,children:[n||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${ot(t)}`]})]})]}),e.jsx("input",{ref:x,type:"file",className:"hidden",accept:r,multiple:o,onChange:u=>S(u.target.files)}),y.length>0&&e.jsx(st,{files:y,onRemove:F})]})}const us={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ps={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function bs({images:r,initialIndex:t=0}){const[o,s]=c.useState(!1),[a,l]=c.useState(t),[n,d]=c.useState(1),[i,f]=c.useState(0),p=r[a],m=()=>{l(y=>(y-1+r.length)%r.length),d(1),f(0)},w=()=>{l(y=>(y+1)%r.length),d(1),f(0)},h=()=>d(y=>Math.min(y+.25,3)),g=()=>d(y=>Math.max(y-.25,.5)),x=()=>f(y=>(y+90)%360);return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((y,S)=>e.jsx("button",{onClick:()=>{l(S),s(!0),d(1),f(0)},className:`rounded-[var(--radius-md)] overflow-hidden border-2 transition-all cursor-pointer hover:opacity-80
|
|
85
|
+
${a===S&&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:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover",loading:"lazy"})})},S))}),o&&e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Image preview: ${p.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:us,children:[p.alt," (",a+1,"/",r.length,")"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:g,"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(b.ZoomOut,{size:16})}),e.jsxs("span",{className:"text-primary-foreground/70 px-2",style:ps,"aria-live":"polite","aria-label":`Zoom level ${Math.round(n*100)}%`,children:[Math.round(n*100),"%"]}),e.jsx("button",{onClick:h,"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(b.ZoomIn,{size:16})}),e.jsx("button",{onClick:x,"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(b.RotateCw,{size:16})}),e.jsx("div",{className:"w-px h-5 bg-primary-foreground/20 mx-1"}),e.jsx("button",{onClick:()=>{s(!1),d(1),f(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(b.X,{size:16})})]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",onClick:y=>{y.target===y.currentTarget&&(s(!1),d(1),f(0))},children:[r.length>1&&e.jsx("button",{onClick:m,"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(b.ChevronLeft,{size:20})}),e.jsx("img",{src:p.src,alt:p.alt,className:"max-w-[90%] max-h-[80vh] object-contain transition-transform",style:{transform:`scale(${n}) rotate(${i}deg)`}}),r.length>1&&e.jsx("button",{onClick:w,"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(b.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((y,S)=>e.jsx("button",{onClick:()=>{l(S),d(1),f(0)},className:`w-12 h-12 rounded-[var(--radius-sm)] overflow-hidden border-2 cursor-pointer transition-all
|
|
86
|
+
${S===a?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover"})},S))})]})]})}const gs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},vs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},xs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ms({items:r,parentRect:t}){const o=c.useRef(null),[s,a]=c.useState({top:t.top,left:t.right+4});return c.useEffect(()=>{if(!o.current)return;const n=o.current.getBoundingClientRect();let d=t.top,i=t.right+4;i+n.width>window.innerWidth-8&&(i=t.left-n.width-4),d+n.height>window.innerHeight-8&&(d=window.innerHeight-n.height-8),a({top:d,left:i})},[t]),ze.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((l,n)=>e.jsx(at,{item:l},n))}),document.body)}function at({item:r}){const[t,o]=c.useState(!1),s=c.useRef(null),a=c.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:xs,children:r.label});const l=r.children&&r.children.length>0,n=()=>{a.current&&clearTimeout(a.current),l&&o(!0)},d=()=>{a.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:s,className:"relative",onMouseEnter:n,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var i;l||(i=r.onClick)==null||i.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)",...gs},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:vs,children:r.shortcut}),l&&e.jsx(b.ChevronRight,{size:14,className:"text-muted-foreground"})]}),l&&t&&s.current&&e.jsx(ms,{items:r.children,parentRect:s.current.getBoundingClientRect()})]})}function lt({items:r,open:t,onClose:o,triggerRef:s,className:a=""}){const l=c.useRef(null),[n,d]=c.useState({top:0,left:0});return c.useEffect(()=>{if(!t||!s.current)return;const i=s.current.getBoundingClientRect();let f=i.bottom+4,p=i.left;requestAnimationFrame(()=>{if(!l.current)return;const m=l.current.getBoundingClientRect();p+m.width>window.innerWidth-8&&(p=i.right-m.width),f+m.height>window.innerHeight-8&&(f=i.top-m.height-4),d({top:f,left:p})}),d({top:f,left:p})},[t,s]),c.useEffect(()=>{if(!t)return;const i=f=>{var p,m;(p=s.current)!=null&&p.contains(f.target)||(m=l.current)!=null&&m.contains(f.target)||o()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,o,s]),t?ze.createPortal(e.jsxs("div",{ref:l,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:n.top,left:n.left},children:[r.map((i,f)=>e.jsx(at,{item:i},f)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}lt.displayName="Menu";const nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ys={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},_e={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:s=!0,onClose:a,action:l,avatar:n,time:d,read:i}){const f={info:e.jsx(b.Info,{size:16,className:"text-primary"}),success:e.jsx(b.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(b.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(b.XCircle,{size:16,className:"text-destructive"})},p={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] ${p[r]} ${i===!1?"bg-primary/5":""}`,children:[n?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:n.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:f[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:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:ys,children:d}),i===!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(b.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nt,children:o}),l&&e.jsxs("button",{onClick:l.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:_e,children:[l.label," ",e.jsx(b.ExternalLink,{size:12})]})]})]})}function ws({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:s,onClearAll:a}){const[l,n]=c.useState(r),d=t!==void 0||o!==void 0,i=d?r:l,f=i.filter(h=>!h.read).length,p=()=>{o&&o(),d||n(h=>h.map(g=>({...g,read:!0})))},m=h=>{s&&s(h),d||n(g=>g.filter(x=>x.id!==h))},w=h=>{t&&t(h),d||n(g=>g.map(x=>x.id===h?{...x,read:!0}:x))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] 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(b.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),f>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:_e,children:f})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[f>0&&e.jsx("button",{onClick:p,className:"text-primary cursor-pointer",style:_e,children:"Mark all read"}),i.length>0&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:_e,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:i.map(h=>e.jsx("div",{className:`px-3 py-2 ${h.read?"":"bg-primary/5"}`,onClick:()=>!h.read&&w(h.id),children:e.jsx(it,{type:h.type,title:h.title,message:h.message,time:h.time,read:h.read,closable:!!s,onClose:()=>m(h.id)})},h.id))}),i.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(b.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:nt,children:"No notifications"})]})]})}const Ns={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Cs({trigger:r,children:t,placement:o="bottom",title:s,open:a,onOpenChange:l}){const[n,d]=c.useState(!1),i=a!==void 0?a:n,f=w=>{l==null||l(w),a===void 0&&d(w)},p=c.useRef(null);c.useEffect(()=>{if(!i)return;const w=h=>{p.current&&!p.current.contains(h.target)&&f(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[i]);const m={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:p,children:[e.jsx("div",{onClick:()=>f(!i),className:"cursor-pointer",children:r}),i&&e.jsx("div",{className:`absolute z-50 ${m[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] 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:Ns,children:s}),e.jsx("button",{onClick:()=>f(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(b.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const Ss={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},$s={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:s,label:a,showValue:l,indeterminate:n,className:d=""}){const i={sm:"h-1.5",md:"h-2.5",lg:"h-4"},f=n?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(a||l)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a&&e.jsx("span",{className:"text-foreground",style:Ss,children:a}),l&&!n&&e.jsxs("span",{className:"text-muted-foreground",style:$s,children:[Math.round(f),"%"]})]}),e.jsx("div",{className:`w-full ${i[o]} rounded-full bg-muted overflow-hidden`,children:n?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:`${f}%`,backgroundColor:s??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const ks={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},zs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Fs({value:r=0,onChange:t,max:o=5,size:s="md",disabled:a,readOnly:l,icon:n="star",showValue:d,label:i}){const[f,p]=c.useState(0),m=s==="sm"?16:s==="lg"?28:20,w=s==="sm"?"gap-0.5":s==="lg"?"gap-1.5":"gap-1",h=n==="heart"?b.Heart:n==="thumb"?b.ThumbsUp:b.Star,g=n==="heart"?"text-destructive":"text-chart-5",x=Array.from({length:o},(y,S)=>S+1);return e.jsxs("div",{className:`inline-flex items-center ${w} ${a?"opacity-50 pointer-events-none":""}`,children:[i&&e.jsx("span",{className:"text-foreground mr-2",style:ks,children:i}),x.map(y=>{const S=y<=(f||r);return e.jsx("button",{type:"button",className:`transition-transform ${l||a?"":"cursor-pointer hover:scale-110"} ${S?g:"text-muted-foreground/40"}`,onMouseEnter:()=>!l&&!a&&p(y),onMouseLeave:()=>p(0),onClick:()=>!l&&!a&&(t==null?void 0:t(y===r?0:y)),disabled:a||l,children:e.jsx(h,{size:m,fill:S?"currentColor":"none"})},y)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:zs,children:[r,"/",o]})]})}const Ls={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:s=""}){const[a,l]=c.useState(!1),[n,d]=c.useState({top:0,left:0}),i=c.useRef(null),f=()=>{if(!i.current)return;const g=i.current.getBoundingClientRect(),x=8;let y=0,S=0;o==="right"?(y=g.top+g.height/2,S=g.right+x):o==="left"?(y=g.top+g.height/2,S=g.left-x):o==="bottom"?(y=g.bottom+x,S=g.left+g.width/2):(y=g.top-x,S=g.left+g.width/2),d({top:y,left:S})},p=()=>{f(),l(!0)},m=()=>l(!1);c.useEffect(()=>{if(!a)return;const g=()=>f();return window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[a]);const w=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},h=a?e.jsx("div",{style:{position:"fixed",top:n.top,left:n.left,zIndex:9999,pointerEvents:"none",...w},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:Ls,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:i,className:`relative inline-flex ${s}`,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m,children:r}),typeof document<"u"&&ze.createPortal(h,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},Ms={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},Ws={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",s=t>=40?"var(--text-label)":"var(--text-caption)";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:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:a})}function or({company:r,branch:t,provider:o,companies:s=[],branches:a=[],providers:l=[],onCompanyChange:n,onBranchChange:d,onProviderChange:i,collapsed:f=!1}){const[p,m]=c.useState(!1),w=c.useRef(null);c.useEffect(()=>{if(!p)return;const y=S=>{w.current&&!w.current.contains(S.target)&&m(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[p]);const h=r,g=(t==null?void 0:t.name)??(o==null?void 0:o.name),x=y=>{n==null||n(y),m(!1)};return f?e.jsx("button",{onClick:()=>m(!p),title:(h==null?void 0:h.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:h?e.jsx(tr,{item:h,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:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:w,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>m(!p),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:[h?e.jsx(tr,{item:h,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:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(h==null?void 0:h.name)??"Select Company"}),g&&e.jsx("span",{style:{...Ms,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:g})]}),e.jsx(b.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:p?"rotate(0deg)":"rotate(180deg)"}})]}),p&&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(y=>{const S=(r==null?void 0:r.id)===y.id;return e.jsxs("button",{onClick:()=>x(y),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:S?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{S||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=S?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:y,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),y.handle&&e.jsx("div",{style:{...Ws,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:y.handle})]}),S&&e.jsx(b.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},y.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Ds={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},As={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},ft={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},js={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Es={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Pe({brand:r,accountSwitcher:t,groups:o,activeItem:s,onNavigate:a,collapsed:l=!1,onCollapsedChange:n,showCollapseToggle:d=!1,utilityItems:i,version:f,versionDate:p,width:m,className:w=""}){const[h,g]=c.useState(new Set),x=v=>{g($=>{const z=new Set($);return z.has(v)?z.delete(v):z.add(v),z})},F=l?"var(--shell-sidebar-collapsed, 64px)":m??"var(--shell-sidebar-width, 200px)",u=v=>{const $=s===v.id,z=e.jsxs("button",{onClick:()=>a==null?void 0:a(v),className:`w-full flex items-center ${l?"justify-center px-0":"gap-2 px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${$?"bg-sidebar-accent text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:As,children:[e.jsx("span",{className:`flex-shrink-0 ${$?"text-sidebar-primary":"text-muted-foreground"}`,children:v.icon}),!l&&e.jsx("span",{className:`truncate flex-1 text-left ${$?"text-sidebar-primary":""}`,children:v.label}),v.badge!=null&&!l&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(v.badge)})]},v.id);return l?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:v.label,placement:"right",className:"flex-1",children:z})},v.id):z},N=()=>{if(!r)return null;if(l){const v=r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] object-cover flex-shrink-0"}):r.logoFull?e.jsx("div",{className:"w-10 h-10 flex-shrink-0 overflow-hidden flex items-center",title:r.name,children:e.jsx("div",{style:{flexShrink:0},children:r.logoFull})}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()});return e.jsx("div",{className:"flex justify-center",children:v})}return r.logoFull?e.jsx("div",{className:"flex items-center",style:{height:"40px"},children:r.logoFull}):e.jsxs("div",{className:"flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"text-sidebar-foreground truncate",style:Ds,children:r.name})]})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 h-full ${w}`,style:{width:F,minWidth:F,transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1)), min-width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",overflow:"visible"},children:[t?e.jsx("div",{className:`${l?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${l?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:l})}):r&&e.jsx("div",{className:`${l?"px-2 py-3":"px-4 py-3"} border-b border-sidebar-border`,children:N()}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${l?"px-1.5":"px-2"}`,children:o.map(v=>{const $=h.has(v.label);return e.jsxs("div",{className:"mb-4",children:[!l&&e.jsxs("button",{onClick:()=>x(v.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:js,children:[e.jsx("span",{children:v.label}),e.jsx(b.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:$?"rotate(180deg)":"rotate(0deg)"}})]}),l&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!$&&e.jsx("div",{className:"space-y-0.5",children:v.items.map(z=>u(z))})]},v.label)})}),((i==null?void 0:i.length)||d&&n||f)&&e.jsxs("div",{className:`${l?"px-1.5":"px-2"} pb-3 border-t border-sidebar-border flex flex-col`,children:[i&&i.length>0&&e.jsx("div",{className:"pt-2 space-y-0.5",children:i.map(v=>u(v))}),d&&n&&e.jsx("div",{className:`${i!=null&&i.length?"mt-1":"pt-2"}`,children:e.jsxs("button",{onClick:()=>n(!l),className:`w-full flex items-center ${l?"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:Es,title:l?"Expand sidebar":"Collapse sidebar",children:[l?e.jsx(b.PanelLeftOpen,{size:16}):e.jsx(b.PanelLeftClose,{size:16}),!l&&e.jsx("span",{children:"Collapse"})]})}),f&&!l&&e.jsxs("div",{className:"px-2 pt-1 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:f}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:p})]})]}),f&&l&&e.jsx("div",{className:"flex justify-center pt-1 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${f}${p?` · ${p}`:""}`,children:f})]})]})}Pe.displayName="Sidebar";function ae({width:r,height:t,variant:o="rectangular",animate:s=!0,className:a}){const l="bg-muted",n=s?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${l} ${n} ${d} ${a??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ts(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(ae,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{variant:"text",width:"60%",height:20}),e.jsx(ae,{variant:"text",width:"100%",height:14}),e.jsx(ae,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ae,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(ae,{variant:"text",width:"40%",height:14}),e.jsx(ae,{variant:"text",width:"25%",height:12})]})]})]})}function Bs(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] 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(ae,{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(ae,{variant:"circular",width:28,height:28}),e.jsx(ae,{variant:"text",width:100+r*15,height:14}),e.jsx(ae,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(ae,{variant:"rounded",width:60,height:22}),e.jsx(ae,{variant:"text",width:80,height:14})]},r))]})}function sr({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>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(ae,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(ae,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(ae,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(ae,{variant:"rounded",width:50,height:24})]},o))})}const Is={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 ht({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Is[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ht.displayName="Spinner";const ar={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Hs={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 _s({title:r,value:t,prefix:o,suffix:s,trend:a,trendLabel:l,icon:n,size:d="md",loading:i}){const f=Hs[d],p=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",m=(a==null?void 0:a.direction)==="up"?b.ArrowUpRight:(a==null?void 0:a.direction)==="down"?b.ArrowDownRight:b.Minus;return i?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:[n&&e.jsx("span",{className:"text-muted-foreground",children:n}),e.jsx("span",{className:"text-muted-foreground",style:ar,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),e.jsx("span",{className:"text-foreground",style:f,children:typeof t=="number"?t.toLocaleString():t}),s&&e.jsx("span",{className:"text-muted-foreground",style:ar,children:s})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${p}`,children:[e.jsx(m,{size:14}),e.jsxs("span",{style:bt,children:[a.value,"%"]}),l&&e.jsx("span",{className:"text-muted-foreground",style:pt,children:l})]})]})}function Ps({title:r,value:t,prefix:o,trend:s,trendLabel:a,icon:l,iconBg:n}){const d=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",i=(s==null?void 0:s.direction)==="up"?b.ArrowUpRight:(s==null?void 0:s.direction)==="down"?b.ArrowDownRight:b.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] 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:ar,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,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 ${d}`,children:[e.jsx(i,{size:12}),e.jsxs("span",{style:bt,children:[s.value,"%"]}),a&&e.jsx("span",{className:"text-muted-foreground",style:pt,children:a})]})]}),l&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${n||"bg-primary/10 text-primary"}`,children:l})]})})}const Os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},xt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function mt({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((l,n)=>{const d=n<t,i=n===t,f=l.disabled;return e.jsxs("div",{className:`flex gap-3 ${f?"opacity-50":""}`,onClick:()=>!f&&(s==null?void 0:s(n)),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 ${f?"cursor-not-allowed":s?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:xt,children:d?e.jsx(b.Check,{size:14}):n+1}),n<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${d?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${n===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:Os,children:l.title}),l.description&&e.jsx("span",{className:"text-muted-foreground block",style:vt,children:l.description})]})]},n)})}):e.jsx("div",{className:`flex items-center ${a}`,children:r.map((l,n)=>{const d=n<t,i=n===t;return e.jsxs("div",{className:`flex items-center ${n<r.length-1?"flex-1":""} ${l.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!l.disabled&&(s==null?void 0:s(n)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${l.disabled?"cursor-not-allowed":s?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:xt,children:d?e.jsx(b.Check,{size:14}):n+1}),e.jsx("span",{className:`text-center ${i?"text-foreground":"text-muted-foreground"}`,style:i?gt:vt,children:l.title})]}),n<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},n)})})}mt.displayName="Stepper";const Us={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Zs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ys={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"}},Gs={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Xs={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Ks({checked:r,onChange:t,label:o,description:s,size:a="md",disabled:l,color:n="primary"}){const d=Ys[a],i=Xs[a];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${l?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:l,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Gs[n]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:i.w,height:i.h,top:"50%",transform:`translateY(-50%) translateX(${r?i.on:2}px)`,left:0}})}),(o||s)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Us,children:o}),s&&e.jsx("span",{className:"text-muted-foreground block",style:Zs,children:s})]})]})}const qs={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"},Js={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qs={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 yt({children:r,color:t="default",size:o="md",icon:s,closable:a,onClose:l,className:n=""}){const d=qs[t],i=Js[o],f=Qs[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${i} ${n}`,style:f,children:[s&&e.jsx("span",{className:"flex-shrink-0",children:s}),r,a&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:l,children:e.jsx(b.X,{size:o==="sm"?10:12})})]})}yt.displayName="Tag";const Vs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Rs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ea={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function wt({tags:r,onChange:t,placeholder:o,disabled:s,maxTags:a,variant:l="default",className:n=""}){const[d,i]=c.useState(""),f=()=>{const m=d.trim();!m||r.includes(m)||a&&r.length>=a||(t([...r,m]),i(""))},p=m=>{t(r.filter(w=>w!==m))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${ea[l]} transition-colors focus-within:border-primary ${s?"opacity-50 pointer-events-none":""} ${n}`,children:[r.map(m=>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:Rs,children:[m,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>p(m),children:e.jsx(b.X,{size:12})})]},m)),e.jsx("input",{value:d,onChange:m=>i(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),f()),m.key==="Backspace"&&!d&&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:Vs,disabled:s})]})}wt.displayName="TagInput";const ra={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ta({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,l=n=>n==="completed"?"bg-chart-2 text-primary-foreground":n==="current"?"bg-primary text-primary-foreground":n==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((n,d)=>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 ${l(n.status)}`,children:n.icon||(n.status==="completed"?e.jsx(b.CheckCircle2,{size:a}):e.jsx(b.Circle,{size:a}))}),d<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:Nt,children:n.title}),n.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:n.time})]}),n.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lr,children:n.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((n,d)=>{const i=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${i?"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 ${l(n.status)}`,children:n.icon||(n.status==="completed"?e.jsx(b.CheckCircle2,{size:a}):e.jsx(b.Circle,{size:a}))}),d<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 ${i?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${i?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Nt,children:n.title}),n.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:n.time})]}),n.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:ra,children:n.description}),n.children&&e.jsx("div",{className:"mt-2",children:n.children})]})]},d)})})}const Oe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},oa={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"};function nr({brand:r,breadcrumbs:t,title:o,actions:s,user:a,height:l="56px",searchMode:n,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:i,notificationCount:f,onNotificationClick:p,onMobileMenuClick:m,onSidebarToggle:w,onAppSwitcherClick:h,onUserClick:g,onBreadcrumbClick:x,workspaceSwitcher:y,showSearch:S,className:F=""}){const u=n??(S?"bar":"none"),N=a!=null&&a.name?a.name.split(" ").map($=>$[0]).join("").slice(0,2).toUpperCase():"",v=(r==null?void 0:r.logoFull)??(r==null?void 0:r.logo);return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-4 gap-3 ${F}`,style:{height:l},children:[w&&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 flex-shrink-0",onClick:w,title:"Toggle sidebar",children:e.jsx(b.Menu,{size:18})}),!w&&m&&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 flex-shrink-0",onClick:m,children:e.jsx(b.Menu,{size:16})}),r&&v&&e.jsx("div",{className:"flex items-center flex-shrink-0 text-foreground",children:typeof v=="string"?e.jsx("img",{src:v,alt:r.name,style:{height:"40px",width:"auto"},className:"rounded-[var(--radius-sm)] object-contain"}):e.jsx("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:v})}),r&&!v&&e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Oe,children:r.name.charAt(0).toUpperCase()}),y&&e.jsx("div",{className:"flex items-center",children:y}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:oa,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Oe,children:t.map(($,z)=>e.jsxs(c.Fragment,{children:[z>0&&e.jsx(b.ChevronRight,{size:12}),$.href||x?e.jsx("span",{className:`cursor-pointer ${z===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>x==null?void 0:x($,z),children:$.label}):e.jsx("span",{className:z===t.length-1?"text-foreground":"",children:$.label})]},z))}),e.jsx("div",{className:"flex-1"}),u==="bar"&&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:i,children:[e.jsx(b.Search,{size:14}),e.jsx("span",{style:Oe,children:d})]}),u==="icon"&&e.jsx("button",{className:"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:i,title:"Search",children:e.jsx(b.Search,{size:16})}),s,p&&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:p,children:[e.jsx(b.Bell,{size:16}),f!==void 0&&f>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),h&&e.jsx("button",{className:"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,title:"Switch app",children:e.jsx(b.LayoutGrid,{size:16})}),a&&e.jsx("div",{className:"cursor-pointer flex-shrink-0",onClick:g,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:Oe,children:N})})]})}nr.displayName="TopNavbar";const sa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ct={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ir={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function St({title:r,items:t,selected:o,onToggle:s,search:a,onSearch:l,searchable:n}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] 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:Ct,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),n&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(b.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:a,onChange:d=>l(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),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:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&s(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
87
87
|
${o.has(d.id)?"bg-primary/10":"hover:bg-accent"}
|
|
88
|
-
${d.disabled?"opacity-40 pointer-events-none":""}`,style:
|
|
89
|
-
${o.has(d.id)?"bg-primary border-primary":"border-border"}`,children:o.has(d.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:d.label})]},d.id))]})]})}function
|
|
88
|
+
${d.disabled?"opacity-40 pointer-events-none":""}`,style:sa,children:[e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0
|
|
89
|
+
${o.has(d.id)?"bg-primary border-primary":"border-border"}`,children:o.has(d.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:d.label})]},d.id))]})]})}function aa({sourceTitle:r="Available",targetTitle:t="Selected",items:o,defaultTarget:s=[],searchable:a,value:l,onChange:n,loading:d=!1,error:i}){const[f,p]=c.useState(new Set(s)),m=l!==void 0?new Set(l):f,w=k=>{n&&n(Array.from(k)),l===void 0&&p(k)},[h,g]=c.useState(new Set),[x,y]=c.useState(new Set),[S,F]=c.useState(""),[u,N]=c.useState(""),v=o.filter(k=>!m.has(k.id)),$=o.filter(k=>m.has(k.id)),z=S?v.filter(k=>k.label.toLowerCase().includes(S.toLowerCase())):v,A=u?$.filter(k=>k.label.toLowerCase().includes(u.toLowerCase())):$,M=()=>{const k=new Set(m);h.forEach(E=>k.add(E)),w(k),g(new Set)},D=()=>{const k=new Set(m);x.forEach(E=>k.delete(E)),w(k),y(new Set)},T=()=>{w(new Set(o.filter(k=>!k.disabled).map(k=>k.id))),g(new Set)},W=()=>{w(new Set),y(new Set)},C=(k,E,B)=>{const O=new Set(E);O.has(k)?O.delete(k):O.add(k),B(O)};return i?e.jsx("div",{className:"flex items-center justify-center rounded-[var(--radius-md)] border border-border bg-card px-6 py-10 text-center",children:e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",color:"var(--destructive)"},children:i})}):d?e.jsx("div",{className:"flex items-stretch gap-3 flex-wrap opacity-60 pointer-events-none",children:[r,t].map(k=>e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30",children:e.jsx("span",{style:Ct,children:k})}),e.jsx("div",{className:"p-3 flex flex-col gap-2",children:[1,2,3,4].map(E=>e.jsx("div",{className:"h-8 rounded bg-muted/50 animate-pulse"},E))})]},k))}):e.jsxs("div",{className:"flex items-stretch gap-3 flex-wrap",children:[e.jsx(St,{title:r,items:z,selected:h,onToggle:k=>C(k,h,g),search:S,onSearch:F,searchable:a}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1.5 py-4",children:[e.jsx("button",{onClick:T,disabled:v.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(b.ChevronsRight,{size:14})}),e.jsx("button",{onClick:M,disabled:h.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(b.ChevronRight,{size:14})}),e.jsx("button",{onClick:D,disabled:x.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(b.ChevronLeft,{size:14})}),e.jsx("button",{onClick:W,disabled:$.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(b.ChevronsLeft,{size:14})})]}),e.jsx(St,{title:t,items:A,selected:x,onToggle:k=>C(k,x,y),search:u,onSearch:N,searchable:a})]})}const dr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function $t({node:r,level:t,expanded:o,selected:s,onToggle:a,onSelect:l,selectable:n,showLines:d}){const i=r.children&&r.children.length>0,f=o.has(r.id),p=s.has(r.id),m=i?f?e.jsx(b.FolderOpen,{size:14,className:"text-chart-5"}):e.jsx(b.Folder,{size:14,className:"text-chart-5"}):e.jsx(b.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
|
|
90
90
|
${r.disabled?"opacity-40 pointer-events-none":"cursor-pointer hover:bg-accent"}
|
|
91
|
-
${
|
|
91
|
+
${p?"bg-primary/10 text-primary":"text-foreground"}`,style:{paddingLeft:`${t*20+8}px`,...dr},onClick:()=>{i&&a(r.id),n&&l(r.id)},children:[i?e.jsx("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:f?e.jsx(b.ChevronDown,{size:12}):e.jsx(b.ChevronRight,{size:12})}):e.jsx("span",{className:"w-4"}),n&&e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0 ${p?"bg-primary border-primary":"border-border"}`,children:p&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"flex-shrink-0",children:r.icon||m}),e.jsx("span",{className:"truncate",children:r.label})]}),i&&f&&e.jsx("div",{className:d?"border-l border-border ml-[22px]":"",children:r.children.map(w=>e.jsx($t,{node:w,level:t+1,expanded:o,selected:s,onToggle:a,onSelect:l,selectable:n,showLines:d},w.id))})]})}function la({data:r,selectable:t,showLines:o,defaultExpanded:s,expandedItems:a,onExpandChange:l,selectedItems:n,onSelect:d,loading:i=!1,error:f,emptyMessage:p="No items"}){const[m,w]=c.useState(new Set(s||[])),[h,g]=c.useState(new Set),x=a!==void 0?new Set(a):m,y=n!==void 0?new Set(n):h,S=u=>{const N=new Set(x);N.has(u)?N.delete(u):N.add(u),l&&l(Array.from(N)),a===void 0&&w(N)},F=u=>{const N=new Set(y);N.has(u)?N.delete(u):N.add(u),d&&d(Array.from(N)),n===void 0&&g(N)};return f?e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card px-4 py-8 text-center",children:e.jsx("span",{style:{...dr,color:"var(--destructive)"},children:f})}):i?e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-2 px-3 flex flex-col gap-2",children:[1,2,3,4,5].map(u=>e.jsx("div",{className:"h-7 rounded bg-muted/50 animate-pulse",style:{width:`${60+u%3*15}%`}},u))}):e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-1",children:r.length===0?e.jsx("div",{className:"px-4 py-8 text-center text-muted-foreground",style:dr,children:p}):r.map(u=>e.jsx($t,{node:u,level:0,expanded:x,selected:y,onToggle:S,onSelect:F,selectable:t,showLines:o},u.id))})}const na={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},cr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},kt=c.createContext({name:""});function ia(){return c.useContext(kt)}function fr({htmlFor:r,required:t,children:o,className:s=""}){return e.jsxs("label",{htmlFor:r,className:`block text-foreground mb-1.5 ${s}`,style:na,children:[o,t&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]})}function zt({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-destructive ${t}`,style:cr,role:"alert",children:[e.jsx(b.AlertCircle,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Ft({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-chart-2 ${t}`,style:cr,role:"status",children:[e.jsx(b.CheckCircle2,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Lt({children:r,className:t=""}){return e.jsx("p",{className:`mt-1.5 text-muted-foreground ${t}`,style:cr,children:r})}function da({name:r,label:t,required:o,error:s,successMessage:a,helperText:l,layout:n="vertical",labelWidth:d="160px",children:i,className:f=""}){const p=n==="horizontal",m=s?e.jsx(zt,{message:s}):a?e.jsx(Ft,{message:a}):l?e.jsx(Lt,{children:l}):null;return e.jsx(kt.Provider,{value:{name:r,error:s},children:p?e.jsxs("div",{className:`flex items-start gap-4 ${f}`,children:[t&&e.jsx("div",{style:{width:d,flexShrink:0,paddingTop:"6px"},children:e.jsx(fr,{htmlFor:r,required:o,children:t})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[i,m]})]}):e.jsxs("div",{className:`${f}`,children:[t&&e.jsx(fr,{htmlFor:r,required:o,children:t}),i,m]})})}const ca={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},fa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ha={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ua={sm:"h-8",md:"h-10",lg:"h-12"},Mt={sm:14,md:16,lg:18};function pa({value:r,defaultValue:t=0,onChange:o,min:s,max:a,step:l=1,disabled:n,size:d="md",label:i,placeholder:f,error:p,className:m=""}){const[w,h]=c.useState(t),g=r??w,x=F=>{const u=Math.max(s??-1/0,Math.min(a??1/0,F));o&&o(u),r===void 0&&h(u)},y=s===void 0||g-l>=s,S=a===void 0||g+l<=a;return e.jsxs("div",{className:m,children:[i&&e.jsx("label",{className:"block text-foreground mb-1.5",style:ca,children:i}),e.jsxs("div",{className:`inline-flex items-center rounded-[var(--radius-md)] border ${p?"border-destructive":"border-border"} bg-background overflow-hidden ${n?"opacity-50 pointer-events-none":""}`,children:[e.jsx("button",{type:"button",onClick:()=>x(g-l),disabled:n||!y,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(b.Minus,{size:Mt[d]})}),e.jsx("input",{type:"number",value:g,placeholder:f,onChange:F=>{const u=parseFloat(F.target.value);isNaN(u)||x(u)},disabled:n,className:`w-20 text-center bg-transparent outline-none text-foreground ${ua[d]} [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,style:fa}),e.jsx("button",{type:"button",onClick:()=>x(g+l),disabled:n||!S,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(b.Plus,{size:Mt[d]})})]}),p&&e.jsx("p",{className:"mt-1.5 text-destructive",style:ha,children:p})]})}const ba={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},va={sm:"w-9 h-9",md:"w-11 h-11",lg:"w-14 h-14"};function xa({length:r=6,value:t,onChange:o,onComplete:s,disabled:a,error:l,size:n="md",label:d,masked:i,className:f=""}){const[p,m]=c.useState(()=>"".padEnd(r,"")),w=c.useRef([]),g=(t??p).padEnd(r,"").split("").slice(0,r),x=c.useCallback(u=>{o&&o(u),t===void 0&&m(u),u.replace(/ /g,"").length===r&&s&&s(u)},[o,s,t,r]),y=(u,N)=>{var z;if(!/^\d$/.test(N))return;const v=g.slice();v[u]=N;const $=v.join("");x($),u<r-1&&((z=w.current[u+1])==null||z.focus())},S=(u,N)=>{var v,$,z;if(N.key==="Backspace"){N.preventDefault();const A=g.slice();A[u]!==" "&&A[u]!==""?(A[u]=" ",x(A.join(""))):u>0&&(A[u-1]=" ",x(A.join("")),(v=w.current[u-1])==null||v.focus())}else N.key==="ArrowLeft"&&u>0?($=w.current[u-1])==null||$.focus():N.key==="ArrowRight"&&u<r-1&&((z=w.current[u+1])==null||z.focus())},F=u=>{var v;u.preventDefault();const N=u.clipboardData.getData("text").replace(/\D/g,"").slice(0,r);if(N){x(N.padEnd(r," "));const $=Math.min(N.length,r-1);(v=w.current[$])==null||v.focus()}};return e.jsxs("div",{className:f,children:[d&&e.jsx("label",{className:"block text-foreground mb-2",style:ba,children:d}),e.jsx("div",{className:"flex gap-2",onPaste:F,children:g.map((u,N)=>e.jsx("input",{ref:v=>{w.current[N]=v},type:i?"password":"text",inputMode:"numeric",maxLength:1,value:u===" "?"":u,disabled:a,onChange:v=>{const $=v.target.value;$&&y(N,$[$.length-1])},onKeyDown:v=>S(N,v),onFocus:v=>v.target.select(),className:`${va[n]} text-center rounded-[var(--radius-md)] border outline-none transition-all
|
|
92
92
|
${l?"border-destructive focus:ring-2 focus:ring-destructive/30":"border-border focus:border-primary focus:ring-2 focus:ring-primary/20"}
|
|
93
|
-
${
|
|
94
|
-
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},N))}),l&&e.jsx("p",{className:"mt-2 text-destructive",style:ps,children:l})]})}const xs={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},ys={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},ws={fontFamily:"var(--font-label, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-label)"};function Ns({title:r,subtitle:t,breadcrumb:o,actions:a,tabs:s,sticky:l=!1,className:i=""}){return e.jsxs("div",{className:`bg-card border-b border-border ${l?"sticky top-0 z-10":""} ${i}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:ws,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:xs,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:ys,children:t})]}),a&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:a})]})]}),s&&e.jsx("div",{className:"px-6",children:s})]})}const Ss={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ye={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function ks({config:r,value:t,onChange:o}){var u;const[a,s]=f.useState(!1),l=Array.isArray(t)?t:t?[t]:[],i=l.length>0,d=f.useCallback(b=>{if(r.type==="single"){const x=l[0]===b?null:b;o(r.key,x),s(!1)}else{const x=l.includes(b)?l.filter(w=>w!==b):[...l,b];o(r.key,x.length?x:null)}},[r,l,o]),n=l.length===1?(u=r.options.find(b=>b.value===l[0]))==null?void 0:u.label:l.length>1?`${r.label} (${l.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(b=>!b),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${i?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ss,children:[n,i&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground font-bold",style:{fontSize:"var(--text-label)",lineHeight:1},children:l.length}),e.jsx(g.ChevronDown,{size:14,className:`transition-transform ${a?"rotate-180":""}`})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!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(b=>{const x=l.includes(b.value);return e.jsxs("button",{type:"button",onClick:()=>d(b.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${x?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ye,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${x?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:x&&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"})})}),b.label]},b.value)})})]})]})}function $s({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:a,onFilterChange:s,className:l=""}){const[i,d]=f.useState({search:"",filters:{}}),n=a??i,u=f.useCallback(m=>{d(m),s==null||s(m)},[s]),b=f.useCallback(m=>{u({...n,search:m.target.value})},[n,u]),x=f.useCallback((m,y)=>{u({...n,filters:{...n.filters,[m]:y}})},[n,u]),w=f.useCallback(()=>{u({search:"",filters:{}})},[u]),h=Object.values(n.filters).filter(m=>m!==null&&(!Array.isArray(m)||m.length>0)).length,p=h>0||n.search&&n.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 ${l}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(g.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:n.search??"",onChange:b,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:Ye})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(g.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(m=>e.jsx(ks,{config:m,value:n.filters[m.key]??null,onChange:x},m.key)),h>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:Ye,children:[h," active"]}),p&&e.jsxs("button",{type:"button",onClick:w,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:Ye,children:[e.jsx(g.X,{size:12}),"Clear all"]})]})}const Mt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ve={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},fe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function zs({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[a,s]=f.useState(!1),l=f.useRef(null);f.useEffect(()=>{function d(n){l.current&&!l.current.contains(n.target)&&s(!1)}return a&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[a]);const i=r.filter(d=>d.hideable!==!1);return e.jsxs("div",{ref:l,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(d=>!d),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:ve,children:[e.jsx(g.Columns3,{size:14}),"Columns"]}),a&&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:i.map(d=>{const n=!t.has(d.key);return e.jsxs("button",{type:"button",onClick:()=>o(d.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:ve,children:[e.jsx("span",{children:d.header}),n&&e.jsx(g.Check,{size:13,className:"text-[var(--primary)]"})]},d.key)})})]})}function Fs({count:r,actions:t,selectedKeys:o,onClear:a}){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:Mt,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((s,l)=>e.jsxs("button",{type:"button",onClick:()=>s.onClick(o),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${s.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:{...ve,fontWeight:500},children:[s.icon,s.label]},l))}),e.jsx("button",{type:"button",onClick:a,className:"text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(g.X,{size:14})})]})}const Ws=[10,20,50,100];function Ls({meta:r,onPageChange:t}){const{page:o,pageSize:a,totalCount:s}=r,l=Math.max(1,Math.ceil(s/a)),i=s===0?0:(o-1)*a+1,d=Math.min(o*a,s),n=f.useMemo(()=>{const u=[];if(l<=7)for(let b=1;b<=l;b++)u.push(b);else{u.push(1),o>3&&u.push("...");for(let b=Math.max(2,o-1);b<=Math.min(l-1,o+1);b++)u.push(b);o<l-2&&u.push("..."),u.push(l)}return u},[o,l]);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:ve,children:[i,"–",d," of ",s.toLocaleString()]}),e.jsx("select",{value:a,onChange:u=>t(1,Number(u.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:ve,children:Ws.map(u=>e.jsxs("option",{value:u,children:[u," / page"]},u))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ur,{disabled:o===1,onClick:()=>t(o-1,a),label:"‹ Prev"}),n.map((u,b)=>u==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ve,children:"…"},`ellipsis-${b}`):e.jsx(ur,{active:u===o,onClick:()=>t(u,a),label:String(u)},u)),e.jsx(ur,{disabled:o===l,onClick:()=>t(o+1,a),label:"Next ›"})]})]})}function ur({label:r,active:t,disabled:o,onClick:a}){return e.jsx("button",{type:"button",onClick:a,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:{...ve,fontWeight:t?600:400},children:r})}function Ms({columns:r,data:t,rowKey:o="id",pagination:a,sortBy:s,sortOrder:l,onPageChange:i,onSortChange:d,selectable:n=!1,selectedRows:u,onSelectionChange:b,bulkActions:x=[],onRowClick:w,expandedRowRender:h,loading:p=!1,loadingRows:m=5,error:y,emptyMessage:k="No data found",emptyDescription:F,showColumnToggle:c=!1,size:N="md",stickyHeader:v=!1,className:$=""}){const[C,A]=f.useState(new Set(r.filter(_=>_.defaultHidden).map(_=>_.key))),L=f.useCallback(_=>{A(V=>{const J=new Set(V);return J.has(_)?J.delete(_):J.add(_),J})},[]),D=f.useMemo(()=>r.filter(_=>!C.has(_.key)),[r,C]),[T,M]=f.useState(new Set),S=u??T,z=f.useCallback(_=>{u||M(_);const V=t.filter(J=>_.has(J[o]));b==null||b(_,V)},[u,t,o,b]),E=f.useMemo(()=>t.map(_=>_[o]),[t,o]),I=E.length>0&&E.every(_=>S.has(_)),O=S.size>0&&!I,P=f.useCallback(()=>{z(I?new Set:new Set(E))},[I,E,z]),H=f.useCallback(_=>{const V=new Set(S);V.has(_)?V.delete(_):V.add(_),z(V)},[S,z]),[Q,B]=f.useState(new Set),X=f.useCallback(_=>{B(V=>{const J=new Set(V);return J.has(_)?J.delete(_):J.add(_),J})},[]),te=f.useCallback(_=>{d&&(s===_?d(_,l==="asc"?"desc":"asc"):d(_,"asc"))},[s,l,d]),K=f.useMemo(()=>{const _={};let V=0;n&&(V+=48),h&&(V+=40);for(const J of D)if(J.frozen){_[J.key]=V;const ne=typeof J.width=="number"?J.width:parseInt(J.width??"120");V+=isNaN(ne)?120:ne}return _},[D,n,h]),re=D.length+(n?1:0)+(h?1:0),U="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-md)] border border-[var(--border)] overflow-hidden ${$}`,children:[c&&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:C,onToggle:L})}),n&&S.size>0&&x.length>0&&e.jsx(Fs,{count:S.size,actions:x,selectedKeys:Array.from(S),onClear:()=>z(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:v?"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:[h&&e.jsx("th",{className:`${fe[N]} w-10`}),n&&e.jsx("th",{className:`${fe[N]} w-12`,children:e.jsx(Fe,{size:"sm",checked:I,indeterminate:O&&!I,onChange:P})}),D.map(_=>{const V=_.frozen&&_.key in K,J=s===_.key;return e.jsx("th",{className:`${fe[N]} text-${_.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${_.sortable&&d?"cursor-pointer hover:text-[var(--primary)]":""} ${V?U:""}`,style:{...Mt,width:_.width,minWidth:_.minWidth??80,...V?{left:K[_.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>_.sortable&&te(_.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[_.header,_.sortable&&d&&e.jsx("span",{className:J?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:J?l==="asc"?e.jsx(g.ChevronUp,{size:13}):e.jsx(g.ChevronDown,{size:13}):e.jsx(g.ChevronsUpDown,{size:12})})]})},_.key)})]})}),e.jsxs("tbody",{children:[y&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[N]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(g.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:hr,children:y})]})})}),!y&&p&&Array.from({length:m}).map((_,V)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[h&&e.jsx("td",{className:`${fe[N]} w-10`}),n&&e.jsx("td",{className:`${fe[N]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),D.map(J=>e.jsx("td",{className:`${fe[N]}`,children:e.jsx(zs,{width:J.align==="right"?"60%":J.align==="center"?"50%":"75%"})},J.key))]},`skel-${V}`)),!y&&!p&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[N]} 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(g.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:hr,children:k}),F&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ve,children:F})]})})}),!y&&!p&&t.map((_,V)=>{const J=_[o],ne=S.has(J),me=Q.has(J),Te=!!w||!!h;return e.jsxs(f.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${ne?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${Te?"cursor-pointer":""}`,onClick:()=>{w==null||w(_),h&&X(J)},children:[h&&e.jsx("td",{className:`${fe[N]} w-10 text-center`,onClick:q=>{q.stopPropagation(),X(J)},children:e.jsx(g.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${me?"rotate-90":""}`})}),n&&e.jsx("td",{className:`${fe[N]} w-12`,onClick:q=>q.stopPropagation(),children:e.jsx(Fe,{size:"sm",checked:ne,onChange:()=>H(J)})}),D.map(q=>{const xe=q.frozen&&q.key in K,Ne=xe?ne?"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:`${fe[N]} text-${q.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...hr,...xe?{left:K[q.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:q.render?q.render(_[q.key],_,V):_[q.key]},q.key)})]}),h&&me&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:re,className:"px-6 py-4",children:h(_)})})]},J??V)})]})]})}),a&&i&&!p&&!y&&e.jsx(Ls,{meta:a,onPageChange:i})]})}const We=["var(--chart-1, #32a9ff)","var(--chart-2, #22c55e)","var(--chart-3, #f59e0b)","var(--chart-4, #ef4444)","var(--chart-5, #a855f7)","var(--chart-6, #06b6d4)"];function ie(r,t){return r.color??We[t%We.length]}const le={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function br(r,t,o){return Math.max(t,Math.min(o,r))}function Ge(r){const t=Math.max(...r,0);if(t===0)return 10;const o=Math.pow(10,Math.floor(Math.log10(t)));return Math.ceil(t/o)*o}function gr(r,t){if(r.length===0)return"";if(!t||r.length<3)return r.map((a,s)=>`${s===0?"M":"L"}${a[0]},${a[1]}`).join(" ");let o=`M${r[0][0]},${r[0][1]}`;for(let a=1;a<r.length;a++){const s=r[a-1],l=r[a],i=s[0]+(l[0]-s[0])*.4,d=l[0]-(l[0]-s[0])*.4;o+=` C${i},${s[1]} ${d},${l[1]} ${l[0]},${l[1]}`}return o}function pr({x:r,y:t,label:o,items:a}){return e.jsx("foreignObject",{x:r,y:t,width:160,height:40+a.length*22,style:{overflow:"visible"},children:e.jsxs("div",{className:"bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_16px_rgba(0,0,0,0.12)] p-2 pointer-events-none",style:{width:"max-content",...le},children:[e.jsx("div",{className:"text-muted-foreground mb-1",children:o}),a.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5 text-foreground",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s.color}}),e.jsxs("span",{className:"truncate",children:[s.name,":"]}),e.jsx("span",{className:"font-medium ml-auto pl-2",children:s.value.toLocaleString()})]},s.name))]})})}function Dt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:l=!0,showLegend:i=!0,showTooltip:d=!0,showDots:n=!0,smooth:u=!1,className:b=""}){f.useId();const x=f.useRef(null),[w,h]=f.useState(null);if(!r.length||!r[0].data.length)return null;const p=r[0].data.map(T=>T.label),m=r.flatMap(T=>T.data.map(M=>M.value)),y=Ge(m),k=0,F={top:12,right:16,bottom:a?36:12,left:s?48:16},c=o??600,N=t,v=c-F.left-F.right,$=N-F.top-F.bottom,C=p.length>1?v/(p.length-1):v;function A(T){return F.left+T*C}function L(T){return F.top+$-(T-k)/(y-k||1)*$}const D=Array.from({length:5},(T,M)=>k+M/4*(y-k));return e.jsxs("div",{className:`w-full ${b}`,children:[e.jsxs("svg",{ref:x,width:o?c:"100%",height:N,viewBox:`0 0 ${c} ${N}`,onMouseLeave:()=>h(null),children:[l&&D.map((T,M)=>e.jsx("line",{x1:F.left,y1:L(T),x2:c-F.right,y2:L(T),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},M)),s&&D.map((T,M)=>e.jsx("text",{x:F.left-8,y:L(T)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:T>=1e3?`${(T/1e3).toFixed(1)}k`:T},M)),a&&p.map((T,M)=>{const S=Math.max(1,Math.floor(p.length/8));return M%S!==0&&M!==p.length-1?null:e.jsx("text",{x:A(M),y:N-F.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:T},M)}),r.map((T,M)=>{const S=ie(T,M),z=T.data.map((I,O)=>[A(O),L(I.value)]),E=gr(z,u);return e.jsxs("g",{children:[e.jsx("path",{d:E,fill:"none",stroke:S,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),n&&z.map(([I,O],P)=>e.jsx("circle",{cx:I,cy:O,r:3,fill:"var(--card)",stroke:S,strokeWidth:2},P))]},M)}),d&&p.map((T,M)=>e.jsx("rect",{x:A(M)-C/2,y:F.top,width:C,height:$,fill:"transparent",onMouseEnter:()=>h({x:A(M),y:F.top,labelIdx:M})},M)),w&&e.jsx("line",{x1:A(w.labelIdx),y1:F.top,x2:A(w.labelIdx),y2:F.top+$,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),w&&d&&e.jsx(pr,{x:br(A(w.labelIdx)+8,F.left,c-180),y:F.top,label:p[w.labelIdx],items:r.map((T,M)=>{var S;return{name:T.name,value:((S=T.data[w.labelIdx])==null?void 0:S.value)??0,color:ie(T,M)}})})]}),i&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((T,M)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(T,M)}}),e.jsx("span",{className:"text-muted-foreground",children:T.name})]},M))})]})}Dt.displayName="LineChart";function At({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:l=!0,showLegend:i=!0,showTooltip:d=!0,showDots:n=!1,smooth:u=!0,fillOpacity:b=.15,className:x=""}){const w=f.useId(),[h,p]=f.useState(null);if(!r.length||!r[0].data.length)return null;const m=r[0].data.map(S=>S.label),y=r.flatMap(S=>S.data.map(z=>z.value)),k=Ge(y),F=0,c={top:12,right:16,bottom:a?36:12,left:s?48:16},N=o??600,v=t,$=N-c.left-c.right,C=v-c.top-c.bottom,A=m.length>1?$/(m.length-1):$;function L(S){return c.left+S*A}function D(S){return c.top+C-(S-F)/(k-F||1)*C}const T=Array.from({length:5},(S,z)=>F+z/4*(k-F)),M=c.top+C;return e.jsxs("div",{className:`w-full ${x}`,children:[e.jsxs("svg",{width:o?N:"100%",height:v,viewBox:`0 0 ${N} ${v}`,onMouseLeave:()=>p(null),children:[e.jsx("defs",{children:r.map((S,z)=>e.jsxs("linearGradient",{id:`${w}-grad-${z}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ie(S,z),stopOpacity:b*4}),e.jsx("stop",{offset:"100%",stopColor:ie(S,z),stopOpacity:0})]},z))}),l&&T.map((S,z)=>e.jsx("line",{x1:c.left,y1:D(S),x2:N-c.right,y2:D(S),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},z)),s&&T.map((S,z)=>e.jsx("text",{x:c.left-8,y:D(S)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:S>=1e3?`${(S/1e3).toFixed(1)}k`:S},z)),a&&m.map((S,z)=>{const E=Math.max(1,Math.floor(m.length/8));return z%E!==0&&z!==m.length-1?null:e.jsx("text",{x:L(z),y:v-c.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:S},z)}),r.map((S,z)=>{const E=ie(S,z),I=S.data.map((H,Q)=>[L(Q),D(H.value)]),O=gr(I,u),P=O+` L${I[I.length-1][0]},${M} L${I[0][0]},${M} Z`;return e.jsxs("g",{children:[e.jsx("path",{d:P,fill:`url(#${w}-grad-${z})`}),e.jsx("path",{d:O,fill:"none",stroke:E,strokeWidth:2,strokeLinecap:"round"}),n&&I.map(([H,Q],B)=>e.jsx("circle",{cx:H,cy:Q,r:3,fill:"var(--card)",stroke:E,strokeWidth:2},B))]},z)}),d&&m.map((S,z)=>e.jsx("rect",{x:L(z)-A/2,y:c.top,width:A,height:C,fill:"transparent",onMouseEnter:()=>p({x:L(z),y:c.top,labelIdx:z})},z)),h&&e.jsx("line",{x1:L(h.labelIdx),y1:c.top,x2:L(h.labelIdx),y2:c.top+C,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),h&&e.jsx(pr,{x:br(L(h.labelIdx)+8,c.left,N-180),y:c.top,label:m[h.labelIdx],items:r.map((S,z)=>{var E;return{name:S.name,value:((E=S.data[h.labelIdx])==null?void 0:E.value)??0,color:ie(S,z)}})})]}),i&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((S,z)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(S,z)}}),e.jsx("span",{className:"text-muted-foreground",children:S.name})]},z))})]})}At.displayName="AreaChart";function jt({series:r,height:t=240,width:o,showXAxis:a=!0,showYAxis:s=!0,showGrid:l=!0,showLegend:i=!0,showTooltip:d=!0,stacked:n=!1,radius:u=4,className:b=""}){const[x,w]=f.useState(null);if(!r.length||!r[0].data.length)return null;const h=r[0].data.map(M=>M.label);let p;n?p=Ge(h.map((M,S)=>r.reduce((z,E)=>{var I;return z+(((I=E.data[S])==null?void 0:I.value)??0)},0))):p=Ge(r.flatMap(M=>M.data.map(S=>S.value)));const m={top:12,right:16,bottom:a?36:12,left:s?48:16},y=o??600,k=t,F=y-m.left-m.right,c=k-m.top-m.bottom,N=F/h.length,v=N*.2,$=N-v*2,C=n?$:$/r.length;function A(M){return m.top+c-M/p*c}function L(M){return M/p*c}function D(M){return m.left+M*N+v}const T=Array.from({length:5},(M,S)=>S/4*p);return e.jsxs("div",{className:`w-full ${b}`,children:[e.jsxs("svg",{width:o?y:"100%",height:k,viewBox:`0 0 ${y} ${k}`,onMouseLeave:()=>w(null),children:[l&&T.map((M,S)=>e.jsx("line",{x1:m.left,y1:A(M),x2:y-m.right,y2:A(M),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},S)),s&&T.map((M,S)=>e.jsx("text",{x:m.left-8,y:A(M)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:M>=1e3?`${(M/1e3).toFixed(1)}k`:M},S)),a&&h.map((M,S)=>e.jsx("text",{x:D(S)+$/2,y:k-m.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:M},S)),h.map((M,S)=>{if(n){let z=m.top+c;return e.jsx("g",{children:r.map((E,I)=>{var V;const O=((V=E.data[S])==null?void 0:V.value)??0,P=L(O),H=z-P;z=H;const Q=ie(E,I),B=I===r.length-1,X=I===0,te=u,K=D(S),re=$,U=P,_=B&&X?`M${K},${H+te} Q${K},${H} ${K+te},${H} L${K+re-te},${H} Q${K+re},${H} ${K+re},${H+te} L${K+re},${H+U} L${K},${H+U} Z`:B?`M${K},${H+te} Q${K},${H} ${K+te},${H} L${K+re-te},${H} Q${K+re},${H} ${K+re},${H+te} L${K+re},${H+U} L${K},${H+U} Z`:`M${K},${H} L${K+re},${H} L${K+re},${H+U} L${K},${H+U} Z`;return e.jsx("path",{d:_,fill:Q},I)})},S)}else return e.jsx("g",{children:r.map((z,E)=>{var X;const I=((X=z.data[S])==null?void 0:X.value)??0,O=L(I),P=D(S)+E*C,H=A(I),Q=ie(z,E),B=Math.min(u,C/2);return e.jsx("path",{d:`M${P},${H+B} Q${P},${H} ${P+B},${H} L${P+C-B},${H} Q${P+C},${H} ${P+C},${H+B} L${P+C},${H+O} L${P},${H+O} Z`,fill:Q},E)})},S)}),d&&h.map((M,S)=>e.jsx("rect",{x:D(S),y:m.top,width:$,height:c,fill:"transparent",style:{cursor:"default"},onMouseEnter:()=>w({x:D(S)+$/2,y:m.top,labelIdx:S})},S)),x&&e.jsx(pr,{x:br(x.x+8,m.left,y-180),y:m.top,label:h[x.labelIdx],items:r.map((M,S)=>{var z;return{name:M.name,value:((z=M.data[x.labelIdx])==null?void 0:z.value)??0,color:ie(M,S)}})})]}),i&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((M,S)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:ie(M,S)}}),e.jsx("span",{className:"text-muted-foreground",children:M.name})]},S))})]})}jt.displayName="BarChart";function Et({data:r,size:t=200,innerRatio:o=.6,centerLabel:a,centerValue:s,showLegend:l=!0,showTooltip:i=!0,className:d=""}){const[n,u]=f.useState(null),b=r.reduce((c,N)=>c+N.value,0);if(b===0||r.length===0)return null;const x=t/2,w=t/2,h=t/2-4,p=h*o;let m=-Math.PI/2;const y=r.map((c,N)=>{const v=c.value/b,$=m,C=m+v*2*Math.PI;m=C;const A=x+h*Math.cos($),L=w+h*Math.sin($),D=x+h*Math.cos(C),T=w+h*Math.sin(C),M=x+p*Math.cos(C),S=w+p*Math.sin(C),z=x+p*Math.cos($),E=w+p*Math.sin($),I=v>.5?1:0;return{path:[`M${A},${L}`,`A${h},${h} 0 ${I} 1 ${D},${T}`,`L${M},${S}`,`A${p},${p} 0 ${I} 0 ${z},${E}`,"Z"].join(" "),color:c.color??We[N%We.length],ratio:v,d:c,i:N}}),k=s??b.toLocaleString(),F=n!==null?r[n]:null;return e.jsxs("div",{className:`flex items-center gap-6 ${d}`,children:[e.jsx("div",{className:"relative flex-shrink-0",children:e.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[y.map(c=>e.jsx("path",{d:c.path,fill:c.color,opacity:n===null||n===c.i?1:.4,style:{transition:"opacity 0.15s"},onMouseEnter:()=>u(c.i),onMouseLeave:()=>u(null)},c.i)),o>0&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x,y:w-6,textAnchor:"middle",fill:"var(--foreground)",style:{...le,fontWeight:"700",fontSize:"18px"},children:F?F.value.toLocaleString():k}),(a||F)&&e.jsx("text",{x,y:w+12,textAnchor:"middle",fill:"var(--muted-foreground)",style:{...le,fontSize:"var(--text-caption)"},children:F?F.label:a})]})]})}),l&&e.jsx("div",{className:"flex flex-col gap-2",children:r.map((c,N)=>e.jsxs("div",{className:"flex items-center gap-2 cursor-default",style:le,onMouseEnter:()=>u(N),onMouseLeave:()=>u(null),children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:c.color??We[N%We.length]}}),e.jsx("span",{className:"text-foreground",children:c.label}),e.jsxs("span",{className:"text-muted-foreground ml-auto pl-4",children:[(c.value/b*100).toFixed(1),"%"]})]},N))})]})}Et.displayName="DonutChart";function Tt({values:r,type:t="line",width:o=80,height:a=32,color:s,showValue:l=!1,trend:i,className:d=""}){if(!r.length)return null;const n=Math.min(...r),b=Math.max(...r)-n||1,x=r[r.length-1]>r[0]?"up":r[r.length-1]<r[0]?"down":"neutral",w=i??x,p=s??(w==="up"?"var(--chart-1, #22c55e)":w==="down"?"var(--chart-4, #ef4444)":"var(--muted-foreground)"),m=2,y=o-m*2,k=a-m*2;function F(C){return m+C/(r.length-1||1)*y}function c(C){return m+k-(C-n)/b*k}if(t==="bar"){const C=y/r.length-1;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsx("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:r.map((A,L)=>{const D=(A-n)/b*k;return e.jsx("rect",{x:m+L*(y/r.length),y:m+k-D,width:C,height:D,fill:p,rx:1,opacity:L===r.length-1?1:.5},L)})}),l&&e.jsx("span",{style:{...le,color:p},children:r[r.length-1].toLocaleString()})]})}const N=r.map((C,A)=>[F(A),c(C)]),v=gr(N,!1),$=v+` L${N[N.length-1][0]},${m+k} L${N[0][0]},${m+k} Z`;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsxs("svg",{width:o,height:a,viewBox:`0 0 ${o} ${a}`,children:[t==="area"&&e.jsx("path",{d:$,fill:p,fillOpacity:.15}),e.jsx("path",{d:v,fill:"none",stroke:p,strokeWidth:1.5,strokeLinecap:"round"}),e.jsx("circle",{cx:N[N.length-1][0],cy:N[N.length-1][1],r:2,fill:p})]}),l&&e.jsx("span",{style:{...le,color:p},children:r[r.length-1].toLocaleString()})]})}Tt.displayName="MiniSparkline";function ge(r){const t=new Date(r);return t.setHours(0,0,0,0),t}function pe(r){const t=new Date(r);return t.setHours(23,59,59,999),t}const Ds=[{label:"Today",value:"today",range:()=>{const r=new Date;return{from:ge(r),to:pe(r)}}},{label:"Yesterday",value:"yesterday",range:()=>{const r=new Date;return r.setDate(r.getDate()-1),{from:ge(r),to:pe(r)}}},{label:"Last 7 days",value:"last7",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-6),{from:ge(t),to:pe(r)}}},{label:"Last 30 days",value:"last30",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-29),{from:ge(t),to:pe(r)}}},{label:"This month",value:"thisMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth(),1),o=new Date(r.getFullYear(),r.getMonth()+1,0);return{from:ge(t),to:pe(o)}}},{label:"Last month",value:"lastMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth()-1,1),o=new Date(r.getFullYear(),r.getMonth(),0);return{from:ge(t),to:pe(o)}}},{label:"Custom range",value:"custom",range:()=>({from:null,to:null})}],As=["January","February","March","April","May","June","July","August","September","October","November","December"],js=["Su","Mo","Tu","We","Th","Fr","Sa"];function vr(r){return r?r.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):""}function mr(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function Es(r,t){const o=[],a=new Date(r,t,1),s=new Date(a);s.setDate(s.getDate()-s.getDay());for(let l=0;l<42;l++)o.push(new Date(s)),s.setDate(s.getDate()+1);return o}const Ts={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},It={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Bt={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Is={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function _t({month:r,year:t,range:o,hovered:a,onHover:s,onSelect:l,onPrevMonth:i,onNextMonth:d,minDate:n,maxDate:u}){const b=Es(t,r);function x(h){const p=o.from,m=o.to??a;if(!p||!m)return!1;const[y,k]=p<=m?[p,m]:[m,p];return h>y&&h<k}function w(h){return!!(n&&h<ge(n)||u&&h>pe(u))}return e.jsxs("div",{className:"select-none flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:i,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(g.ChevronLeft,{size:14})}),e.jsxs("span",{className:"text-foreground",style:Bt,children:[As[r]," ",t]}),e.jsx("button",{type:"button",onClick:d,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(g.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:js.map(h=>e.jsx("div",{className:"h-8 flex items-center justify-center text-muted-foreground",style:It,children:h},h))}),e.jsx("div",{className:"grid grid-cols-7",children:b.map((h,p)=>{const m=h.getMonth()===r,y=o.from?mr(h,o.from):!1,k=o.to?mr(h,o.to):a&&o.from?mr(h,a):!1,F=x(h),c=w(h);return e.jsx("button",{type:"button",disabled:c,onMouseEnter:()=>!c&&s(h),onMouseLeave:()=>s(null),onClick:()=>!c&&l(h),className:["h-8 w-full flex items-center justify-center text-center transition-colors",c?"opacity-30 cursor-not-allowed":"cursor-pointer",m?"":"text-muted-foreground/40",y||k?"bg-primary text-primary-foreground rounded-[var(--radius-md)] font-semibold":F?"bg-primary/10 text-primary":c?"":"hover:bg-muted/40 rounded-[var(--radius-md)]"].filter(Boolean).join(" "),style:It,children:h.getDate()},p)})})]})}function Ht({value:r,onChange:t,presets:o=["today","last7","last30","custom"],placeholder:a="Select date range",size:s="md",minDate:l,maxDate:i,clearable:d=!0,disabled:n=!1,className:u=""}){const b=new Date,[x,w]=f.useState(!1),[h,p]=f.useState({from:null,to:null}),[m,y]=f.useState(null),[k,F]=f.useState(void 0),[c,N]=f.useState(b.getMonth()),[v,$]=f.useState(b.getFullYear()),[C,A]=f.useState("from"),[L,D]=f.useState({top:0,left:0,width:0}),T=f.useRef(null),M=f.useRef(null),S=r??h,z=(c+1)%12,E=c===11?v+1:v;f.useEffect(()=>{function B(X){T.current&&!T.current.contains(X.target)&&w(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]),f.useEffect(()=>{if(!x||!M.current)return;const B=()=>{const X=M.current.getBoundingClientRect();D({top:X.bottom+4,left:X.left,width:X.width})};return B(),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[x]);function I(B){if(B.value==="custom"){F("custom");return}const X=B.range();p(X),t==null||t(X,B.value),F(B.value),w(!1)}function O(B){if(C==="from")p({from:ge(B),to:null}),A("to");else{const X=h.from,[te,K]=B>=X?[X,pe(B)]:[ge(B),pe(X)],re={from:te,to:K};p(re),t==null||t(re,"custom"),F("custom"),A("from"),w(!1)}}function P(B){B.stopPropagation();const X={from:null,to:null};p(X),t==null||t(X,void 0),F(void 0)}const H=S.from&&S.to?`${vr(S.from)} – ${vr(S.to)}`:S.from?`${vr(S.from)} – ...`:"",Q=Ds.filter(B=>o.includes(B.value));return e.jsxs("div",{ref:T,className:`relative inline-block ${u}`,children:[e.jsxs("button",{ref:M,type:"button",disabled:n,onClick:()=>!n&&w(!x),className:["flex items-center gap-2 border border-border bg-card text-left rounded-[var(--radius-md)] transition-colors w-full min-w-[260px]",Is[s],x?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",n?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ts,children:[e.jsx(g.Calendar,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:H?"text-foreground flex-1":"text-muted-foreground flex-1",children:H||a}),d&&S.from&&e.jsx("span",{role:"button",tabIndex:0,onClick:P,onKeyDown:B=>B.key==="Enter"&&P(B),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer flex-shrink-0",children:e.jsx(g.X,{size:12})})]}),x&&Ce.createPortal(e.jsxs("div",{className:"fixed z-[9999] bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] flex overflow-y-auto",style:{top:L.top,left:L.left,minWidth:"620px",maxHeight:"calc(100vh - 120px)"},children:[e.jsx("div",{className:"w-36 border-r border-border py-2 flex flex-col gap-0.5 flex-shrink-0",children:Q.map(B=>e.jsx("button",{type:"button",onClick:()=>I(B),className:["w-full text-left px-3 py-1.5 rounded-none transition-colors",k===B.value?"bg-primary/10 text-primary":"text-foreground hover:bg-muted/30"].join(" "),style:Bt,children:B.label},B.value))}),e.jsxs("div",{className:"flex gap-4 p-4 flex-1 min-w-0",children:[e.jsx(_t,{month:c,year:v,range:S,hovered:m,onHover:y,onSelect:O,onPrevMonth:()=>{c===0?(N(11),$(v-1)):N(c-1)},onNextMonth:()=>{c===11?(N(0),$(v+1)):N(c+1)},minDate:l,maxDate:i}),e.jsx("div",{className:"w-px bg-border"}),e.jsx(_t,{month:z,year:E,range:S,hovered:m,onHover:y,onSelect:O,onPrevMonth:()=>{c===0?(N(11),$(v-1)):N(c-1)},onNextMonth:()=>{c===11?(N(0),$(v+1)):N(c+1)},minDate:l,maxDate:i})]})]}),document.body)]})}Ht.displayName="DateRangePicker";function he(r){return String(r).padStart(2,"0")}function Pt(r,t,o){if(t==="12h"){const a=r.hours%12||12,s=r.hours<12?"AM":"PM";return o?`${he(a)}:${he(r.minutes)}:${he(r.seconds??0)} ${s}`:`${he(a)}:${he(r.minutes)} ${s}`}return o?`${he(r.hours)}:${he(r.minutes)}:${he(r.seconds??0)}`:`${he(r.hours)}:${he(r.minutes)}`}const Ot={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Ue={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",fontVariantNumeric:"tabular-nums"},Yt={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Xe({options:r,value:t,onChange:o,label:a}){const s=r.indexOf(t);return e.jsxs("div",{className:"flex flex-col items-center gap-1 w-12",children:[e.jsx("button",{type:"button",onClick:()=>{const l=r[(s-1+r.length)%r.length];o(l)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(g.ChevronUp,{size:14})}),e.jsx("div",{className:"text-foreground w-full text-center px-1 py-1 rounded-[var(--radius-md)] bg-muted/20",style:Ue,children:he(t)}),e.jsx("button",{type:"button",onClick:()=>{const l=r[(s+1)%r.length];o(l)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(g.ChevronDown,{size:14})}),e.jsx("span",{className:"text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:a})]})}function xr({value:r,onChange:t,format:o="24h",showSeconds:a=!1,minuteStep:s=1,placeholder:l="Select time",size:i="md",disabled:d=!1,className:n=""}){const[u,b]=f.useState(!1),[x,w]=f.useState({hours:0,minutes:0,seconds:0}),h=f.useRef(null),p=r??x,m=o==="12h"?Array.from({length:12},(L,D)=>D+1):Array.from({length:24},(L,D)=>D),y=Array.from({length:Math.ceil(60/s)},(L,D)=>D*s),k=Array.from({length:60},(L,D)=>D),F=["AM","PM"];f.useEffect(()=>{function L(D){h.current&&!h.current.contains(D.target)&&b(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);function c(L){const D={...p,...L};w(D),t==null||t(D)}const N=Pt(p,o,a),v=r!==void 0||x.hours!==0||x.minutes!==0,$=o==="12h"?p.hours%12||12:p.hours,C=p.hours<12;function A(L,D){let T=L%12;D||(T+=12),c({hours:T})}return e.jsxs("div",{ref:h,className:`relative inline-block ${n}`,children:[e.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&b(!u),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[120px]",Yt[i],u?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ot,children:[e.jsx(g.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:v?"text-foreground":"text-muted-foreground",children:v?N:l})]}),u&&e.jsx("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[o==="12h"?e.jsx(Xe,{options:m,value:$,onChange:L=>A(L,C),label:"Hour"}):e.jsx(Xe,{options:m,value:p.hours,onChange:L=>c({hours:L}),label:"Hour"}),e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:y,value:p.minutes,onChange:L=>c({minutes:L}),label:"Min"}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ue,children:":"}),e.jsx(Xe,{options:k,value:p.seconds??0,onChange:L=>c({seconds:L}),label:"Sec"})]}),o==="12h"&&e.jsxs("div",{className:"flex flex-col gap-1 ml-1",children:[e.jsx("div",{className:"h-5"}),F.map(L=>e.jsx("button",{type:"button",onClick:()=>A($,L==="AM"),className:["px-2 py-1 rounded-[var(--radius-md)] transition-colors",L==="AM"===C?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted/30 cursor-pointer"].join(" "),style:Ue,children:L},L))]})]})})]})}xr.displayName="TimePicker";function Gt({value:r,onChange:t,format:o="24h",showSeconds:a=!1,placeholder:s="Select date & time",size:l="md",minDate:i,maxDate:d,disabled:n=!1,className:u=""}){const[b,x]=f.useState(!1),[w,h]=f.useState(r??new Date),p=f.useRef(null),m=r??w,y=new Date,[k,F]=f.useState(m.getMonth()),[c,N]=f.useState(m.getFullYear());f.useEffect(()=>{function z(E){p.current&&!p.current.contains(E.target)&&x(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);function v(z){h(z),t==null||t(z)}function $(z){const E=new Date(z);E.setHours(m.getHours(),m.getMinutes(),m.getSeconds(),0),v(E)}function C(z){const E=new Date(m);E.setHours(z.hours,z.minutes,z.seconds??0,0),v(E)}const A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],L=["Su","Mo","Tu","We","Th","Fr","Sa"];function D(){const z=[],E=new Date(c,k,1),I=new Date(E);I.setDate(I.getDate()-I.getDay());for(let O=0;O<42;O++)z.push(new Date(I)),I.setDate(I.getDate()+1);return z}const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},M={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},S=`${m.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})} ${Pt({hours:m.getHours(),minutes:m.getMinutes(),seconds:m.getSeconds()},o,a)}`;return e.jsxs("div",{ref:p,className:`relative inline-block ${u}`,children:[e.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&x(!b),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[200px]",Yt[l],b?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",n?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ot,children:[e.jsx(g.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:S})]}),b&&e.jsxs("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4 flex gap-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:()=>{k===0?(F(11),N(c-1)):F(k-1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(g.ChevronLeft,{size:14})}),e.jsxs("span",{style:M,children:[A[k]," ",c]}),e.jsx("button",{type:"button",onClick:()=>{k===11?(F(0),N(c+1)):F(k+1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(g.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:L.map(z=>e.jsx("div",{className:"text-center text-muted-foreground",style:T,children:z},z))}),e.jsx("div",{className:"grid grid-cols-7 gap-y-0.5",children:D().map((z,E)=>{const I=z.getMonth()===k,O=r?z.toDateString()===r.toDateString():z.toDateString()===w.toDateString(),P=z.toDateString()===y.toDateString();return e.jsx("button",{type:"button",onClick:()=>$(z),className:["h-7 w-full text-center transition-colors rounded-[var(--radius-md)] cursor-pointer",I?"":"text-muted-foreground/40",O?"bg-primary text-primary-foreground font-semibold":P?"border border-primary text-primary":"hover:bg-muted/40"].filter(Boolean).join(" "),style:T,children:z.getDate()},E)})})]}),e.jsx("div",{className:"w-px bg-border"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:T,children:"Time"}),e.jsx(xr,{value:{hours:m.getHours(),minutes:m.getMinutes(),seconds:m.getSeconds()},onChange:C,format:o,showSeconds:a,size:"sm"})]})]})]})}Gt.displayName="DateTimePicker";const Bs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_s={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},Hs={fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},Ps={sm:"p-3 gap-2.5 rounded-[var(--radius-md)]",md:"p-4 gap-3 rounded-[var(--radius-md)]",lg:"p-5 gap-4 rounded-[var(--radius-md)]"},Os={sm:"w-8 h-8 rounded-[var(--radius-sm)]",md:"w-10 h-10 rounded-[var(--radius-md)]",lg:"w-12 h-12 rounded-[var(--radius-md)] text-lg"};function Ut({value:r,title:t,description:o,icon:a,badge:s,selected:l=!1,disabled:i=!1,showArrow:d=!0,showCheck:n=!1,size:u="md",layout:b="horizontal",onClick:x,className:w=""}){const h=b==="vertical";return e.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&(x==null?void 0:x(r)),className:["w-full text-left border transition-all duration-150",Ps[u],h?"flex flex-col items-center text-center":"flex items-center",l?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/20",i?"opacity-50 cursor-not-allowed":"cursor-pointer",w].filter(Boolean).join(" "),"aria-pressed":l,children:[a&&e.jsx("div",{className:[Os[u],"flex items-center justify-center flex-shrink-0",l?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:a}),e.jsxs("div",{className:`flex-1 min-w-0 ${h?"mt-2":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Bs,children:t}),s&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:Hs,children:s})]}),o&&e.jsx("p",{className:`text-muted-foreground mt-0.5 ${h?"line-clamp-2":"truncate"}`,style:_s,children:o})]}),!h&&e.jsx("div",{className:"flex-shrink-0 ml-auto pl-2",children:n&&l?e.jsx("span",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(g.Check,{size:12})}):d?e.jsx(g.ChevronRight,{size:16,className:l?"text-primary":"text-muted-foreground"}):null}),h&&l&&e.jsx("div",{className:"mt-2 w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(g.Check,{size:12})})]})}Ut.displayName="ChoiceCard";function Xt({value:r,onChange:t,layout:o="horizontal",size:a="md",children:s,className:l=""}){return e.jsx("div",{className:["grid gap-3",o==="vertical"?"grid-cols-2 sm:grid-cols-3":"grid-cols-1",l].join(" "),role:"group",children:f.Children.map(s,i=>f.isValidElement(i)?f.cloneElement(i,{selected:r===i.props.value,onClick:d=>t==null?void 0:t(d),layout:o,size:a}):i)})}Xt.displayName="ChoiceCardGroup";const Ys={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Gs={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},Us={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Xs={sm:"p-3",md:"p-4",lg:"p-5"},Ks={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12"},Zs={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-2 lg:grid-cols-4"};function Kt({options:r,value:t,onChange:o,columns:a=2,layout:s="grid",size:l="md",name:i,className:d=""}){const n=i??`radio-card-${Math.random().toString(36).slice(2,7)}`;return e.jsx("div",{className:[s==="grid"?`grid gap-3 ${Zs[a]}`:"flex flex-col gap-2",d].join(" "),role:"radiogroup",children:r.map(u=>{const b=t===u.value,x=u.disabled??!1;return e.jsxs("label",{className:["relative flex items-start gap-3 border rounded-[var(--radius-md)] cursor-pointer transition-all duration-150",Xs[l],b?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/10",x?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",name:n,value:u.value,checked:b,disabled:x,onChange:()=>!x&&(o==null?void 0:o(u.value)),className:"sr-only"}),e.jsx("div",{className:["flex-shrink-0 mt-0.5 w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors",b?"border-primary bg-primary":"border-border bg-transparent"].join(" "),children:b&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-foreground"})}),u.icon&&e.jsx("div",{className:[Ks[l],"flex-shrink-0 flex items-center justify-center rounded-[var(--radius-md)]",b?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:u.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Ys,children:u.title}),u.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:Us,children:u.badge})]}),u.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Gs,children:u.description})]})]},u.value)})})}Kt.displayName="RadioCard";function qs(){return Math.random().toString(36).slice(2,9)}function Js(r={}){return{id:qs(),values:{...r}}}const Qs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Zt={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function qt({columns:r,value:t,onChange:o,defaultRow:a={},minRows:s=0,maxRows:l,addLabel:i="Add row",sortable:d=!1,disabled:n=!1,className:u=""}){const[b,x]=f.useState(()=>t??[]),w=t??b,h=v=>{x(v),o==null||o(v)},p=()=>{l!==void 0&&w.length>=l||h([...w,Js(a)])},m=v=>{w.length<=s||h(w.filter($=>$.id!==v))},y=(v,$,C)=>{h(w.map(A=>A.id===v?{...A,values:{...A.values,[$]:C}}:A))},k=(v,$)=>{const C=[...w],[A]=C.splice(v,1);C.splice($,0,A),h(C)},F=w.length<=s,c=l!==void 0&&w.length>=l,N=f.useRef(null);return e.jsxs("div",{className:`space-y-2 ${u}`,children:[e.jsxs("div",{className:["flex items-center gap-2 px-3 text-muted-foreground",d?"pl-9":""].join(" "),children:[r.map(v=>e.jsx("div",{style:{width:v.width??"1fr",flex:v.width?"none":"1"},className:"min-w-0",children:e.jsx("span",{style:Qs,children:v.label})},v.key)),e.jsx("div",{className:"w-8 flex-shrink-0"})]}),e.jsx("div",{className:"space-y-2",children:w.map((v,$)=>e.jsxs("div",{className:["flex items-center gap-2 p-2 rounded-[var(--radius-md)] border border-border bg-card transition-colors",n?"opacity-60":""].join(" "),draggable:d&&!n,onDragStart:()=>{N.current=$},onDragOver:C=>{C.preventDefault()},onDrop:()=>{N.current!==null&&N.current!==$&&(k(N.current,$),N.current=null)},children:[d&&e.jsx("div",{className:"cursor-grab text-muted-foreground/50 hover:text-muted-foreground flex-shrink-0",children:e.jsx(g.GripVertical,{size:14})}),r.map(C=>e.jsx("div",{style:{width:C.width??"1fr",flex:C.width?"none":"1"},className:"min-w-0",children:C.render(v.values[C.key],A=>y(v.id,C.key,A),$)},C.key)),e.jsx("button",{type:"button",disabled:n||F,onClick:()=>m(v.id),className:["flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] transition-colors",n||F?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-destructive hover:bg-destructive/10 cursor-pointer"].join(" "),"aria-label":"Remove row",children:e.jsx(g.Trash2,{size:14})})]},v.id))}),w.length===0&&e.jsx("div",{className:"text-center py-6 text-muted-foreground rounded-[var(--radius-md)] border border-dashed border-border",children:e.jsxs("span",{style:Zt,children:['No rows yet. Click "',i,'" to begin.']})}),!c&&e.jsxs("button",{type:"button",disabled:n,onClick:p,className:["flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-md)] border border-dashed border-primary/40 text-primary hover:bg-primary/5 transition-colors",n?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Zt,children:[e.jsx(g.Plus,{size:14}),i]})]})}qt.displayName="RepeatableFieldList";const Vs={history:[{cmd:"undo",icon:g.Undo,title:"Undo"},{cmd:"redo",icon:g.Redo,title:"Redo"}],format:[{cmd:"bold",icon:g.Bold,title:"Bold"},{cmd:"italic",icon:g.Italic,title:"Italic"},{cmd:"underline",icon:g.Underline,title:"Underline"},{cmd:"strikethrough",icon:g.Strikethrough,title:"Strikethrough"}],list:[{cmd:"insertUnorderedList",icon:g.List,title:"Bullet list"},{cmd:"insertOrderedList",icon:g.ListOrdered,title:"Numbered list"}],align:[{cmd:"justifyLeft",icon:g.AlignLeft,title:"Align left"},{cmd:"justifyCenter",icon:g.AlignCenter,title:"Align center"},{cmd:"justifyRight",icon:g.AlignRight,title:"Align right"}],block:[{cmd:"formatBlock-h2",icon:g.Heading2,title:"Heading 2"},{cmd:"formatBlock-blockquote",icon:g.Quote,title:"Blockquote"},{cmd:"formatBlock-pre",icon:g.Code,title:"Code block"}],link:[{cmd:"createLink",icon:g.Link,title:"Insert link"},{cmd:"unlink",icon:g.Unlink,title:"Remove link"}]},Rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},el={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1.6",color:"var(--foreground)"};function Jt({value:r="",onChange:t,placeholder:o="Start typing…",minHeight:a=160,maxHeight:s=480,toolbar:l=["history","format","list","align","link","block"],fullscreen:i=!0,disabled:d=!1,readOnly:n=!1,size:u="md",className:b=""}){const x=f.useRef(null),[w,h]=f.useState(!1),[p,m]=f.useState(new Set),[y,k]=f.useState(!r);f.useEffect(()=>{x.current&&r&&x.current.innerHTML!==r&&(x.current.innerHTML=r,k(!1))},[]);const F=f.useCallback(()=>{const A=new Set;["bold","italic","underline","strikethrough","insertUnorderedList","insertOrderedList","justifyLeft","justifyCenter","justifyRight"].forEach(L=>{try{document.queryCommandState(L)&&A.add(L)}catch{}}),m(A)},[]);function c(A){var L;if(!(d||n)){if((L=x.current)==null||L.focus(),A.startsWith("formatBlock-")){const D=A.replace("formatBlock-","");document.execCommand("formatBlock",!1,D)}else if(A==="createLink"){const D=window.prompt("Enter URL:");D&&document.execCommand("createLink",!1,D)}else document.execCommand(A,!1);F(),x.current&&t&&t(x.current.innerHTML)}}function N(){if(x.current){const A=x.current.innerHTML,L=x.current.innerText.trim();k(!L),t==null||t(A),F()}}const $=a??{sm:120,md:160,lg:240}[u],C=["border border-border rounded-[var(--radius-md)] bg-card overflow-hidden transition-all",w?"fixed inset-4 z-[var(--z-modal)] flex flex-col shadow-[0_8px_48px_rgba(0,0,0,0.2)]":"relative",d?"opacity-60":"",b].filter(Boolean).join(" ");return e.jsxs("div",{className:C,children:[!n&&e.jsxs("div",{className:"flex items-center gap-0.5 flex-wrap px-2 py-1.5 border-b border-border bg-muted/10",children:[l.map((A,L)=>{const D=Vs[A];return e.jsxs(f.Fragment,{children:[L>0&&e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),D.map(T=>{const M=T.icon,S=p.has(T.cmd);return e.jsx("button",{type:"button",title:T.title,disabled:d,onMouseDown:z=>{z.preventDefault(),c(T.cmd)},className:["w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground",d?"cursor-not-allowed":"cursor-pointer"].join(" "),children:e.jsx(M,{size:13})},T.cmd)})]},A)}),i&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ml-auto w-px h-5 bg-border mx-1"}),e.jsx("button",{type:"button",title:w?"Exit fullscreen":"Fullscreen",onClick:()=>h(!w),className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors cursor-pointer",children:w?e.jsx(g.Minimize2,{size:13}):e.jsx(g.Maximize2,{size:13})})]})]}),e.jsxs("div",{className:"relative flex-1",children:[y&&e.jsx("div",{className:"absolute top-0 left-0 pointer-events-none p-4 text-muted-foreground",style:Rs,children:o}),e.jsx("div",{ref:x,contentEditable:!d&&!n,suppressContentEditableWarning:!0,onInput:N,onKeyUp:F,onMouseUp:F,className:["outline-none p-4 overflow-y-auto","prose-p:my-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-3","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_pre]:bg-muted/30 [&_pre]:rounded [&_pre]:p-2 [&_pre]:text-sm","[&_a]:text-primary [&_a]:underline","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5",w?"flex-1":""].filter(Boolean).join(" "),style:{...el,minHeight:w?void 0:$,maxHeight:w?void 0:s},"data-placeholder":o})]})]})}Jt.displayName="RichTextEditor";const yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Le={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},rl={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6"};function tl({images:r,startIdx:t,onClose:o}){const[a,s]=f.useState(t),l=r[a],i=()=>s(n=>(n-1+r.length)%r.length),d=()=>s(n=>(n+1)%r.length);return f.useEffect(()=>{function n(u){u.key==="Escape"&&o(),u.key==="ArrowLeft"&&i(),u.key==="ArrowRight"&&d()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),e.jsxs("div",{className:"fixed inset-0 z-[var(--z-modal)] bg-black/90 flex items-center justify-center",onClick:o,children:[e.jsx("button",{type:"button",onClick:o,className:"absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(g.X,{size:16})}),r.length>1&&e.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),i()},className:"absolute left-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(g.ChevronLeft,{size:20})}),e.jsxs("div",{className:"max-w-4xl max-h-[80vh] px-16",onClick:n=>n.stopPropagation(),children:[e.jsx("img",{src:l.src,alt:l.alt??l.name,className:"max-w-full max-h-[70vh] object-contain rounded-[var(--radius-md)]"}),l.name&&e.jsxs("p",{className:"text-center text-white/70 mt-3",style:Le,children:[l.name," ",l.size?`· ${l.size}`:""]}),r.length>1&&e.jsxs("p",{className:"text-center text-white/40 mt-1",style:Le,children:[a+1," / ",r.length]})]}),r.length>1&&e.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),d()},className:"absolute right-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(g.ChevronRight,{size:20})})]})}function wr({src:r,alt:t="",caption:o,subCaption:a,size:s="sm",onClick:l,className:i=""}){const d={xs:"w-8 h-8",sm:"w-10 h-10",md:"w-14 h-14"};return e.jsxs("div",{className:`flex items-center gap-2.5 ${l?"cursor-pointer":""} ${i}`,onClick:l,children:[e.jsx("div",{className:`${d[s]} flex-shrink-0 rounded-[var(--radius-md)] overflow-hidden bg-muted/20 border border-border`,children:e.jsx("img",{src:r,alt:t,className:"w-full h-full object-cover",onError:n=>{n.target.style.display="none"}})}),(o||a)&&e.jsxs("div",{className:"min-w-0",children:[o&&e.jsx("div",{className:"truncate text-foreground",style:yr,children:o}),a&&e.jsx("div",{className:"truncate text-muted-foreground",style:Le,children:a})]})]})}wr.displayName="ThumbnailCell";function Qt({images:r,selectable:t=!1,selectedIds:o=[],onSelectChange:a,maxSelect:s,lightbox:l=!0,uploadable:i=!1,onUpload:d,onDelete:n,defaultLayout:u="grid",columns:b=4,disabled:x=!1,className:w=""}){const[h,p]=f.useState(u),[m,y]=f.useState(null),k=f.useRef(null);function F(v){if(x)return;if(o.includes(v))a==null||a(o.filter(C=>C!==v));else{if(s&&o.length>=s)return;a==null||a([...o,v])}}function c(v,$){t?F($):l&&y(v)}const N=f.useCallback(v=>{var $;($=v.target.files)!=null&&$.length&&(d==null||d(v.target.files),v.target.value="")},[d]);return r.length===0&&!i?e.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground border border-dashed border-border rounded-[var(--radius-md)]",children:e.jsx("span",{style:yr,children:"No images yet"})}):e.jsxs("div",{className:w,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("span",{className:"text-muted-foreground",style:Le,children:[r.length," image",r.length!==1?"s":"",t&&o.length>0&&` · ${o.length} selected`]}),e.jsxs("div",{className:"flex items-center gap-1",children:[i&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:k,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N}),e.jsxs("button",{type:"button",disabled:x,onClick:()=>{var v;return(v=k.current)==null?void 0:v.click()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-card hover:bg-muted/20 text-foreground transition-colors cursor-pointer",style:Le,children:[e.jsx(g.Upload,{size:12}),"Upload"]})]}),e.jsx("button",{type:"button",onClick:()=>p("grid"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${h==="grid"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(g.Grid,{size:14})}),e.jsx("button",{type:"button",onClick:()=>p("list"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${h==="list"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(g.List,{size:14})})]})]}),h==="grid"&&e.jsx("div",{className:`grid gap-2 ${rl[b]}`,children:r.map((v,$)=>{const C=o.includes(v.id);return e.jsxs("div",{className:["relative group rounded-[var(--radius-md)] overflow-hidden border transition-all cursor-pointer",C?"border-primary shadow-[0_0_0_2px_var(--primary)]":"border-border hover:border-primary/40"].join(" "),onClick:()=>c($,v.id),children:[e.jsx("div",{className:"aspect-square",children:e.jsx("img",{src:v.src,alt:v.alt??v.name,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:!t&&l&&e.jsx(g.ZoomIn,{size:20,className:"text-white opacity-0 group-hover:opacity-100 transition-opacity"})}),t&&e.jsx("div",{className:["absolute top-1.5 left-1.5 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all",C?"bg-primary border-primary":"bg-white/80 border-white"].join(" "),children:C&&e.jsx(g.Check,{size:10,className:"text-primary-foreground"})}),n&&e.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),n(v.id)},className:"absolute top-1.5 right-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-black/60 text-white opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive cursor-pointer",children:e.jsx(g.Trash2,{size:10})})]},v.id)})}),h==="list"&&e.jsx("div",{className:"space-y-1.5",children:r.map((v,$)=>{const C=o.includes(v.id);return e.jsxs("div",{className:["flex items-center gap-3 p-2.5 rounded-[var(--radius-md)] border transition-all cursor-pointer",C?"border-primary bg-primary/5":"border-border hover:bg-muted/10"].join(" "),onClick:()=>c($,v.id),children:[e.jsx(wr,{src:v.src,alt:v.alt,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"truncate text-foreground",style:yr,children:v.name??v.alt??`Image ${$+1}`}),v.size&&e.jsx("div",{className:"text-muted-foreground",style:Le,children:v.size})]}),t&&C&&e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(g.Check,{size:10,className:"text-primary-foreground"})}),n&&e.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),n(v.id)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer flex-shrink-0",children:e.jsx(g.Trash2,{size:13})})]},v.id)})}),m!==null&&e.jsx(tl,{images:r,startIdx:m,onClose:()=>y(null)})]})}Qt.displayName="ImageGallery";const Nr=f.createContext(null);Nr.displayName="AppShellContext";const Sr=f.createContext(null);Sr.displayName="AppShellFullContext";function kr({user:r=null,product:t=null,navResolver:o,sidebarOpen:a,onSidebarChange:s,defaultSidebarOpen:l=!0,children:i}){const d=a!==void 0,[n,u]=f.useState(l),b=d?a:n,x=f.useCallback(N=>{d||u(N),s==null||s(N)},[d,s]),[w,h]=f.useState([]),p=f.useCallback(N=>{h(N)},[]),[m,y]=f.useState({groups:[],loading:!1,error:null}),k=f.useRef(0),F=f.useCallback(async()=>{if(!o||!r){y({groups:[],loading:!1,error:null});return}const N=++k.current;y(v=>({...v,loading:!0,error:null}));try{const v=await o(r);if(N!==k.current)return;y({groups:v,loading:!1,error:null})}catch(v){if(N!==k.current)return;y({groups:[],loading:!1,error:v instanceof Error?v.message:"Failed to load navigation"})}},[o,r]);f.useEffect(()=>{F()},[F]),f.useEffect(()=>{if(!(t!=null&&t.product))return;const N=document.documentElement.getAttribute("data-product");return document.documentElement.setAttribute("data-product",t.product),()=>{N?document.documentElement.setAttribute("data-product",N):document.documentElement.removeAttribute("data-product")}},[t==null?void 0:t.product]);const c=f.useMemo(()=>({sidebarOpen:b,setSidebarOpen:x,user:r,product:t,breadcrumbs:w,setBreadcrumbs:p,navGroups:m.groups,navLoading:m.loading,navError:m.error,refreshNav:F}),[b,x,r,t,w,p,m.groups,m.loading,m.error,F]);return e.jsx(Sr.Provider,{value:c,children:e.jsx(Nr.Provider,{value:c,children:i})})}kr.displayName="AppShellProvider";function Vt(){const r=f.useContext(Nr);if(!r)throw new Error("[useAppShell] must be used inside <AppShellProvider>. Wrap your app root with <AppShellProvider user={...} product={...}>.");return r}function Rt(){const r=f.useContext(Sr);if(!r)throw new Error("[useAppShellFull] must be used inside <AppShellProvider>.");return r}function ol(r){const{setBreadcrumbs:t}=Vt(),o=JSON.stringify(r);f.useEffect(()=>(t(r),()=>t([])),[o])}function al(r,t){const[o,a]=f.useState({groups:[],loading:!1,error:null}),s=f.useRef(0),l=f.useCallback(async()=>{if(!r||!t){a({groups:[],loading:!1,error:null});return}const i=++s.current;a(d=>({...d,loading:!0,error:null}));try{const d=await r(t);if(i!==s.current)return;a({groups:d,loading:!1,error:null})}catch(d){if(i!==s.current)return;a({groups:[],loading:!1,error:d instanceof Error?d.message:"Navigation load failed"})}},[r,t]);return f.useEffect(()=>{l()},[l]),{...o,refresh:l}}class eo extends f.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("[AppShellErrorBoundary] Caught error:",t,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[200px] gap-3 p-6 text-center",role:"alert",children:[e.jsx("div",{className:"text-destructive",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:"Something went wrong in this section."}),e.jsx("button",{type:"button",onClick:()=>this.setState({hasError:!1}),className:"px-4 py-1.5 rounded-[var(--radius-md)] border border-border text-muted-foreground hover:bg-muted/20 transition-colors text-sm cursor-pointer",children:"Try again"})]}):this.props.children}}function R({children:r,className:t=""}){return r?e.jsx("div",{className:t,children:r}):null}function ro({children:r}){return r?e.jsx("div",{className:"sticky bottom-0 left-0 right-0 z-[var(--z-sticky)] bg-card border-t border-border px-6 py-3 flex items-center justify-end gap-3",children:r}):null}function to({p:r}){const t=r.gap??"gap-5";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stats}),e.jsx(R,{children:r.filters}),e.jsx(R,{className:"min-h-0",children:r.content}),e.jsx(R,{children:r.footer})]})}function sl({p:r}){const t=r.gap??"gap-6",o=r.asideWidth??"w-80";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:`flex flex-col lg:flex-row ${t} min-h-0`,children:[r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside}),e.jsx("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:r.main??r.content}),!r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside})]})]})}function ll({p:r}){const t=r.gap??"gap-8";return e.jsxs("div",{className:`flex flex-col ${t} max-w-3xl`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:`flex flex-col ${t}`,children:r.sections??r.content})]})}function nl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stepper}),e.jsx(R,{className:"flex-1",children:r.form??r.content})]}),e.jsx(ro,{children:r.actions})]})}function il({p:r}){const t=r.gap??"gap-6",o=r.primaryChart&&r.secondaryCharts;return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.kpis??r.stats}),o?e.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-3 ${t}`,children:[e.jsx("div",{className:"lg:col-span-2",children:r.primaryChart}),e.jsx("div",{className:"flex flex-col gap-4",children:r.secondaryCharts})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:r.primaryChart??r.charts}),e.jsx(R,{children:r.secondaryCharts})]}),e.jsx(R,{children:r.content??r.table}),e.jsx(R,{children:r.footer})]})}function dl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:"flex-1 max-w-2xl",children:r.form??r.content})]}),e.jsx(ro,{children:r.actions})]})}function cl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[r.stats&&e.jsx("div",{className:"flex-1",children:r.stats}),r.dateRange&&e.jsx("div",{className:"flex-shrink-0",children:r.dateRange})]}),e.jsx(R,{children:r.filters}),e.jsx(R,{children:r.charts??r.primaryChart}),r.secondaryCharts&&e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 ${t}`,children:r.secondaryCharts}),e.jsx(R,{children:r.table??r.content}),e.jsx(R,{children:r.footer})]})}function oo(r){const{layout:t="list",maxWidth:o,padding:a,className:s=""}=r,l=a??"p-4 sm:p-6",i=o?`${o} mx-auto w-full`:"w-full",d=(()=>{switch(t){case"list":return e.jsx(to,{p:r});case"detail":return e.jsx(sl,{p:r});case"settings":return e.jsx(ll,{p:r});case"wizard":return e.jsx(nl,{p:r});case"dashboard":return e.jsx(il,{p:r});case"form":return e.jsx(dl,{p:r});case"report":return e.jsx(cl,{p:r});default:return e.jsx(to,{p:r})}})();return e.jsx("div",{className:`${l} ${i} ${s}`,children:d})}oo.displayName="FeaturePageScaffold";const fl={fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-button)",color:"var(--foreground)"},hl={fontFamily:"var(--font-p)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)",color:"var(--muted-foreground)"};function ao({title:r,description:t,action:o,children:a,className:s=""}){return e.jsxs("section",{className:`space-y-4 ${s}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{style:fl,children:r}),t&&e.jsx("p",{className:"mt-1",style:hl,children:t})]}),o&&e.jsx("div",{className:"flex-shrink-0",children:o})]}),e.jsx("div",{className:"border-t border-border pt-4",children:a})]})}ao.displayName="ScaffoldSection";function so({children:r,className:t=""}){return e.jsx("div",{className:`grid grid-cols-2 lg:grid-cols-4 gap-4 ${t}`,children:r})}so.displayName="ScaffoldKPIRow";function ul(r){return r.map(t=>({label:t.title??"",items:t.items.filter(o=>!o.disabled).map(o=>({id:o.id,label:o.label,icon:o.icon,badge:typeof o.badge=="function"?void 0:o.badge}))}))}function bl({activeItemId:r,onNavigate:t,notificationCount:o,onNotificationClick:a,onAppSwitcherClick:s,onUserClick:l,onSearchClick:i,searchMode:d,showSearch:n,title:u,version:b,versionDate:x,contentPadding:w=!0,utilityItems:h,children:p,className:m=""}){var P,H,Q;const{sidebarOpen:y,setSidebarOpen:k,user:F,product:c,breadcrumbs:N,navGroups:v,navLoading:$,navError:C,refreshNav:A}=Rt(),[L,D]=f.useState(!(((P=c==null?void 0:c.shell)==null?void 0:P.sidebarDefaultOpen)??!0)),[T,M]=f.useState(!1),S=d??(n?"bar":"none");f.useEffect(()=>{function B(){window.innerWidth>=768&&M(!1)}return window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]);const z=ul(v),E=f.useCallback(B=>{const X=v.flatMap(te=>te.items).find(te=>te.id===B.id);X&&t&&t(X),M(!1)},[v,t]),I=e.jsx(Pe,{brand:c?{name:c.brand.name,logo:typeof c.brand.logo=="string"?c.brand.logo:void 0,logoFull:c.brand.logoFull}:{name:"Sellsuki"},groups:$?[{label:"Loading",items:[]}]:z,activeItem:r,onNavigate:E,collapsed:L,onCollapsedChange:D,showCollapseToggle:!1,utilityItems:h,version:b,versionDate:x}),O=L?"var(--shell-sidebar-collapsed, 64px)":"var(--shell-sidebar-width, 200px)";return e.jsxs("div",{className:`min-h-screen bg-[var(--background)] ${m}`,"data-product":c==null?void 0:c.product,children:[e.jsx("div",{className:"fixed top-0 left-0 right-0",style:{zIndex:"var(--z-shell-navbar, 100)"},children:e.jsx(nr,{brand:c?{name:c.brand.name,logo:typeof c.brand.logo=="string"?c.brand.logo:void 0,logoFull:c.brand.logoFull??(c.brand.logo&&typeof c.brand.logo!="string"?c.brand.logo:void 0)}:{name:"Sellsuki"},title:u,breadcrumbs:N.map(B=>({label:B.label,href:B.href})),user:F?{name:F.name,avatar:F.avatar}:void 0,searchMode:S,onSearchClick:i,notificationCount:o,onNotificationClick:a,onAppSwitcherClick:s,onUserClick:l,workspaceSwitcher:(H=c==null?void 0:c.brand)==null?void 0:H.workspaceSwitcher,onSidebarToggle:()=>{window.innerWidth<768?M(B=>!B):D(B=>!B)},onMobileMenuClick:()=>M(B=>!B)})}),e.jsx("aside",{className:"hidden md:flex flex-col fixed left-0 bottom-0 overflow-hidden",style:{top:"var(--shell-navbar-height, 56px)",width:O,zIndex:"var(--z-shell-sidebar, 90)",transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))"},children:$?e.jsx("div",{className:"p-4 w-full",children:e.jsx(ar,{rows:6})}):C?e.jsxs("div",{className:"p-3",children:[e.jsx(Qe,{variant:"error",children:e.jsx("span",{style:{fontSize:"var(--text-label)"},children:"Nav load failed"})}),e.jsx("button",{type:"button",className:"mt-2 text-primary cursor-pointer hover:underline",style:{fontSize:"var(--text-label)"},onClick:A,children:"Retry"})]}):I}),T&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/40 md:hidden",style:{zIndex:"var(--z-shell-overlay, 80)"},onClick:()=>M(!1)}),e.jsx("div",{className:"fixed left-0 bottom-0 bg-card shadow-lg md:hidden overflow-y-auto",style:{top:"var(--shell-navbar-height, 56px)",width:"var(--shell-sidebar-width, 200px)",zIndex:"var(--z-shell-sidebar, 90)"},children:$?e.jsx("div",{className:"p-4",children:e.jsx(ar,{rows:6})}):e.jsx(Pe,{brand:c?{name:c.brand.name}:{name:"Sellsuki"},groups:z,activeItem:r,onNavigate:E,collapsed:!1,showCollapseToggle:!1,utilityItems:h,version:b,versionDate:x})})]}),e.jsx("main",{className:`min-h-screen ${w?"":"p-0"}`,style:{paddingTop:"var(--shell-navbar-height, 56px)",marginLeft:O,transition:"margin-left var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",maxWidth:(Q=c==null?void 0:c.shell)==null?void 0:Q.contentMaxWidth},children:e.jsx(eo,{children:p})}),e.jsx(Er,{})]})}function lo({product:r,user:t,navResolver:o,...a}){var s;return e.jsx(kr,{product:r,user:t,navResolver:o,defaultSidebarOpen:((s=r==null?void 0:r.shell)==null?void 0:s.sidebarDefaultOpen)??!0,children:e.jsx(bl,{...a})})}lo.displayName="AppShell";function no(){return e.jsxs("div",{className:"min-h-screen bg-[var(--background)] flex flex-col",children:[e.jsxs("div",{className:"h-14 bg-card border-b border-border flex items-center px-4 gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-muted/40 animate-pulse"}),e.jsxs("div",{className:"ml-auto flex gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"})]})]}),e.jsxs("div",{className:"flex flex-1",children:[e.jsxs("div",{className:"w-[200px] border-r border-border p-4 space-y-3 hidden md:block",children:[e.jsx("div",{className:"w-full h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),Array.from({length:6}).map((r,t)=>e.jsx("div",{className:"w-full h-7 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"},t))]}),e.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[e.jsx("div",{className:"h-8 w-48 rounded bg-muted/40 animate-pulse"}),e.jsx("div",{className:"h-32 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"}),e.jsx("div",{className:"h-64 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"})]})]})]})}no.displayName="AppShellSkeleton";const gl={product:"sellsuki",brand:{name:"Sellsuki",theme:"sellsuki"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},pl={product:"patona",brand:{name:"Patona",theme:"patona"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},vl={product:"sukispace",brand:{name:"Sukispace",theme:"sukispace"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},ml={product:"shipmunk",brand:{name:"Shipmunk",theme:"shipmunk"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},xl={product:"akita",brand:{name:"Akita",theme:"akita"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},yl={product:"oc2plus",brand:{name:"Oc2plus",theme:"oc2plus"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},wl={product:"sellsukipay",brand:{name:"SellsukiPay",theme:"sellsukipay"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}};W.Accordion=Yr,W.AccordionItem=Re,W.AdvancedDataTable=Ms,W.Alert=Qe,W.AppShell=lo,W.AppShellErrorBoundary=eo,W.AppShellProvider=kr,W.AppShellSkeleton=no,W.AreaChart=At,W.Avatar=Ur,W.AvatarGroup=Xr,W.Badge=xo,W.BarChart=jt,W.Breadcrumb=Zo,W.Button=Ze,W.ButtonGroup=bo,W.Card=Kr,W.CardBody=qr,W.CardFooter=Jr,W.CardHeader=Zr,W.Checkbox=Fe,W.CheckboxGroup=wo,W.ChoiceCard=Ut,W.ChoiceCardGroup=Xt,W.ColorPicker=ra,W.ConfirmDialog=Mo,W.DSButton=Ze,W.DSCheckbox=Fe,W.DSInput=qe,W.DSRadio=Ir,W.DSTable=Or,W.DSTextarea=Je,W.DatePicker=Wo,W.DateRangePicker=Ht,W.DateTimePicker=Gt,W.Divider=Vr,W.DonutChart=Et,W.Drawer=Rr,W.Dropdown=et,W.EmptyState=ia,W.FeaturePageScaffold=oo,W.FileUpload=ha,W.FilterBar=$s,W.FormError=Ct,W.FormField=ds,W.FormHelperText=Wt,W.FormLabel=fr,W.FormSuccess=Ft,W.IconButton=Wr,W.ImageGallery=Qt,W.ImagePreview=ga,W.Input=qe,W.LineChart=Dt,W.Menu=lt,W.MiniSparkline=Tt,W.Modal=Pr,W.Notification=it,W.NotificationCenter=wa,W.NumberInput=bs,W.OTPInput=ms,W.PageHeader=Ns,W.Pagination=Eo,W.Popover=Sa,W.ProgressBar=dt,W.Radio=Ir,W.RadioCard=Kt,W.RadioGroup=So,W.Rating=Fa,W.RepeatableFieldList=qt,W.RichTextEditor=Jt,W.ScaffoldKPIRow=so,W.ScaffoldSection=ao,W.SearchField=Bo,W.Sidebar=Pe,W.SidebarAccountSwitcher=or,W.Skeleton=se,W.SkeletonCard=Ta,W.SkeletonList=ar,W.SkeletonTable=Ia,W.Spinner=ht,W.StatCard=Pa,W.Statistic=Ha,W.Stepper=xt,W.Switch=Za,W.Table=Or,W.Tabs=Ho,W.Tag=yt,W.TagInput=wt,W.Textarea=Je,W.ThumbnailCell=wr,W.TimePicker=xr,W.Timeline=ts,W.ToastContainer=Er,W.Tooltip=rr,W.TopNavbar=nr,W.TransferList=ss,W.Tree=ls,W.akitaBrandConfig=xl,W.oc2plusBrandConfig=yl,W.patonaBrandConfig=pl,W.sellsukiBrandConfig=gl,W.sellsukiPayBrandConfig=wl,W.shipmunkBrandConfig=ml,W.sukispaceBrandConfig=vl,W.toast=ye,W.useAppShell=Vt,W.useAppShellFull=Rt,W.useBreadcrumbs=ol,W.useFormField=is,W.useNavResolver=al,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
|
93
|
+
${a?"opacity-50 pointer-events-none bg-muted":"bg-background"}
|
|
94
|
+
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},N))}),l&&e.jsx("p",{className:"mt-2 text-destructive",style:ga,children:l})]})}const ma={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},ya={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},wa={fontFamily:"var(--font-label, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-label)"};function Na({title:r,subtitle:t,breadcrumb:o,actions:s,tabs:a,sticky:l=!1,className:n=""}){return e.jsxs("div",{className:`bg-card border-b border-border ${l?"sticky top-0 z-10":""} ${n}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[o&&e.jsx("div",{className:"mb-2",style:wa,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:ma,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:ya,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 Ca={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ue={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400};function Sa({config:r,value:t,onChange:o}){var f;const[s,a]=c.useState(!1),l=Array.isArray(t)?t:t?[t]:[],n=l.length>0,d=c.useCallback(p=>{if(r.type==="single"){const m=l[0]===p?null:p;o(r.key,m),a(!1)}else{const m=l.includes(p)?l.filter(w=>w!==p):[...l,p];o(r.key,m.length?m:null)}},[r,l,o]),i=l.length===1?(f=r.options.find(p=>p.value===l[0]))==null?void 0:f.label:l.length>1?`${r.label} (${l.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${n?"bg-[var(--primary)]/10 border-[var(--primary)] text-[var(--primary)]":"bg-[var(--background)] border-[var(--border)] text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ca,children:[i,n&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary)] text-primary-foreground font-bold",style:{fontSize:"var(--text-label)",lineHeight:1},children:l.length}),e.jsx(b.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(p=>{const m=l.includes(p.value);return e.jsxs("button",{type:"button",onClick:()=>d(p.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${m?"bg-[var(--primary)]/10 text-[var(--primary)]":"text-[var(--foreground)] hover:bg-[var(--muted)]"}`,style:Ue,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${m?"bg-[var(--primary)] border-[var(--primary)] text-primary-foreground":"border-[var(--border)]"}`,children:m&&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"})})}),p.label]},p.value)})})]})]})}function $a({filters:r=[],searchPlaceholder:t="Search...",showSearch:o=!0,value:s,onFilterChange:a,className:l=""}){const[n,d]=c.useState({search:"",filters:{}}),i=s??n,f=c.useCallback(x=>{d(x),a==null||a(x)},[a]),p=c.useCallback(x=>{f({...i,search:x.target.value})},[i,f]),m=c.useCallback((x,y)=>{f({...i,filters:{...i.filters,[x]:y}})},[i,f]),w=c.useCallback(()=>{f({search:"",filters:{}})},[f]),h=Object.values(i.filters).filter(x=>x!==null&&(!Array.isArray(x)||x.length>0)).length,g=h>0||i.search&&i.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 ${l}`,children:[o&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(b.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground)] pointer-events-none"}),e.jsx("input",{type:"text",value:i.search??"",onChange:p,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:Ue})]}),o&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border)] flex-shrink-0"}),r.length>0&&e.jsx(b.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground)] flex-shrink-0"}),r.map(x=>e.jsx(Sa,{config:x,value:i.filters[x.key]??null,onChange:m},x.key)),h>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:Ue,children:[h," active"]}),g&&e.jsxs("button",{type:"button",onClick:w,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:Ue,children:[e.jsx(b.X,{size:12}),"Clear all"]})]})}const Wt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ve={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:400},fe={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function ka({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function za({columns:r,hidden:t,onToggle:o}){const[s,a]=c.useState(!1),l=c.useRef(null);c.useEffect(()=>{function d(i){l.current&&!l.current.contains(i.target)&&a(!1)}return s&&document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[s]);const n=r.filter(d=>d.hideable!==!1);return e.jsxs("div",{ref:l,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(d=>!d),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:ve,children:[e.jsx(b.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:n.map(d=>{const i=!t.has(d.key);return e.jsxs("button",{type:"button",onClick:()=>o(d.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:ve,children:[e.jsx("span",{children:d.header}),i&&e.jsx(b.Check,{size:13,className:"text-[var(--primary)]"})]},d.key)})})]})}function Fa({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:Wt,children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((a,l)=>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:{...ve,fontWeight:500},children:[a.icon,a.label]},l))}),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(b.X,{size:14})})]})}const La=[10,20,50,100];function Ma({meta:r,onPageChange:t}){const{page:o,pageSize:s,totalCount:a}=r,l=Math.max(1,Math.ceil(a/s)),n=a===0?0:(o-1)*s+1,d=Math.min(o*s,a),i=c.useMemo(()=>{const f=[];if(l<=7)for(let p=1;p<=l;p++)f.push(p);else{f.push(1),o>3&&f.push("...");for(let p=Math.max(2,o-1);p<=Math.min(l-1,o+1);p++)f.push(p);o<l-2&&f.push("..."),f.push(l)}return f},[o,l]);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:ve,children:[n,"–",d," of ",a.toLocaleString()]}),e.jsx("select",{value:s,onChange:f=>t(1,Number(f.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:ve,children:La.map(f=>e.jsxs("option",{value:f,children:[f," / page"]},f))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ur,{disabled:o===1,onClick:()=>t(o-1,s),label:"‹ Prev"}),i.map((f,p)=>f==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground)]",style:ve,children:"…"},`ellipsis-${p}`):e.jsx(ur,{active:f===o,onClick:()=>t(f,s),label:String(f)},f)),e.jsx(ur,{disabled:o===l,onClick:()=>t(o+1,s),label:"Next ›"})]})]})}function ur({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:{...ve,fontWeight:t?600:400},children:r})}function Wa({columns:r,data:t,rowKey:o="id",pagination:s,sortBy:a,sortOrder:l,onPageChange:n,onSortChange:d,selectable:i=!1,selectedRows:f,onSelectionChange:p,bulkActions:m=[],onRowClick:w,expandedRowRender:h,loading:g=!1,loadingRows:x=5,error:y,emptyMessage:S="No data found",emptyDescription:F,showColumnToggle:u=!1,size:N="md",stickyHeader:v=!1,className:$=""}){const[z,A]=c.useState(new Set(r.filter(H=>H.defaultHidden).map(H=>H.key))),M=c.useCallback(H=>{A(V=>{const J=new Set(V);return J.has(H)?J.delete(H):J.add(H),J})},[]),D=c.useMemo(()=>r.filter(H=>!z.has(H.key)),[r,z]),[T,W]=c.useState(new Set),C=f??T,k=c.useCallback(H=>{f||W(H);const V=t.filter(J=>H.has(J[o]));p==null||p(H,V)},[f,t,o,p]),E=c.useMemo(()=>t.map(H=>H[o]),[t,o]),B=E.length>0&&E.every(H=>C.has(H)),O=C.size>0&&!B,P=c.useCallback(()=>{k(B?new Set:new Set(E))},[B,E,k]),_=c.useCallback(H=>{const V=new Set(C);V.has(H)?V.delete(H):V.add(H),k(V)},[C,k]),[Q,I]=c.useState(new Set),G=c.useCallback(H=>{I(V=>{const J=new Set(V);return J.has(H)?J.delete(H):J.add(H),J})},[]),te=c.useCallback(H=>{d&&(a===H?d(H,l==="asc"?"desc":"asc"):d(H,"asc"))},[a,l,d]),X=c.useMemo(()=>{const H={};let V=0;i&&(V+=48),h&&(V+=40);for(const J of D)if(J.frozen){H[J.key]=V;const ne=typeof J.width=="number"?J.width:parseInt(J.width??"120");V+=isNaN(ne)?120:ne}return H},[D,i,h]),re=D.length+(i?1:0)+(h?1:0),Y="sticky z-[2] bg-inherit";return e.jsxs("div",{className:`rounded-[var(--radius-md)] border border-[var(--border)] overflow-hidden ${$}`,children:[u&&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(za,{columns:r,hidden:z,onToggle:M})}),i&&C.size>0&&m.length>0&&e.jsx(Fa,{count:C.size,actions:m,selectedKeys:Array.from(C),onClear:()=>k(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:v?"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:[h&&e.jsx("th",{className:`${fe[N]} w-10`}),i&&e.jsx("th",{className:`${fe[N]} w-12`,children:e.jsx(Fe,{size:"sm",checked:B,indeterminate:O&&!B,onChange:P})}),D.map(H=>{const V=H.frozen&&H.key in X,J=a===H.key;return e.jsx("th",{className:`${fe[N]} text-${H.align??"left"} text-[var(--foreground)] whitespace-nowrap select-none ${H.sortable&&d?"cursor-pointer hover:text-[var(--primary)]":""} ${V?Y:""}`,style:{...Wt,width:H.width,minWidth:H.minWidth??80,...V?{left:X[H.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>H.sortable&&te(H.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[H.header,H.sortable&&d&&e.jsx("span",{className:J?"text-[var(--primary)]":"text-[var(--muted-foreground)]/60",children:J?l==="asc"?e.jsx(b.ChevronUp,{size:13}):e.jsx(b.ChevronDown,{size:13}):e.jsx(b.ChevronsUpDown,{size:12})})]})},H.key)})]})}),e.jsxs("tbody",{children:[y&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[N]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(b.AlertCircle,{size:32,className:"text-[var(--destructive)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive)]",style:hr,children:y})]})})}),!y&&g&&Array.from({length:x}).map((H,V)=>e.jsxs("tr",{className:"border-b border-[var(--border)] last:border-b-0",children:[h&&e.jsx("td",{className:`${fe[N]} w-10`}),i&&e.jsx("td",{className:`${fe[N]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),D.map(J=>e.jsx("td",{className:`${fe[N]}`,children:e.jsx(ka,{width:J.align==="right"?"60%":J.align==="center"?"50%":"75%"})},J.key))]},`skel-${V}`)),!y&&!g&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:re,className:`${fe[N]} 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(b.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground)]",style:hr,children:S}),F&&e.jsx("span",{className:"text-[var(--muted-foreground)]",style:ve,children:F})]})})}),!y&&!g&&t.map((H,V)=>{const J=H[o],ne=C.has(J),xe=Q.has(J),Te=!!w||!!h;return e.jsxs(c.Fragment,{children:[e.jsxs("tr",{className:`group/row border-b border-[var(--border)] last:border-b-0 transition-colors ${ne?"bg-primary/5":"bg-[var(--card)] hover:bg-[var(--row-hover-bg)]"} ${Te?"cursor-pointer":""}`,onClick:()=>{w==null||w(H),h&&G(J)},children:[h&&e.jsx("td",{className:`${fe[N]} w-10 text-center`,onClick:q=>{q.stopPropagation(),G(J)},children:e.jsx(b.ChevronRight,{size:14,className:`text-[var(--muted-foreground)] transition-transform mx-auto ${xe?"rotate-90":""}`})}),i&&e.jsx("td",{className:`${fe[N]} w-12`,onClick:q=>q.stopPropagation(),children:e.jsx(Fe,{size:"sm",checked:ne,onChange:()=>_(J)})}),D.map(q=>{const me=q.frozen&&q.key in X,Ne=me?ne?"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:`${fe[N]} text-${q.align??"left"} text-[var(--foreground)] ${Ne}`,style:{...hr,...me?{left:X[q.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:q.render?q.render(H[q.key],H,V):H[q.key]},q.key)})]}),h&&xe&&e.jsx("tr",{className:"bg-[var(--muted)] border-b border-[var(--border)]",children:e.jsx("td",{colSpan:re,className:"px-6 py-4",children:h(H)})})]},J??V)})]})]})}),s&&n&&!g&&!y&&e.jsx(Ma,{meta:s,onPageChange:n})]})}const Le=["var(--chart-1, #32a9ff)","var(--chart-2, #22c55e)","var(--chart-3, #f59e0b)","var(--chart-4, #ef4444)","var(--chart-5, #a855f7)","var(--chart-6, #06b6d4)"];function ie(r,t){return r.color??Le[t%Le.length]}const le={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function pr(r,t,o){return Math.max(t,Math.min(o,r))}function Ze(r){const t=Math.max(...r,0);if(t===0)return 10;const o=Math.pow(10,Math.floor(Math.log10(t)));return Math.ceil(t/o)*o}function br(r,t){if(r.length===0)return"";if(!t||r.length<3)return r.map((s,a)=>`${a===0?"M":"L"}${s[0]},${s[1]}`).join(" ");let o=`M${r[0][0]},${r[0][1]}`;for(let s=1;s<r.length;s++){const a=r[s-1],l=r[s],n=a[0]+(l[0]-a[0])*.4,d=l[0]-(l[0]-a[0])*.4;o+=` C${n},${a[1]} ${d},${l[1]} ${l[0]},${l[1]}`}return o}function gr({x:r,y:t,label:o,items:s}){return e.jsx("foreignObject",{x:r,y:t,width:160,height:40+s.length*22,style:{overflow:"visible"},children:e.jsxs("div",{className:"bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_16px_rgba(0,0,0,0.12)] p-2 pointer-events-none",style:{width:"max-content",...le},children:[e.jsx("div",{className:"text-muted-foreground mb-1",children:o}),s.map(a=>e.jsxs("div",{className:"flex items-center gap-1.5 text-foreground",children:[e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:a.color}}),e.jsxs("span",{className:"truncate",children:[a.name,":"]}),e.jsx("span",{className:"font-medium ml-auto pl-2",children:a.value.toLocaleString()})]},a.name))]})})}function Dt({series:r,height:t=240,width:o,showXAxis:s=!0,showYAxis:a=!0,showGrid:l=!0,showLegend:n=!0,showTooltip:d=!0,showDots:i=!0,smooth:f=!1,className:p=""}){c.useId();const m=c.useRef(null),[w,h]=c.useState(null);if(!r.length||!r[0].data.length)return null;const g=r[0].data.map(T=>T.label),x=r.flatMap(T=>T.data.map(W=>W.value)),y=Ze(x),S=0,F={top:12,right:16,bottom:s?36:12,left:a?48:16},u=o??600,N=t,v=u-F.left-F.right,$=N-F.top-F.bottom,z=g.length>1?v/(g.length-1):v;function A(T){return F.left+T*z}function M(T){return F.top+$-(T-S)/(y-S||1)*$}const D=Array.from({length:5},(T,W)=>S+W/4*(y-S));return e.jsxs("div",{className:`w-full ${p}`,children:[e.jsxs("svg",{ref:m,width:o?u:"100%",height:N,viewBox:`0 0 ${u} ${N}`,onMouseLeave:()=>h(null),children:[l&&D.map((T,W)=>e.jsx("line",{x1:F.left,y1:M(T),x2:u-F.right,y2:M(T),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},W)),a&&D.map((T,W)=>e.jsx("text",{x:F.left-8,y:M(T)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:T>=1e3?`${(T/1e3).toFixed(1)}k`:T},W)),s&&g.map((T,W)=>{const C=Math.max(1,Math.floor(g.length/8));return W%C!==0&&W!==g.length-1?null:e.jsx("text",{x:A(W),y:N-F.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:T},W)}),r.map((T,W)=>{const C=ie(T,W),k=T.data.map((B,O)=>[A(O),M(B.value)]),E=br(k,f);return e.jsxs("g",{children:[e.jsx("path",{d:E,fill:"none",stroke:C,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),i&&k.map(([B,O],P)=>e.jsx("circle",{cx:B,cy:O,r:3,fill:"var(--card)",stroke:C,strokeWidth:2},P))]},W)}),d&&g.map((T,W)=>e.jsx("rect",{x:A(W)-z/2,y:F.top,width:z,height:$,fill:"transparent",onMouseEnter:()=>h({x:A(W),y:F.top,labelIdx:W})},W)),w&&e.jsx("line",{x1:A(w.labelIdx),y1:F.top,x2:A(w.labelIdx),y2:F.top+$,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),w&&d&&e.jsx(gr,{x:pr(A(w.labelIdx)+8,F.left,u-180),y:F.top,label:g[w.labelIdx],items:r.map((T,W)=>{var C;return{name:T.name,value:((C=T.data[w.labelIdx])==null?void 0:C.value)??0,color:ie(T,W)}})})]}),n&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((T,W)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(T,W)}}),e.jsx("span",{className:"text-muted-foreground",children:T.name})]},W))})]})}Dt.displayName="LineChart";function At({series:r,height:t=240,width:o,showXAxis:s=!0,showYAxis:a=!0,showGrid:l=!0,showLegend:n=!0,showTooltip:d=!0,showDots:i=!1,smooth:f=!0,fillOpacity:p=.15,className:m=""}){const w=c.useId(),[h,g]=c.useState(null);if(!r.length||!r[0].data.length)return null;const x=r[0].data.map(C=>C.label),y=r.flatMap(C=>C.data.map(k=>k.value)),S=Ze(y),F=0,u={top:12,right:16,bottom:s?36:12,left:a?48:16},N=o??600,v=t,$=N-u.left-u.right,z=v-u.top-u.bottom,A=x.length>1?$/(x.length-1):$;function M(C){return u.left+C*A}function D(C){return u.top+z-(C-F)/(S-F||1)*z}const T=Array.from({length:5},(C,k)=>F+k/4*(S-F)),W=u.top+z;return e.jsxs("div",{className:`w-full ${m}`,children:[e.jsxs("svg",{width:o?N:"100%",height:v,viewBox:`0 0 ${N} ${v}`,onMouseLeave:()=>g(null),children:[e.jsx("defs",{children:r.map((C,k)=>e.jsxs("linearGradient",{id:`${w}-grad-${k}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ie(C,k),stopOpacity:p*4}),e.jsx("stop",{offset:"100%",stopColor:ie(C,k),stopOpacity:0})]},k))}),l&&T.map((C,k)=>e.jsx("line",{x1:u.left,y1:D(C),x2:N-u.right,y2:D(C),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},k)),a&&T.map((C,k)=>e.jsx("text",{x:u.left-8,y:D(C)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:C>=1e3?`${(C/1e3).toFixed(1)}k`:C},k)),s&&x.map((C,k)=>{const E=Math.max(1,Math.floor(x.length/8));return k%E!==0&&k!==x.length-1?null:e.jsx("text",{x:M(k),y:v-u.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:C},k)}),r.map((C,k)=>{const E=ie(C,k),B=C.data.map((_,Q)=>[M(Q),D(_.value)]),O=br(B,f),P=O+` L${B[B.length-1][0]},${W} L${B[0][0]},${W} Z`;return e.jsxs("g",{children:[e.jsx("path",{d:P,fill:`url(#${w}-grad-${k})`}),e.jsx("path",{d:O,fill:"none",stroke:E,strokeWidth:2,strokeLinecap:"round"}),i&&B.map(([_,Q],I)=>e.jsx("circle",{cx:_,cy:Q,r:3,fill:"var(--card)",stroke:E,strokeWidth:2},I))]},k)}),d&&x.map((C,k)=>e.jsx("rect",{x:M(k)-A/2,y:u.top,width:A,height:z,fill:"transparent",onMouseEnter:()=>g({x:M(k),y:u.top,labelIdx:k})},k)),h&&e.jsx("line",{x1:M(h.labelIdx),y1:u.top,x2:M(h.labelIdx),y2:u.top+z,stroke:"var(--border)",strokeWidth:1,strokeDasharray:"4 2"}),h&&e.jsx(gr,{x:pr(M(h.labelIdx)+8,u.left,N-180),y:u.top,label:x[h.labelIdx],items:r.map((C,k)=>{var E;return{name:C.name,value:((E=C.data[h.labelIdx])==null?void 0:E.value)??0,color:ie(C,k)}})})]}),n&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((C,k)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-3 h-0.5 rounded-full",style:{backgroundColor:ie(C,k)}}),e.jsx("span",{className:"text-muted-foreground",children:C.name})]},k))})]})}At.displayName="AreaChart";function jt({series:r,height:t=240,width:o,showXAxis:s=!0,showYAxis:a=!0,showGrid:l=!0,showLegend:n=!0,showTooltip:d=!0,stacked:i=!1,radius:f=4,className:p=""}){const[m,w]=c.useState(null);if(!r.length||!r[0].data.length)return null;const h=r[0].data.map(W=>W.label);let g;i?g=Ze(h.map((W,C)=>r.reduce((k,E)=>{var B;return k+(((B=E.data[C])==null?void 0:B.value)??0)},0))):g=Ze(r.flatMap(W=>W.data.map(C=>C.value)));const x={top:12,right:16,bottom:s?36:12,left:a?48:16},y=o??600,S=t,F=y-x.left-x.right,u=S-x.top-x.bottom,N=F/h.length,v=N*.2,$=N-v*2,z=i?$:$/r.length;function A(W){return x.top+u-W/g*u}function M(W){return W/g*u}function D(W){return x.left+W*N+v}const T=Array.from({length:5},(W,C)=>C/4*g);return e.jsxs("div",{className:`w-full ${p}`,children:[e.jsxs("svg",{width:o?y:"100%",height:S,viewBox:`0 0 ${y} ${S}`,onMouseLeave:()=>w(null),children:[l&&T.map((W,C)=>e.jsx("line",{x1:x.left,y1:A(W),x2:y-x.right,y2:A(W),stroke:"var(--border)",strokeWidth:.5,strokeDasharray:"4 2"},C)),a&&T.map((W,C)=>e.jsx("text",{x:x.left-8,y:A(W)+4,textAnchor:"end",fill:"var(--muted-foreground)",style:le,children:W>=1e3?`${(W/1e3).toFixed(1)}k`:W},C)),s&&h.map((W,C)=>e.jsx("text",{x:D(C)+$/2,y:S-x.bottom+16,textAnchor:"middle",fill:"var(--muted-foreground)",style:le,children:W},C)),h.map((W,C)=>{if(i){let k=x.top+u;return e.jsx("g",{children:r.map((E,B)=>{var V;const O=((V=E.data[C])==null?void 0:V.value)??0,P=M(O),_=k-P;k=_;const Q=ie(E,B),I=B===r.length-1,G=B===0,te=f,X=D(C),re=$,Y=P,H=I&&G?`M${X},${_+te} Q${X},${_} ${X+te},${_} L${X+re-te},${_} Q${X+re},${_} ${X+re},${_+te} L${X+re},${_+Y} L${X},${_+Y} Z`:I?`M${X},${_+te} Q${X},${_} ${X+te},${_} L${X+re-te},${_} Q${X+re},${_} ${X+re},${_+te} L${X+re},${_+Y} L${X},${_+Y} Z`:`M${X},${_} L${X+re},${_} L${X+re},${_+Y} L${X},${_+Y} Z`;return e.jsx("path",{d:H,fill:Q},B)})},C)}else return e.jsx("g",{children:r.map((k,E)=>{var G;const B=((G=k.data[C])==null?void 0:G.value)??0,O=M(B),P=D(C)+E*z,_=A(B),Q=ie(k,E),I=Math.min(f,z/2);return e.jsx("path",{d:`M${P},${_+I} Q${P},${_} ${P+I},${_} L${P+z-I},${_} Q${P+z},${_} ${P+z},${_+I} L${P+z},${_+O} L${P},${_+O} Z`,fill:Q},E)})},C)}),d&&h.map((W,C)=>e.jsx("rect",{x:D(C),y:x.top,width:$,height:u,fill:"transparent",style:{cursor:"default"},onMouseEnter:()=>w({x:D(C)+$/2,y:x.top,labelIdx:C})},C)),m&&e.jsx(gr,{x:pr(m.x+8,x.left,y-180),y:x.top,label:h[m.labelIdx],items:r.map((W,C)=>{var k;return{name:W.name,value:((k=W.data[m.labelIdx])==null?void 0:k.value)??0,color:ie(W,C)}})})]}),n&&r.length>1&&e.jsx("div",{className:"flex flex-wrap gap-4 mt-2 justify-center",children:r.map((W,C)=>e.jsxs("div",{className:"flex items-center gap-1.5",style:le,children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:ie(W,C)}}),e.jsx("span",{className:"text-muted-foreground",children:W.name})]},C))})]})}jt.displayName="BarChart";function Et({data:r,size:t=200,innerRatio:o=.6,centerLabel:s,centerValue:a,showLegend:l=!0,showTooltip:n=!0,className:d=""}){const[i,f]=c.useState(null),p=r.reduce((u,N)=>u+N.value,0);if(p===0||r.length===0)return null;const m=t/2,w=t/2,h=t/2-4,g=h*o;let x=-Math.PI/2;const y=r.map((u,N)=>{const v=u.value/p,$=x,z=x+v*2*Math.PI;x=z;const A=m+h*Math.cos($),M=w+h*Math.sin($),D=m+h*Math.cos(z),T=w+h*Math.sin(z),W=m+g*Math.cos(z),C=w+g*Math.sin(z),k=m+g*Math.cos($),E=w+g*Math.sin($),B=v>.5?1:0;return{path:[`M${A},${M}`,`A${h},${h} 0 ${B} 1 ${D},${T}`,`L${W},${C}`,`A${g},${g} 0 ${B} 0 ${k},${E}`,"Z"].join(" "),color:u.color??Le[N%Le.length],ratio:v,d:u,i:N}}),S=a??p.toLocaleString(),F=i!==null?r[i]:null;return e.jsxs("div",{className:`flex items-center gap-6 ${d}`,children:[e.jsx("div",{className:"relative flex-shrink-0",children:e.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[y.map(u=>e.jsx("path",{d:u.path,fill:u.color,opacity:i===null||i===u.i?1:.4,style:{transition:"opacity 0.15s"},onMouseEnter:()=>f(u.i),onMouseLeave:()=>f(null)},u.i)),o>0&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:m,y:w-6,textAnchor:"middle",fill:"var(--foreground)",style:{...le,fontWeight:"700",fontSize:"18px"},children:F?F.value.toLocaleString():S}),(s||F)&&e.jsx("text",{x:m,y:w+12,textAnchor:"middle",fill:"var(--muted-foreground)",style:{...le,fontSize:"var(--text-caption)"},children:F?F.label:s})]})]})}),l&&e.jsx("div",{className:"flex flex-col gap-2",children:r.map((u,N)=>e.jsxs("div",{className:"flex items-center gap-2 cursor-default",style:le,onMouseEnter:()=>f(N),onMouseLeave:()=>f(null),children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm flex-shrink-0",style:{backgroundColor:u.color??Le[N%Le.length]}}),e.jsx("span",{className:"text-foreground",children:u.label}),e.jsxs("span",{className:"text-muted-foreground ml-auto pl-4",children:[(u.value/p*100).toFixed(1),"%"]})]},N))})]})}Et.displayName="DonutChart";function Tt({values:r,type:t="line",width:o=80,height:s=32,color:a,showValue:l=!1,trend:n,className:d=""}){if(!r.length)return null;const i=Math.min(...r),p=Math.max(...r)-i||1,m=r[r.length-1]>r[0]?"up":r[r.length-1]<r[0]?"down":"neutral",w=n??m,g=a??(w==="up"?"var(--chart-1, #22c55e)":w==="down"?"var(--chart-4, #ef4444)":"var(--muted-foreground)"),x=2,y=o-x*2,S=s-x*2;function F(z){return x+z/(r.length-1||1)*y}function u(z){return x+S-(z-i)/p*S}if(t==="bar"){const z=y/r.length-1;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsx("svg",{width:o,height:s,viewBox:`0 0 ${o} ${s}`,children:r.map((A,M)=>{const D=(A-i)/p*S;return e.jsx("rect",{x:x+M*(y/r.length),y:x+S-D,width:z,height:D,fill:g,rx:1,opacity:M===r.length-1?1:.5},M)})}),l&&e.jsx("span",{style:{...le,color:g},children:r[r.length-1].toLocaleString()})]})}const N=r.map((z,A)=>[F(A),u(z)]),v=br(N,!1),$=v+` L${N[N.length-1][0]},${x+S} L${N[0][0]},${x+S} Z`;return e.jsxs("div",{className:`inline-flex items-center gap-1.5 ${d}`,children:[e.jsxs("svg",{width:o,height:s,viewBox:`0 0 ${o} ${s}`,children:[t==="area"&&e.jsx("path",{d:$,fill:g,fillOpacity:.15}),e.jsx("path",{d:v,fill:"none",stroke:g,strokeWidth:1.5,strokeLinecap:"round"}),e.jsx("circle",{cx:N[N.length-1][0],cy:N[N.length-1][1],r:2,fill:g})]}),l&&e.jsx("span",{style:{...le,color:g},children:r[r.length-1].toLocaleString()})]})}Tt.displayName="MiniSparkline";function be(r){const t=new Date(r);return t.setHours(0,0,0,0),t}function ge(r){const t=new Date(r);return t.setHours(23,59,59,999),t}const Da=[{label:"Today",value:"today",range:()=>{const r=new Date;return{from:be(r),to:ge(r)}}},{label:"Yesterday",value:"yesterday",range:()=>{const r=new Date;return r.setDate(r.getDate()-1),{from:be(r),to:ge(r)}}},{label:"Last 7 days",value:"last7",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-6),{from:be(t),to:ge(r)}}},{label:"Last 30 days",value:"last30",range:()=>{const r=new Date,t=new Date;return t.setDate(t.getDate()-29),{from:be(t),to:ge(r)}}},{label:"This month",value:"thisMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth(),1),o=new Date(r.getFullYear(),r.getMonth()+1,0);return{from:be(t),to:ge(o)}}},{label:"Last month",value:"lastMonth",range:()=>{const r=new Date,t=new Date(r.getFullYear(),r.getMonth()-1,1),o=new Date(r.getFullYear(),r.getMonth(),0);return{from:be(t),to:ge(o)}}},{label:"Custom range",value:"custom",range:()=>({from:null,to:null})}],Aa=["January","February","March","April","May","June","July","August","September","October","November","December"],ja=["Su","Mo","Tu","We","Th","Fr","Sa"];function vr(r){return r?r.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):""}function xr(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function Ea(r,t){const o=[],s=new Date(r,t,1),a=new Date(s);a.setDate(a.getDate()-a.getDay());for(let l=0;l<42;l++)o.push(new Date(a)),a.setDate(a.getDate()+1);return o}const Ta={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},It={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ba={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Ht({month:r,year:t,range:o,hovered:s,onHover:a,onSelect:l,onPrevMonth:n,onNextMonth:d,minDate:i,maxDate:f}){const p=Ea(t,r);function m(h){const g=o.from,x=o.to??s;if(!g||!x)return!1;const[y,S]=g<=x?[g,x]:[x,g];return h>y&&h<S}function w(h){return!!(i&&h<be(i)||f&&h>ge(f))}return e.jsxs("div",{className:"select-none flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:n,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(b.ChevronLeft,{size:14})}),e.jsxs("span",{className:"text-foreground",style:It,children:[Aa[r]," ",t]}),e.jsx("button",{type:"button",onClick:d,className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(b.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:ja.map(h=>e.jsx("div",{className:"h-8 flex items-center justify-center text-muted-foreground",style:Bt,children:h},h))}),e.jsx("div",{className:"grid grid-cols-7",children:p.map((h,g)=>{const x=h.getMonth()===r,y=o.from?xr(h,o.from):!1,S=o.to?xr(h,o.to):s&&o.from?xr(h,s):!1,F=m(h),u=w(h);return e.jsx("button",{type:"button",disabled:u,onMouseEnter:()=>!u&&a(h),onMouseLeave:()=>a(null),onClick:()=>!u&&l(h),className:["h-8 w-full flex items-center justify-center text-center transition-colors",u?"opacity-30 cursor-not-allowed":"cursor-pointer",x?"":"text-muted-foreground/40",y||S?"bg-primary text-primary-foreground rounded-[var(--radius-md)] font-semibold":F?"bg-primary/10 text-primary":u?"":"hover:bg-muted/40 rounded-[var(--radius-md)]"].filter(Boolean).join(" "),style:Bt,children:h.getDate()},g)})})]})}function _t({value:r,onChange:t,presets:o=["today","last7","last30","custom"],placeholder:s="Select date range",size:a="md",minDate:l,maxDate:n,clearable:d=!0,disabled:i=!1,className:f=""}){const p=new Date,[m,w]=c.useState(!1),[h,g]=c.useState({from:null,to:null}),[x,y]=c.useState(null),[S,F]=c.useState(void 0),[u,N]=c.useState(p.getMonth()),[v,$]=c.useState(p.getFullYear()),[z,A]=c.useState("from"),[M,D]=c.useState({top:0,left:0,width:0}),T=c.useRef(null),W=c.useRef(null),C=r??h,k=(u+1)%12,E=u===11?v+1:v;c.useEffect(()=>{function I(G){T.current&&!T.current.contains(G.target)&&w(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]),c.useEffect(()=>{if(!m||!W.current)return;const I=()=>{const G=W.current.getBoundingClientRect();D({top:G.bottom+4,left:G.left,width:G.width})};return I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[m]);function B(I){if(I.value==="custom"){F("custom");return}const G=I.range();g(G),t==null||t(G,I.value),F(I.value),w(!1)}function O(I){if(z==="from")g({from:be(I),to:null}),A("to");else{const G=h.from,[te,X]=I>=G?[G,ge(I)]:[be(I),ge(G)],re={from:te,to:X};g(re),t==null||t(re,"custom"),F("custom"),A("from"),w(!1)}}function P(I){I.stopPropagation();const G={from:null,to:null};g(G),t==null||t(G,void 0),F(void 0)}const _=C.from&&C.to?`${vr(C.from)} – ${vr(C.to)}`:C.from?`${vr(C.from)} – ...`:"",Q=Da.filter(I=>o.includes(I.value));return e.jsxs("div",{ref:T,className:`relative inline-block ${f}`,children:[e.jsxs("button",{ref:W,type:"button",disabled:i,onClick:()=>!i&&w(!m),className:["flex items-center gap-2 border border-border bg-card text-left rounded-[var(--radius-md)] transition-colors w-full min-w-[260px]",Ba[a],m?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ta,children:[e.jsx(b.Calendar,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:_?"text-foreground flex-1":"text-muted-foreground flex-1",children:_||s}),d&&C.from&&e.jsx("span",{role:"button",tabIndex:0,onClick:P,onKeyDown:I=>I.key==="Enter"&&P(I),className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer flex-shrink-0",children:e.jsx(b.X,{size:12})})]}),m&&ze.createPortal(e.jsxs("div",{className:"fixed z-[9999] bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] flex overflow-y-auto",style:{top:M.top,left:M.left,minWidth:"620px",maxHeight:"calc(100vh - 120px)"},children:[e.jsx("div",{className:"w-36 border-r border-border py-2 flex flex-col gap-0.5 flex-shrink-0",children:Q.map(I=>e.jsx("button",{type:"button",onClick:()=>B(I),className:["w-full text-left px-3 py-1.5 rounded-none transition-colors",S===I.value?"bg-primary/10 text-primary":"text-foreground hover:bg-muted/30"].join(" "),style:It,children:I.label},I.value))}),e.jsxs("div",{className:"flex gap-4 p-4 flex-1 min-w-0",children:[e.jsx(Ht,{month:u,year:v,range:C,hovered:x,onHover:y,onSelect:O,onPrevMonth:()=>{u===0?(N(11),$(v-1)):N(u-1)},onNextMonth:()=>{u===11?(N(0),$(v+1)):N(u+1)},minDate:l,maxDate:n}),e.jsx("div",{className:"w-px bg-border"}),e.jsx(Ht,{month:k,year:E,range:C,hovered:x,onHover:y,onSelect:O,onPrevMonth:()=>{u===0?(N(11),$(v-1)):N(u-1)},onNextMonth:()=>{u===11?(N(0),$(v+1)):N(u+1)},minDate:l,maxDate:n})]})]}),document.body)]})}_t.displayName="DateRangePicker";function he(r){return String(r).padStart(2,"0")}function Pt(r,t,o){if(t==="12h"){const s=r.hours%12||12,a=r.hours<12?"AM":"PM";return o?`${he(s)}:${he(r.minutes)}:${he(r.seconds??0)} ${a}`:`${he(s)}:${he(r.minutes)} ${a}`}return o?`${he(r.hours)}:${he(r.minutes)}:${he(r.seconds??0)}`:`${he(r.hours)}:${he(r.minutes)}`}const Ot={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},Ye={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",fontVariantNumeric:"tabular-nums"},Ut={sm:"h-8 px-3",md:"h-10 px-3.5",lg:"h-11 px-4"};function Ge({options:r,value:t,onChange:o,label:s}){const a=r.indexOf(t);return e.jsxs("div",{className:"flex flex-col items-center gap-1 w-12",children:[e.jsx("button",{type:"button",onClick:()=>{const l=r[(a-1+r.length)%r.length];o(l)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(b.ChevronUp,{size:14})}),e.jsx("div",{className:"text-foreground w-full text-center px-1 py-1 rounded-[var(--radius-md)] bg-muted/20",style:Ye,children:he(t)}),e.jsx("button",{type:"button",onClick:()=>{const l=r[(a+1)%r.length];o(l)},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(b.ChevronDown,{size:14})}),e.jsx("span",{className:"text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:s})]})}function mr({value:r,onChange:t,format:o="24h",showSeconds:s=!1,minuteStep:a=1,placeholder:l="Select time",size:n="md",disabled:d=!1,className:i=""}){const[f,p]=c.useState(!1),[m,w]=c.useState({hours:0,minutes:0,seconds:0}),h=c.useRef(null),g=r??m,x=o==="12h"?Array.from({length:12},(M,D)=>D+1):Array.from({length:24},(M,D)=>D),y=Array.from({length:Math.ceil(60/a)},(M,D)=>D*a),S=Array.from({length:60},(M,D)=>D),F=["AM","PM"];c.useEffect(()=>{function M(D){h.current&&!h.current.contains(D.target)&&p(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);function u(M){const D={...g,...M};w(D),t==null||t(D)}const N=Pt(g,o,s),v=r!==void 0||m.hours!==0||m.minutes!==0,$=o==="12h"?g.hours%12||12:g.hours,z=g.hours<12;function A(M,D){let T=M%12;D||(T+=12),u({hours:T})}return e.jsxs("div",{ref:h,className:`relative inline-block ${i}`,children:[e.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&p(!f),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[120px]",Ut[n],f?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ot,children:[e.jsx(b.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:v?"text-foreground":"text-muted-foreground",children:v?N:l})]}),f&&e.jsx("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[o==="12h"?e.jsx(Ge,{options:x,value:$,onChange:M=>A(M,z),label:"Hour"}):e.jsx(Ge,{options:x,value:g.hours,onChange:M=>u({hours:M}),label:"Hour"}),e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ye,children:":"}),e.jsx(Ge,{options:y,value:g.minutes,onChange:M=>u({minutes:M}),label:"Min"}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-muted-foreground text-lg mt-3",style:Ye,children:":"}),e.jsx(Ge,{options:S,value:g.seconds??0,onChange:M=>u({seconds:M}),label:"Sec"})]}),o==="12h"&&e.jsxs("div",{className:"flex flex-col gap-1 ml-1",children:[e.jsx("div",{className:"h-5"}),F.map(M=>e.jsx("button",{type:"button",onClick:()=>A($,M==="AM"),className:["px-2 py-1 rounded-[var(--radius-md)] transition-colors",M==="AM"===z?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted/30 cursor-pointer"].join(" "),style:Ye,children:M},M))]})]})})]})}mr.displayName="TimePicker";function Zt({value:r,onChange:t,format:o="24h",showSeconds:s=!1,placeholder:a="Select date & time",size:l="md",minDate:n,maxDate:d,disabled:i=!1,className:f=""}){const[p,m]=c.useState(!1),[w,h]=c.useState(r??new Date),g=c.useRef(null),x=r??w,y=new Date,[S,F]=c.useState(x.getMonth()),[u,N]=c.useState(x.getFullYear());c.useEffect(()=>{function k(E){g.current&&!g.current.contains(E.target)&&m(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);function v(k){h(k),t==null||t(k)}function $(k){const E=new Date(k);E.setHours(x.getHours(),x.getMinutes(),x.getSeconds(),0),v(E)}function z(k){const E=new Date(x);E.setHours(k.hours,k.minutes,k.seconds??0,0),v(E)}const A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],M=["Su","Mo","Tu","We","Th","Fr","Sa"];function D(){const k=[],E=new Date(u,S,1),B=new Date(E);B.setDate(B.getDate()-B.getDay());for(let O=0;O<42;O++)k.push(new Date(B)),B.setDate(B.getDate()+1);return k}const T={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},W={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},C=`${x.toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})} ${Pt({hours:x.getHours(),minutes:x.getMinutes(),seconds:x.getSeconds()},o,s)}`;return e.jsxs("div",{ref:g,className:`relative inline-block ${f}`,children:[e.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&m(!p),className:["flex items-center gap-2 border border-border bg-card rounded-[var(--radius-md)] transition-colors min-w-[200px]",Ut[l],p?"border-primary ring-2 ring-primary/20":"hover:border-primary/40",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Ot,children:[e.jsx(b.Clock,{size:14,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:"text-foreground",children:C})]}),p&&e.jsxs("div",{className:"absolute top-full mt-1 z-50 bg-card border border-border rounded-[var(--radius-md)] shadow-[0_4px_24px_0_rgba(0,0,0,0.1)] p-4 flex gap-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{type:"button",onClick:()=>{S===0?(F(11),N(u-1)):F(S-1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(b.ChevronLeft,{size:14})}),e.jsxs("span",{style:W,children:[A[S]," ",u]}),e.jsx("button",{type:"button",onClick:()=>{S===11?(F(0),N(u+1)):F(S+1)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] hover:bg-muted/40 text-muted-foreground cursor-pointer",children:e.jsx(b.ChevronRight,{size:14})})]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:M.map(k=>e.jsx("div",{className:"text-center text-muted-foreground",style:T,children:k},k))}),e.jsx("div",{className:"grid grid-cols-7 gap-y-0.5",children:D().map((k,E)=>{const B=k.getMonth()===S,O=r?k.toDateString()===r.toDateString():k.toDateString()===w.toDateString(),P=k.toDateString()===y.toDateString();return e.jsx("button",{type:"button",onClick:()=>$(k),className:["h-7 w-full text-center transition-colors rounded-[var(--radius-md)] cursor-pointer",B?"":"text-muted-foreground/40",O?"bg-primary text-primary-foreground font-semibold":P?"border border-primary text-primary":"hover:bg-muted/40"].filter(Boolean).join(" "),style:T,children:k.getDate()},E)})})]}),e.jsx("div",{className:"w-px bg-border"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:T,children:"Time"}),e.jsx(mr,{value:{hours:x.getHours(),minutes:x.getMinutes(),seconds:x.getSeconds()},onChange:z,format:o,showSeconds:s,size:"sm"})]})]})]})}Zt.displayName="DateTimePicker";const Ia={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ha={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},_a={fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},Pa={sm:"p-3 gap-2.5 rounded-[var(--radius-md)]",md:"p-4 gap-3 rounded-[var(--radius-md)]",lg:"p-5 gap-4 rounded-[var(--radius-md)]"},Oa={sm:"w-8 h-8 rounded-[var(--radius-sm)]",md:"w-10 h-10 rounded-[var(--radius-md)]",lg:"w-12 h-12 rounded-[var(--radius-md)] text-lg"};function Yt({value:r,title:t,description:o,icon:s,badge:a,selected:l=!1,disabled:n=!1,showArrow:d=!0,showCheck:i=!1,size:f="md",layout:p="horizontal",onClick:m,className:w=""}){const h=p==="vertical";return e.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&(m==null?void 0:m(r)),className:["w-full text-left border transition-all duration-150",Pa[f],h?"flex flex-col items-center text-center":"flex items-center",l?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/20",n?"opacity-50 cursor-not-allowed":"cursor-pointer",w].filter(Boolean).join(" "),"aria-pressed":l,children:[s&&e.jsx("div",{className:[Oa[f],"flex items-center justify-center flex-shrink-0",l?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:s}),e.jsxs("div",{className:`flex-1 min-w-0 ${h?"mt-2":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Ia,children:t}),a&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:_a,children:a})]}),o&&e.jsx("p",{className:`text-muted-foreground mt-0.5 ${h?"line-clamp-2":"truncate"}`,style:Ha,children:o})]}),!h&&e.jsx("div",{className:"flex-shrink-0 ml-auto pl-2",children:i&&l?e.jsx("span",{className:"w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(b.Check,{size:12})}):d?e.jsx(b.ChevronRight,{size:16,className:l?"text-primary":"text-muted-foreground"}):null}),h&&l&&e.jsx("div",{className:"mt-2 w-5 h-5 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:e.jsx(b.Check,{size:12})})]})}Yt.displayName="ChoiceCard";function Gt({value:r,onChange:t,layout:o="horizontal",size:s="md",children:a,className:l=""}){return e.jsx("div",{className:["grid gap-3",o==="vertical"?"grid-cols-2 sm:grid-cols-3":"grid-cols-1",l].join(" "),role:"group",children:c.Children.map(a,n=>c.isValidElement(n)?c.cloneElement(n,{selected:r===n.props.value,onClick:d=>t==null?void 0:t(d),layout:o,size:s}):n)})}Gt.displayName="ChoiceCardGroup";const Ua={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Za={fontFamily:"var(--font-p)",fontSize:"var(--text-button)",fontWeight:"var(--weight-p)"},Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ga={sm:"p-3",md:"p-4",lg:"p-5"},Xa={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12"},Ka={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-2 lg:grid-cols-4"};function Xt({options:r,value:t,onChange:o,columns:s=2,layout:a="grid",size:l="md",name:n,className:d=""}){const i=n??`radio-card-${Math.random().toString(36).slice(2,7)}`;return e.jsx("div",{className:[a==="grid"?`grid gap-3 ${Ka[s]}`:"flex flex-col gap-2",d].join(" "),role:"radiogroup",children:r.map(f=>{const p=t===f.value,m=f.disabled??!1;return e.jsxs("label",{className:["relative flex items-start gap-3 border rounded-[var(--radius-md)] cursor-pointer transition-all duration-150",Ga[l],p?"border-primary bg-primary/5 shadow-[0_0_0_1px_var(--primary)]":"border-border bg-card hover:border-primary/40 hover:bg-muted/10",m?"opacity-50 cursor-not-allowed":""].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",name:i,value:f.value,checked:p,disabled:m,onChange:()=>!m&&(o==null?void 0:o(f.value)),className:"sr-only"}),e.jsx("div",{className:["flex-shrink-0 mt-0.5 w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors",p?"border-primary bg-primary":"border-border bg-transparent"].join(" "),children:p&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-foreground"})}),f.icon&&e.jsx("div",{className:[Xa[l],"flex-shrink-0 flex items-center justify-center rounded-[var(--radius-md)]",p?"bg-primary/10 text-primary":"bg-muted/40 text-muted-foreground"].join(" "),children:f.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-foreground",style:Ua,children:f.title}),f.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary/10 text-primary",style:Ya,children:f.badge})]}),f.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Za,children:f.description})]})]},f.value)})})}Xt.displayName="RadioCard";function qa(){return Math.random().toString(36).slice(2,9)}function Ja(r={}){return{id:qa(),values:{...r}}}const Qa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Kt={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function qt({columns:r,value:t,onChange:o,defaultRow:s={},minRows:a=0,maxRows:l,addLabel:n="Add row",sortable:d=!1,disabled:i=!1,className:f=""}){const[p,m]=c.useState(()=>t??[]),w=t??p,h=v=>{m(v),o==null||o(v)},g=()=>{l!==void 0&&w.length>=l||h([...w,Ja(s)])},x=v=>{w.length<=a||h(w.filter($=>$.id!==v))},y=(v,$,z)=>{h(w.map(A=>A.id===v?{...A,values:{...A.values,[$]:z}}:A))},S=(v,$)=>{const z=[...w],[A]=z.splice(v,1);z.splice($,0,A),h(z)},F=w.length<=a,u=l!==void 0&&w.length>=l,N=c.useRef(null);return e.jsxs("div",{className:`space-y-2 ${f}`,children:[e.jsxs("div",{className:["flex items-center gap-2 px-3 text-muted-foreground",d?"pl-9":""].join(" "),children:[r.map(v=>e.jsx("div",{style:{width:v.width??"1fr",flex:v.width?"none":"1"},className:"min-w-0",children:e.jsx("span",{style:Qa,children:v.label})},v.key)),e.jsx("div",{className:"w-8 flex-shrink-0"})]}),e.jsx("div",{className:"space-y-2",children:w.map((v,$)=>e.jsxs("div",{className:["flex items-center gap-2 p-2 rounded-[var(--radius-md)] border border-border bg-card transition-colors",i?"opacity-60":""].join(" "),draggable:d&&!i,onDragStart:()=>{N.current=$},onDragOver:z=>{z.preventDefault()},onDrop:()=>{N.current!==null&&N.current!==$&&(S(N.current,$),N.current=null)},children:[d&&e.jsx("div",{className:"cursor-grab text-muted-foreground/50 hover:text-muted-foreground flex-shrink-0",children:e.jsx(b.GripVertical,{size:14})}),r.map(z=>e.jsx("div",{style:{width:z.width??"1fr",flex:z.width?"none":"1"},className:"min-w-0",children:z.render(v.values[z.key],A=>y(v.id,z.key,A),$)},z.key)),e.jsx("button",{type:"button",disabled:i||F,onClick:()=>x(v.id),className:["flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] transition-colors",i||F?"text-muted-foreground/30 cursor-not-allowed":"text-muted-foreground hover:text-destructive hover:bg-destructive/10 cursor-pointer"].join(" "),"aria-label":"Remove row",children:e.jsx(b.Trash2,{size:14})})]},v.id))}),w.length===0&&e.jsx("div",{className:"text-center py-6 text-muted-foreground rounded-[var(--radius-md)] border border-dashed border-border",children:e.jsxs("span",{style:Kt,children:['No rows yet. Click "',n,'" to begin.']})}),!u&&e.jsxs("button",{type:"button",disabled:i,onClick:g,className:["flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-md)] border border-dashed border-primary/40 text-primary hover:bg-primary/5 transition-colors",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),style:Kt,children:[e.jsx(b.Plus,{size:14}),n]})]})}qt.displayName="RepeatableFieldList";const Va={history:[{cmd:"undo",icon:b.Undo,title:"Undo"},{cmd:"redo",icon:b.Redo,title:"Redo"}],format:[{cmd:"bold",icon:b.Bold,title:"Bold"},{cmd:"italic",icon:b.Italic,title:"Italic"},{cmd:"underline",icon:b.Underline,title:"Underline"},{cmd:"strikethrough",icon:b.Strikethrough,title:"Strikethrough"}],list:[{cmd:"insertUnorderedList",icon:b.List,title:"Bullet list"},{cmd:"insertOrderedList",icon:b.ListOrdered,title:"Numbered list"}],align:[{cmd:"justifyLeft",icon:b.AlignLeft,title:"Align left"},{cmd:"justifyCenter",icon:b.AlignCenter,title:"Align center"},{cmd:"justifyRight",icon:b.AlignRight,title:"Align right"}],block:[{cmd:"formatBlock-h2",icon:b.Heading2,title:"Heading 2"},{cmd:"formatBlock-blockquote",icon:b.Quote,title:"Blockquote"},{cmd:"formatBlock-pre",icon:b.Code,title:"Code block"}],link:[{cmd:"createLink",icon:b.Link,title:"Insert link"},{cmd:"unlink",icon:b.Unlink,title:"Remove link"}]},Ra={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},el={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1.6",color:"var(--foreground)"};function Jt({value:r="",onChange:t,placeholder:o="Start typing…",minHeight:s=160,maxHeight:a=480,toolbar:l=["history","format","list","align","link","block"],fullscreen:n=!0,disabled:d=!1,readOnly:i=!1,size:f="md",className:p=""}){const m=c.useRef(null),[w,h]=c.useState(!1),[g,x]=c.useState(new Set),[y,S]=c.useState(!r);c.useEffect(()=>{m.current&&r&&m.current.innerHTML!==r&&(m.current.innerHTML=r,S(!1))},[]);const F=c.useCallback(()=>{const A=new Set;["bold","italic","underline","strikethrough","insertUnorderedList","insertOrderedList","justifyLeft","justifyCenter","justifyRight"].forEach(M=>{try{document.queryCommandState(M)&&A.add(M)}catch{}}),x(A)},[]);function u(A){var M;if(!(d||i)){if((M=m.current)==null||M.focus(),A.startsWith("formatBlock-")){const D=A.replace("formatBlock-","");document.execCommand("formatBlock",!1,D)}else if(A==="createLink"){const D=window.prompt("Enter URL:");D&&document.execCommand("createLink",!1,D)}else document.execCommand(A,!1);F(),m.current&&t&&t(m.current.innerHTML)}}function N(){if(m.current){const A=m.current.innerHTML,M=m.current.innerText.trim();S(!M),t==null||t(A),F()}}const $=s??{sm:120,md:160,lg:240}[f],z=["border border-border rounded-[var(--radius-md)] bg-card overflow-hidden transition-all",w?"fixed inset-4 z-[var(--z-modal)] flex flex-col shadow-[0_8px_48px_rgba(0,0,0,0.2)]":"relative",d?"opacity-60":"",p].filter(Boolean).join(" ");return e.jsxs("div",{className:z,children:[!i&&e.jsxs("div",{className:"flex items-center gap-0.5 flex-wrap px-2 py-1.5 border-b border-border bg-muted/10",children:[l.map((A,M)=>{const D=Va[A];return e.jsxs(c.Fragment,{children:[M>0&&e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),D.map(T=>{const W=T.icon,C=g.has(T.cmd);return e.jsx("button",{type:"button",title:T.title,disabled:d,onMouseDown:k=>{k.preventDefault(),u(T.cmd)},className:["w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] transition-colors",C?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/40 hover:text-foreground",d?"cursor-not-allowed":"cursor-pointer"].join(" "),children:e.jsx(W,{size:13})},T.cmd)})]},A)}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ml-auto w-px h-5 bg-border mx-1"}),e.jsx("button",{type:"button",title:w?"Exit fullscreen":"Fullscreen",onClick:()=>h(!w),className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors cursor-pointer",children:w?e.jsx(b.Minimize2,{size:13}):e.jsx(b.Maximize2,{size:13})})]})]}),e.jsxs("div",{className:"relative flex-1",children:[y&&e.jsx("div",{className:"absolute top-0 left-0 pointer-events-none p-4 text-muted-foreground",style:Ra,children:o}),e.jsx("div",{ref:m,contentEditable:!d&&!i,suppressContentEditableWarning:!0,onInput:N,onKeyUp:F,onMouseUp:F,className:["outline-none p-4 overflow-y-auto","prose-p:my-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:my-3","[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_pre]:bg-muted/30 [&_pre]:rounded [&_pre]:p-2 [&_pre]:text-sm","[&_a]:text-primary [&_a]:underline","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5",w?"flex-1":""].filter(Boolean).join(" "),style:{...el,minHeight:w?void 0:$,maxHeight:w?void 0:a},"data-placeholder":o})]})]})}Jt.displayName="RichTextEditor";const yr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Me={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)"},rl={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",5:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6"};function tl({images:r,startIdx:t,onClose:o}){const[s,a]=c.useState(t),l=r[s],n=()=>a(i=>(i-1+r.length)%r.length),d=()=>a(i=>(i+1)%r.length);return c.useEffect(()=>{function i(f){f.key==="Escape"&&o(),f.key==="ArrowLeft"&&n(),f.key==="ArrowRight"&&d()}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),e.jsxs("div",{className:"fixed inset-0 z-[var(--z-modal)] bg-black/90 flex items-center justify-center",onClick:o,children:[e.jsx("button",{type:"button",onClick:o,className:"absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(b.X,{size:16})}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),n()},className:"absolute left-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(b.ChevronLeft,{size:20})}),e.jsxs("div",{className:"max-w-4xl max-h-[80vh] px-16",onClick:i=>i.stopPropagation(),children:[e.jsx("img",{src:l.src,alt:l.alt??l.name,className:"max-w-full max-h-[70vh] object-contain rounded-[var(--radius-md)]"}),l.name&&e.jsxs("p",{className:"text-center text-white/70 mt-3",style:Me,children:[l.name," ",l.size?`· ${l.size}`:""]}),r.length>1&&e.jsxs("p",{className:"text-center text-white/40 mt-1",style:Me,children:[s+1," / ",r.length]})]}),r.length>1&&e.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),d()},className:"absolute right-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors cursor-pointer",children:e.jsx(b.ChevronRight,{size:20})})]})}function wr({src:r,alt:t="",caption:o,subCaption:s,size:a="sm",onClick:l,className:n=""}){const d={xs:"w-8 h-8",sm:"w-10 h-10",md:"w-14 h-14"};return e.jsxs("div",{className:`flex items-center gap-2.5 ${l?"cursor-pointer":""} ${n}`,onClick:l,children:[e.jsx("div",{className:`${d[a]} flex-shrink-0 rounded-[var(--radius-md)] overflow-hidden bg-muted/20 border border-border`,children:e.jsx("img",{src:r,alt:t,className:"w-full h-full object-cover",onError:i=>{i.target.style.display="none"}})}),(o||s)&&e.jsxs("div",{className:"min-w-0",children:[o&&e.jsx("div",{className:"truncate text-foreground",style:yr,children:o}),s&&e.jsx("div",{className:"truncate text-muted-foreground",style:Me,children:s})]})]})}wr.displayName="ThumbnailCell";function Qt({images:r,selectable:t=!1,selectedIds:o=[],onSelectChange:s,maxSelect:a,lightbox:l=!0,uploadable:n=!1,onUpload:d,onDelete:i,defaultLayout:f="grid",columns:p=4,disabled:m=!1,className:w=""}){const[h,g]=c.useState(f),[x,y]=c.useState(null),S=c.useRef(null);function F(v){if(m)return;if(o.includes(v))s==null||s(o.filter(z=>z!==v));else{if(a&&o.length>=a)return;s==null||s([...o,v])}}function u(v,$){t?F($):l&&y(v)}const N=c.useCallback(v=>{var $;($=v.target.files)!=null&&$.length&&(d==null||d(v.target.files),v.target.value="")},[d]);return r.length===0&&!n?e.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground border border-dashed border-border rounded-[var(--radius-md)]",children:e.jsx("span",{style:yr,children:"No images yet"})}):e.jsxs("div",{className:w,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("span",{className:"text-muted-foreground",style:Me,children:[r.length," image",r.length!==1?"s":"",t&&o.length>0&&` · ${o.length} selected`]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:S,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N}),e.jsxs("button",{type:"button",disabled:m,onClick:()=>{var v;return(v=S.current)==null?void 0:v.click()},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-card hover:bg-muted/20 text-foreground transition-colors cursor-pointer",style:Me,children:[e.jsx(b.Upload,{size:12}),"Upload"]})]}),e.jsx("button",{type:"button",onClick:()=>g("grid"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${h==="grid"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(b.Grid,{size:14})}),e.jsx("button",{type:"button",onClick:()=>g("list"),className:`w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${h==="list"?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted/30"}`,children:e.jsx(b.List,{size:14})})]})]}),h==="grid"&&e.jsx("div",{className:`grid gap-2 ${rl[p]}`,children:r.map((v,$)=>{const z=o.includes(v.id);return e.jsxs("div",{className:["relative group rounded-[var(--radius-md)] overflow-hidden border transition-all cursor-pointer",z?"border-primary shadow-[0_0_0_2px_var(--primary)]":"border-border hover:border-primary/40"].join(" "),onClick:()=>u($,v.id),children:[e.jsx("div",{className:"aspect-square",children:e.jsx("img",{src:v.src,alt:v.alt??v.name,className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center",children:!t&&l&&e.jsx(b.ZoomIn,{size:20,className:"text-white opacity-0 group-hover:opacity-100 transition-opacity"})}),t&&e.jsx("div",{className:["absolute top-1.5 left-1.5 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all",z?"bg-primary border-primary":"bg-white/80 border-white"].join(" "),children:z&&e.jsx(b.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),i(v.id)},className:"absolute top-1.5 right-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-black/60 text-white opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive cursor-pointer",children:e.jsx(b.Trash2,{size:10})})]},v.id)})}),h==="list"&&e.jsx("div",{className:"space-y-1.5",children:r.map((v,$)=>{const z=o.includes(v.id);return e.jsxs("div",{className:["flex items-center gap-3 p-2.5 rounded-[var(--radius-md)] border transition-all cursor-pointer",z?"border-primary bg-primary/5":"border-border hover:bg-muted/10"].join(" "),onClick:()=>u($,v.id),children:[e.jsx(wr,{src:v.src,alt:v.alt,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"truncate text-foreground",style:yr,children:v.name??v.alt??`Image ${$+1}`}),v.size&&e.jsx("div",{className:"text-muted-foreground",style:Me,children:v.size})]}),t&&z&&e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(b.Check,{size:10,className:"text-primary-foreground"})}),i&&e.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),i(v.id)},className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer flex-shrink-0",children:e.jsx(b.Trash2,{size:13})})]},v.id)})}),x!==null&&e.jsx(tl,{images:r,startIdx:x,onClose:()=>y(null)})]})}Qt.displayName="ImageGallery";const Nr=c.createContext(null);Nr.displayName="AppShellContext";const Cr=c.createContext(null);Cr.displayName="AppShellFullContext";function Sr({user:r=null,product:t=null,navResolver:o,sidebarOpen:s,onSidebarChange:a,defaultSidebarOpen:l=!0,children:n}){const d=s!==void 0,[i,f]=c.useState(l),p=d?s:i,m=c.useCallback(N=>{d||f(N),a==null||a(N)},[d,a]),[w,h]=c.useState([]),g=c.useCallback(N=>{h(N)},[]),[x,y]=c.useState({groups:[],loading:!1,error:null}),S=c.useRef(0),F=c.useCallback(async()=>{if(!o||!r){y({groups:[],loading:!1,error:null});return}const N=++S.current;y(v=>({...v,loading:!0,error:null}));try{const v=await o(r);if(N!==S.current)return;y({groups:v,loading:!1,error:null})}catch(v){if(N!==S.current)return;y({groups:[],loading:!1,error:v instanceof Error?v.message:"Failed to load navigation"})}},[o,r]);c.useEffect(()=>{F()},[F]),c.useEffect(()=>{if(!(t!=null&&t.product))return;const N=document.documentElement.getAttribute("data-product");return document.documentElement.setAttribute("data-product",t.product),()=>{N?document.documentElement.setAttribute("data-product",N):document.documentElement.removeAttribute("data-product")}},[t==null?void 0:t.product]);const u=c.useMemo(()=>({sidebarOpen:p,setSidebarOpen:m,user:r,product:t,breadcrumbs:w,setBreadcrumbs:g,navGroups:x.groups,navLoading:x.loading,navError:x.error,refreshNav:F}),[p,m,r,t,w,g,x.groups,x.loading,x.error,F]);return e.jsx(Cr.Provider,{value:u,children:e.jsx(Nr.Provider,{value:u,children:n})})}Sr.displayName="AppShellProvider";function Vt(){const r=c.useContext(Nr);if(!r)throw new Error("[useAppShell] must be used inside <AppShellProvider>. Wrap your app root with <AppShellProvider user={...} product={...}>.");return r}function Rt(){const r=c.useContext(Cr);if(!r)throw new Error("[useAppShellFull] must be used inside <AppShellProvider>.");return r}function ol(r){const{setBreadcrumbs:t}=Vt(),o=JSON.stringify(r);c.useEffect(()=>(t(r),()=>t([])),[o])}function sl(r,t){const[o,s]=c.useState({groups:[],loading:!1,error:null}),a=c.useRef(0),l=c.useCallback(async()=>{if(!r||!t){s({groups:[],loading:!1,error:null});return}const n=++a.current;s(d=>({...d,loading:!0,error:null}));try{const d=await r(t);if(n!==a.current)return;s({groups:d,loading:!1,error:null})}catch(d){if(n!==a.current)return;s({groups:[],loading:!1,error:d instanceof Error?d.message:"Navigation load failed"})}},[r,t]);return c.useEffect(()=>{l()},[l]),{...o,refresh:l}}class eo extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("[AppShellErrorBoundary] Caught error:",t,o)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[200px] gap-3 p-6 text-center",role:"alert",children:[e.jsx("div",{className:"text-destructive",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:"Something went wrong in this section."}),e.jsx("button",{type:"button",onClick:()=>this.setState({hasError:!1}),className:"px-4 py-1.5 rounded-[var(--radius-md)] border border-border text-muted-foreground hover:bg-muted/20 transition-colors text-sm cursor-pointer",children:"Try again"})]}):this.props.children}}function R({children:r,className:t=""}){return r?e.jsx("div",{className:t,children:r}):null}function ro({children:r}){return r?e.jsx("div",{className:"sticky bottom-0 left-0 right-0 z-[var(--z-sticky)] bg-card border-t border-border px-6 py-3 flex items-center justify-end gap-3",children:r}):null}function to({p:r}){const t=r.gap??"gap-5";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stats}),e.jsx(R,{children:r.filters}),e.jsx(R,{className:"min-h-0",children:r.content}),e.jsx(R,{children:r.footer})]})}function al({p:r}){const t=r.gap??"gap-6",o=r.asideWidth??"w-80";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:`flex flex-col lg:flex-row ${t} min-h-0`,children:[r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside}),e.jsx("div",{className:"flex-1 min-w-0 flex flex-col gap-5",children:r.main??r.content}),!r.asideLeft&&e.jsx("div",{className:`flex-shrink-0 ${o} lg:sticky lg:top-4 lg:max-h-[calc(100vh-5rem)] lg:overflow-y-auto`,children:r.aside})]})]})}function ll({p:r}){const t=r.gap??"gap-8";return e.jsxs("div",{className:`flex flex-col ${t} max-w-3xl`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:`flex flex-col ${t}`,children:r.sections??r.content})]})}function nl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.stepper}),e.jsx(R,{className:"flex-1",children:r.form??r.content})]}),e.jsx(ro,{children:r.actions})]})}function il({p:r}){const t=r.gap??"gap-6",o=r.primaryChart&&r.secondaryCharts;return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{children:r.kpis??r.stats}),o?e.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-3 ${t}`,children:[e.jsx("div",{className:"lg:col-span-2",children:r.primaryChart}),e.jsx("div",{className:"flex flex-col gap-4",children:r.secondaryCharts})]}):e.jsxs(e.Fragment,{children:[e.jsx(R,{children:r.primaryChart??r.charts}),e.jsx(R,{children:r.secondaryCharts})]}),e.jsx(R,{children:r.content??r.table}),e.jsx(R,{children:r.footer})]})}function dl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsxs("div",{className:`flex flex-col ${t} flex-1 pb-24`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsx(R,{className:"flex-1 max-w-2xl",children:r.form??r.content})]}),e.jsx(ro,{children:r.actions})]})}function cl({p:r}){const t=r.gap??"gap-6";return e.jsxs("div",{className:`flex flex-col ${t}`,children:[e.jsx(R,{children:r.header}),e.jsx(R,{children:r.banner}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[r.stats&&e.jsx("div",{className:"flex-1",children:r.stats}),r.dateRange&&e.jsx("div",{className:"flex-shrink-0",children:r.dateRange})]}),e.jsx(R,{children:r.filters}),e.jsx(R,{children:r.charts??r.primaryChart}),r.secondaryCharts&&e.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 ${t}`,children:r.secondaryCharts}),e.jsx(R,{children:r.table??r.content}),e.jsx(R,{children:r.footer})]})}function oo(r){const{layout:t="list",maxWidth:o,padding:s,className:a=""}=r,l=s??"p-4 sm:p-6",n=o?`${o} mx-auto w-full`:"w-full",d=(()=>{switch(t){case"list":return e.jsx(to,{p:r});case"detail":return e.jsx(al,{p:r});case"settings":return e.jsx(ll,{p:r});case"wizard":return e.jsx(nl,{p:r});case"dashboard":return e.jsx(il,{p:r});case"form":return e.jsx(dl,{p:r});case"report":return e.jsx(cl,{p:r});default:return e.jsx(to,{p:r})}})();return e.jsx("div",{className:`${l} ${n} ${a}`,children:d})}oo.displayName="FeaturePageScaffold";const fl={fontFamily:"var(--font-label)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-button)",color:"var(--foreground)"},hl={fontFamily:"var(--font-p)",fontSize:"var(--text-label)",fontWeight:"var(--weight-p)",color:"var(--muted-foreground)"};function so({title:r,description:t,action:o,children:s,className:a=""}){return e.jsxs("section",{className:`space-y-4 ${a}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{style:fl,children:r}),t&&e.jsx("p",{className:"mt-1",style:hl,children:t})]}),o&&e.jsx("div",{className:"flex-shrink-0",children:o})]}),e.jsx("div",{className:"border-t border-border pt-4",children:s})]})}so.displayName="ScaffoldSection";function ao({children:r,className:t=""}){return e.jsx("div",{className:`grid grid-cols-2 lg:grid-cols-4 gap-4 ${t}`,children:r})}ao.displayName="ScaffoldKPIRow";function ul(r){return r.map(t=>({label:t.title??"",items:t.items.filter(o=>!o.disabled).map(o=>({id:o.id,label:o.label,icon:o.icon,badge:typeof o.badge=="function"?void 0:o.badge}))}))}function pl({activeItemId:r,onNavigate:t,notificationCount:o,onNotificationClick:s,onAppSwitcherClick:a,onUserClick:l,onSearchClick:n,searchMode:d,showSearch:i,title:f,version:p,versionDate:m,contentPadding:w=!0,utilityItems:h,children:g,className:x=""}){var P,_,Q;const{sidebarOpen:y,setSidebarOpen:S,user:F,product:u,breadcrumbs:N,navGroups:v,navLoading:$,navError:z,refreshNav:A}=Rt(),[M,D]=c.useState(!(((P=u==null?void 0:u.shell)==null?void 0:P.sidebarDefaultOpen)??!0)),[T,W]=c.useState(!1),C=d??(i?"bar":"none");c.useEffect(()=>{function I(){window.innerWidth>=768&&W(!1)}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const k=ul(v),E=c.useCallback(I=>{const G=v.flatMap(te=>te.items).find(te=>te.id===I.id);G&&t&&t(G),W(!1)},[v,t]),B=e.jsx(Pe,{groups:$?[{label:"Loading",items:[]}]:k,activeItem:r,onNavigate:E,collapsed:M,onCollapsedChange:D,showCollapseToggle:!1,utilityItems:h,version:p,versionDate:m}),O=M?"var(--shell-sidebar-collapsed, 64px)":"var(--shell-sidebar-width, 200px)";return e.jsxs("div",{className:`min-h-screen bg-[var(--background)] ${x}`,"data-product":u==null?void 0:u.product,children:[e.jsx("div",{className:"fixed top-0 left-0 right-0",style:{zIndex:"var(--z-shell-navbar, 100)"},children:e.jsx(nr,{brand:u?{name:u.brand.name,logo:typeof u.brand.logo=="string"?u.brand.logo:void 0,logoFull:u.brand.logoFull??(u.brand.logo&&typeof u.brand.logo!="string"?u.brand.logo:void 0)}:{name:"Sellsuki"},title:f,breadcrumbs:N.map(I=>({label:I.label,href:I.href})),user:F?{name:F.name,avatar:F.avatar}:void 0,searchMode:C,onSearchClick:n,notificationCount:o,onNotificationClick:s,onAppSwitcherClick:a,onUserClick:l,workspaceSwitcher:(_=u==null?void 0:u.brand)==null?void 0:_.workspaceSwitcher,onSidebarToggle:()=>{window.innerWidth<768?W(I=>!I):D(I=>!I)},onMobileMenuClick:()=>W(I=>!I)})}),e.jsx("aside",{className:"hidden md:flex flex-col fixed left-0 bottom-0 overflow-hidden",style:{top:"var(--shell-navbar-height, 56px)",width:O,zIndex:"var(--z-shell-sidebar, 90)",transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))"},children:$?e.jsx("div",{className:"p-4 w-full",children:e.jsx(sr,{rows:6})}):z?e.jsxs("div",{className:"p-3",children:[e.jsx(Qe,{variant:"error",children:e.jsx("span",{style:{fontSize:"var(--text-label)"},children:"Nav load failed"})}),e.jsx("button",{type:"button",className:"mt-2 text-primary cursor-pointer hover:underline",style:{fontSize:"var(--text-label)"},onClick:A,children:"Retry"})]}):B}),T&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/40 md:hidden",style:{zIndex:"var(--z-shell-overlay, 80)"},onClick:()=>W(!1)}),e.jsx("div",{className:"fixed left-0 bottom-0 bg-card shadow-lg md:hidden overflow-y-auto",style:{top:"var(--shell-navbar-height, 56px)",width:"var(--shell-sidebar-width, 200px)",zIndex:"var(--z-shell-sidebar, 90)"},children:$?e.jsx("div",{className:"p-4",children:e.jsx(sr,{rows:6})}):e.jsx(Pe,{groups:k,activeItem:r,onNavigate:E,collapsed:!1,showCollapseToggle:!1,utilityItems:h,version:p,versionDate:m})})]}),e.jsx("main",{className:`min-h-screen ${w?"":"p-0"}`,style:{paddingTop:"var(--shell-navbar-height, 56px)",marginLeft:O,transition:"margin-left var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",maxWidth:(Q=u==null?void 0:u.shell)==null?void 0:Q.contentMaxWidth},children:e.jsx(eo,{children:g})}),e.jsx(Er,{})]})}function lo({product:r,user:t,navResolver:o,...s}){var a;return e.jsx(Sr,{product:r,user:t,navResolver:o,defaultSidebarOpen:((a=r==null?void 0:r.shell)==null?void 0:a.sidebarDefaultOpen)??!0,children:e.jsx(pl,{...s})})}lo.displayName="AppShell";function no(){return e.jsxs("div",{className:"min-h-screen bg-[var(--background)] flex flex-col",children:[e.jsxs("div",{className:"h-14 bg-card border-b border-border flex items-center px-4 gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-24 h-4 rounded bg-muted/40 animate-pulse"}),e.jsxs("div",{className:"ml-auto flex gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"}),e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted/40 animate-pulse"})]})]}),e.jsxs("div",{className:"flex flex-1",children:[e.jsxs("div",{className:"w-[200px] border-r border-border p-4 space-y-3 hidden md:block",children:[e.jsx("div",{className:"w-full h-8 rounded-[var(--radius-md)] bg-muted/40 animate-pulse"}),Array.from({length:6}).map((r,t)=>e.jsx("div",{className:"w-full h-7 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"},t))]}),e.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[e.jsx("div",{className:"h-8 w-48 rounded bg-muted/40 animate-pulse"}),e.jsx("div",{className:"h-32 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"}),e.jsx("div",{className:"h-64 rounded-[var(--radius-md)] bg-muted/30 animate-pulse"})]})]})]})}no.displayName="AppShellSkeleton";function bl({height:r=40}){const t=c.useId().replace(/:/g,""),o=r/40,s=`${t}p0`,a=`${t}p1`,l=`${t}p2`,n=`${t}p3`,d=`${t}p4`,i=`${t}p5`,f=`${t}p6`,p=`${t}p7`;return e.jsxs("svg",{width:110*o,height:r,viewBox:"0 0 110 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--foreground, #09193A)"},children:[e.jsx("path",{d:"M19.8585 18.0543H12.5788L16.2191 21.6937L19.8585 18.0543Z",fill:"currentColor"}),e.jsx("path",{d:"M16.2191 21.6937L23.7243 29.1989L27.8987 24.9183C28.3902 24.4148 28.6646 23.7393 28.6646 23.0353V18.0543H19.8595L16.2191 21.6947L16.2191 21.6937Z",fill:"#E6EAEE"}),e.jsx("path",{d:"M28.6637 10.965C28.66 10.3357 27.8728 10.0401 27.4275 10.4854L19.8585 18.0543L16.2182 21.6947L23.7234 29.1999L27.8978 24.9192C28.3893 24.4157 28.6637 23.7403 28.6637 23.0362V10.9797C28.6637 10.9751 28.6637 10.9696 28.6637 10.965Z",fill:`url(#${s})`}),e.jsx("path",{d:"M12.5788 18.0543L4 18.0543V23.0344C4 23.7384 4.27533 24.4148 4.76687 24.9183L8.83129 29.0807L16.2182 21.6938L12.5779 18.0534L12.5788 18.0543Z",fill:"#E6EAEE"}),e.jsx("path",{d:"M8.83221 29.0807L12.2166 32.5473C14.4775 34.8627 18.2019 34.8618 20.4609 32.5445L23.7234 29.1989L16.2182 21.6938L8.83129 29.0807L8.83221 29.0807Z",fill:"#E6EAEE"}),e.jsx("path",{d:"M8.83221 29.0807L12.2166 32.5473C14.4775 34.8627 18.2019 34.8618 20.4609 32.5445L23.7234 29.1989L16.2182 21.6938L8.83129 29.0807L8.83221 29.0807Z",fill:`url(#${a})`}),e.jsx("path",{d:"M16.2191 21.6937L5.05514 10.5298C4.66616 10.1408 4.00092 10.4152 4 10.9659V22.7766C4 23.6451 4.34001 24.4794 4.94704 25.1012L13.4076 33.765C15.0162 35.4124 17.6651 35.4115 19.2718 33.7632L23.2891 29.6433C23.5303 29.3966 23.5275 29.0012 23.2836 28.7573L16.2191 21.6928L16.2191 21.6937Z",fill:`url(#${l})`}),e.jsx("path",{d:"M28.6646 9.05795C27.5115 9.05795 26.5774 8.14972 26.5774 7.02897C26.5774 6.53929 26.7558 6.08933 27.0533 5.73915C27.1198 5.66062 27.1937 5.58947 27.2704 5.52203C27.64 5.19865 28.1278 5 28.6646 5C29.7826 5 30.6927 5.85557 30.7472 6.92919C30.749 6.96245 30.7527 6.99571 30.7527 7.02897C30.7527 7.06224 30.749 7.0955 30.7472 7.12876C30.6936 8.20331 29.7835 9.05795 28.6646 9.05795Z",fill:`url(#${n})`}),e.jsx("path",{d:"M41.3533 24.1526C41.7087 24.5421 42.0996 24.8431 42.5286 25.0569C42.9576 25.2721 43.4193 25.3783 43.9164 25.3783C44.4925 25.3783 44.9624 25.2312 45.3233 24.9357C45.6856 24.6415 45.8667 24.2384 45.8667 23.729C45.8667 23.2864 45.7564 22.9323 45.5344 22.664C45.3137 22.3957 44.9842 22.1587 44.5497 21.9503C44.1139 21.7433 43.5814 21.5186 42.9508 21.2776C42.6158 21.1563 42.2303 20.9929 41.7945 20.7845C41.3587 20.5775 40.9474 20.3092 40.5579 19.981C40.1684 19.6528 39.847 19.251 39.5923 18.7743C39.3376 18.299 39.211 17.7257 39.211 17.0556C39.211 16.2521 39.4152 15.5575 39.8238 14.9746C40.2324 14.3917 40.7881 13.9422 41.4922 13.6276C42.1963 13.313 42.9835 13.155 43.8538 13.155C44.724 13.155 45.5248 13.3062 46.1758 13.6072C46.8255 13.9082 47.3689 14.2909 47.8047 14.7526C47.8442 14.7948 47.8837 14.8384 47.9232 14.8806C48.4775 15.4975 48.3182 16.4686 47.5922 16.8704L47.5636 16.8853C47.0407 17.1741 46.3869 17.0665 45.9879 16.6211C45.9579 16.5871 45.9266 16.5544 45.8953 16.5203C45.6338 16.2452 45.3355 16.0246 45.0005 15.8571C44.6655 15.6896 44.2828 15.6051 43.8551 15.6051C43.2926 15.6051 42.8704 15.7359 42.5885 15.9974C42.3066 16.2589 42.1663 16.5639 42.1663 16.9126C42.1663 17.2612 42.2794 17.5663 42.5082 17.8278C42.7356 18.0893 43.0843 18.3372 43.5541 18.5714C44.0226 18.8057 44.6124 19.044 45.3233 19.2851C45.7782 19.4458 46.2181 19.6473 46.6403 19.8884C47.0625 20.1295 47.4438 20.4209 47.7856 20.7627C48.1275 21.1046 48.3958 21.5064 48.5892 21.9694C48.7839 22.4325 48.8806 22.965 48.8806 23.567C48.8806 24.2506 48.7458 24.8608 48.4789 25.396C48.2106 25.9326 47.8428 26.3848 47.373 26.7525C46.9031 27.1216 46.3774 27.4021 45.7945 27.5969C45.2116 27.7916 44.5987 27.8883 43.9545 27.8883C43.0965 27.8883 42.2957 27.7236 41.5521 27.3953C40.8085 27.0671 40.1616 26.6218 39.6127 26.0579C39.3907 25.8305 39.1878 25.5949 39.0053 25.3524C38.5722 24.7777 38.7125 23.9551 39.3008 23.5397C39.8551 23.1488 40.6233 23.251 41.0427 23.7849C41.1422 23.9115 41.2457 24.0327 41.3505 24.1485L41.3533 24.1526Z",fill:"currentColor"}),e.jsx("path",{d:"M64.1954 13.3306V26.638C64.1954 27.3734 63.6003 27.9686 62.8648 27.9686C62.1294 27.9686 61.5342 27.3734 61.5342 26.638V13.3306C61.5342 12.5952 62.1294 12 62.8648 12C63.6003 12 64.1954 12.5952 64.1954 13.3306Z",fill:"currentColor"}),e.jsx("path",{d:"M69.296 13.3306V26.638C69.296 27.3734 68.7008 27.9686 67.9654 27.9686C67.2299 27.9686 66.6348 27.3734 66.6348 26.638V13.3306C66.6348 12.5952 67.2299 12 67.9654 12C68.7008 12 69.296 12.5952 69.296 13.3306Z",fill:"currentColor"}),e.jsx("path",{d:"M73.7684 25.2272C74.113 25.4546 74.4412 25.6249 74.7531 25.7352C75.0636 25.8455 75.3578 25.9013 75.6343 25.9013C75.9938 25.9013 76.2689 25.8224 76.4637 25.663C76.6571 25.505 76.7538 25.2871 76.7538 25.0106C76.7538 24.7614 76.6748 24.5517 76.5154 24.3787C76.3561 24.2057 76.1246 24.0505 75.8209 23.9129C75.5171 23.7754 75.1304 23.6297 74.6605 23.4771C74.2179 23.311 73.7902 23.1148 73.3762 22.886C72.9622 22.6586 72.6203 22.3549 72.3507 21.9749C72.081 21.5949 71.9462 21.1087 71.9462 20.5136C71.9462 19.9184 72.0987 19.4676 72.4024 19.074C72.7061 18.6804 73.1174 18.3835 73.635 18.1833C74.1525 17.9831 74.73 17.8823 75.3646 17.8823C75.9039 17.8823 76.4078 17.9518 76.8777 18.0893C77.3476 18.2283 77.782 18.4108 78.1838 18.6382C78.557 18.8507 78.8294 19.1394 78.8321 19.6011C78.8389 20.7369 77.5873 20.7424 76.826 20.3665C76.3493 20.1322 75.8835 20.0137 75.4273 20.0137C74.8416 20.0137 74.0735 20.4427 74.6659 21.076C75.1453 21.5881 75.938 21.7257 76.5672 21.964C77.0779 22.1574 77.5519 22.3753 77.9863 22.6164C78.4221 22.8588 78.7708 23.1584 79.0323 23.518C79.2951 23.8775 79.4259 24.3474 79.4259 24.9276C79.4259 25.8809 79.1154 26.6232 78.4929 27.1557C77.8719 27.6868 77.0153 27.9538 75.923 27.9538C75.2461 27.9538 74.6278 27.8639 74.0681 27.6841C73.5083 27.5043 73.0044 27.266 72.555 26.9691C72.4092 26.8724 72.2676 26.773 72.1314 26.6722C71.6779 26.3344 71.588 25.6902 71.9353 25.2435L72.0088 25.1496C72.3479 24.7137 72.9731 24.6416 73.413 24.9766C73.5342 25.0692 73.6527 25.1523 73.7671 25.2286L73.7684 25.2272Z",fill:"currentColor"}),e.jsx("path",{d:"M58.5612 24.7083C58.3365 24.7083 58.1295 24.7818 57.9538 24.9031C57.9484 24.9071 57.9075 24.9398 57.8462 24.9889C57.8435 24.9916 57.8394 24.9943 57.8353 24.997C57.119 25.6616 56.3073 25.8877 55.3294 25.8877C54.8241 25.8877 54.3924 25.7692 54.0328 25.5309C53.6733 25.2926 53.405 24.9494 53.2252 24.5013C53.1122 24.2194 53.0386 23.8939 52.9978 23.5343H59.106C59.9667 23.5343 60.0866 22.8152 60.0866 22.408C60.0444 21.5377 59.8619 20.7819 59.5377 20.1404C59.1659 19.405 58.6239 18.8452 57.9116 18.4598C57.2007 18.0744 56.3386 17.8823 55.328 17.8823C54.3175 17.8823 53.4404 18.0893 52.6954 18.502C51.9504 18.916 51.3757 19.4976 50.9699 20.2466C50.564 20.9957 50.3611 21.8891 50.3611 22.9255C50.3611 23.962 50.564 24.835 50.9699 25.584C51.3757 26.3331 51.9504 26.9187 52.6954 27.3395C53.4404 27.7604 54.3107 27.9701 55.3076 27.9701C56.3045 27.9701 57.469 27.8094 58.4114 27.3395C58.9902 27.0508 59.6576 26.5809 59.6576 25.8687C59.6576 25.2286 59.1659 24.711 58.5585 24.711L58.5612 24.7083ZM53.834 20.5313C54.2671 20.1458 54.8023 19.9538 55.437 19.9538C56.1084 19.9538 56.6763 20.1527 57.1408 20.549C57.6052 20.9467 57.8435 21.4737 57.8558 22.1343H53.0359C53.134 21.4506 53.3995 20.9153 53.8326 20.5313H53.834Z",fill:"currentColor"}),e.jsx("path",{d:"M89.8488 19.131C89.8488 18.4405 89.289 17.8794 88.5972 17.8794C87.9053 17.8794 87.3456 18.4392 87.3456 19.131C87.3456 19.1406 87.3456 19.1501 87.3469 19.1596C87.3469 19.1664 87.3456 19.1732 87.3456 19.1801V23.94C87.3456 24.2437 87.2679 24.5297 87.1127 24.7994C86.9574 25.069 86.7545 25.2897 86.5012 25.4613C86.2492 25.6329 85.9605 25.7187 85.6377 25.7187C85.3149 25.7187 85.0425 25.6301 84.7838 25.4517C84.525 25.2733 84.318 25.054 84.1627 24.7898C84.0075 24.527 83.9299 24.2437 83.9299 23.94V19.1991C83.9299 19.1896 83.9285 19.1814 83.9271 19.1719C83.9271 19.1583 83.9299 19.1433 83.9299 19.1297C83.9299 18.4392 83.3701 17.8781 82.6782 17.8781C81.9864 17.8781 81.4266 18.4378 81.4266 19.1297C81.4266 19.1446 81.428 19.1583 81.4294 19.1719C81.4294 19.1814 81.4266 19.1896 81.4266 19.1991V23.94C81.4266 24.6386 81.6173 25.2924 81.9986 25.9052C82.38 26.5181 82.8907 27.0111 83.5308 27.387C84.1709 27.7629 84.8791 27.9495 85.6541 27.9495C86.429 27.9495 87.0991 27.7656 87.7392 27.3965C88.3793 27.0275 88.89 26.5372 89.2713 25.9257C89.6527 25.3128 89.8433 24.6509 89.8433 23.94V19.1801C89.8433 19.1732 89.8433 19.1664 89.842 19.1596C89.842 19.1501 89.8433 19.1406 89.8433 19.131H89.8488Z",fill:"currentColor"}),e.jsx("path",{d:"M104.216 16.1036C104.646 16.1036 105.014 15.9619 105.316 15.68C105.618 15.3967 105.77 15.0481 105.77 14.63C105.77 14.2119 105.618 13.8469 105.316 13.5704C105.014 13.2953 104.646 13.1564 104.216 13.1564C103.785 13.1564 103.415 13.2939 103.106 13.5704C102.796 13.8469 102.641 14.1996 102.641 14.63C102.641 15.0603 102.795 15.3967 103.106 15.68C103.415 15.9633 103.785 16.1036 104.216 16.1036Z",fill:`url(#${d})`}),e.jsx("path",{d:"M104.195 17.889C103.433 17.889 102.814 18.5074 102.814 19.27V26.5877C102.814 27.3503 103.433 27.9686 104.195 27.9686C104.958 27.9686 105.576 27.3503 105.576 26.5877V19.27C105.576 18.5074 104.958 17.889 104.195 17.889Z",fill:"currentColor"}),e.jsx("path",{d:"M94.8974 13.3878C94.8974 12.636 94.2872 12.0259 93.5354 12.0259C92.7837 12.0259 92.1735 12.636 92.1735 13.3878V26.638C92.1735 27.3898 92.7837 27.9999 93.5354 27.9999C94.2872 27.9999 94.8974 27.3898 94.8974 26.638V13.3878Z",fill:`url(#${i})`}),e.jsx("path",{d:"M100.579 19.4322C101.211 18.7376 100.718 17.6235 99.7798 17.6235C99.3004 17.6235 98.8428 17.8265 98.52 18.1819L94.8973 22.1846V23.2006L96.0549 24.3964L99.4121 20.711L100.578 19.4308L100.579 19.4322Z",fill:`url(#${f})`}),e.jsx("path",{d:"M97.5995 22.7035L96.0551 24.3964L99.2066 27.65C99.4231 27.8734 99.72 27.9987 100.031 27.9987C101.044 27.9987 101.56 26.7798 100.853 26.0525L97.5995 22.7021",fill:`url(#${p})`}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:s,x1:"-29.2929",y1:"19.9985",x2:"72.7209",y2:"19.9985",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#00CFF4"}),e.jsx("stop",{offset:"0.41",stopColor:"#00BBF4"}),e.jsx("stop",{offset:"1",stopColor:"#0098F5"})]}),e.jsxs("linearGradient",{id:a,x1:"-10.5532",y1:"20.0003",x2:"74.701",y2:"20.0003",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#00CFF4"}),e.jsx("stop",{offset:"0.41",stopColor:"#00BBF4"}),e.jsx("stop",{offset:"1",stopColor:"#0098F5"})]}),e.jsxs("linearGradient",{id:l,x1:"-40.1598",y1:"20.0015",x2:"45.0961",y2:"20.0015",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#F5B059"}),e.jsx("stop",{offset:"0.14",stopColor:"#F4AA55"}),e.jsx("stop",{offset:"0.33",stopColor:"#F49949"}),e.jsx("stop",{offset:"0.53",stopColor:"#F37E37"}),e.jsx("stop",{offset:"0.75",stopColor:"#F35B1F"})]}),e.jsxs("linearGradient",{id:n,x1:"26.5774",y1:"7.02898",x2:"30.7527",y2:"7.02898",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#00CFF4"}),e.jsx("stop",{offset:"0.41",stopColor:"#00BBF4"}),e.jsx("stop",{offset:"1",stopColor:"#0098F5"})]}),e.jsxs("linearGradient",{id:d,x1:"102.641",y1:"14.63",x2:"105.77",y2:"14.63",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#46BFE2"}),e.jsx("stop",{offset:"0.44",stopColor:"#46ABD6"}),e.jsx("stop",{offset:"1",stopColor:"#478DC5"})]}),e.jsxs("linearGradient",{id:i,x1:"93.3325",y1:"8.53526",x2:"93.6281",y2:"25.2338",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#F4AC5A"}),e.jsx("stop",{offset:"0.15",stopColor:"#F3A656"}),e.jsx("stop",{offset:"0.34",stopColor:"#F0954C"}),e.jsx("stop",{offset:"0.55",stopColor:"#ED7A3B"}),e.jsx("stop",{offset:"0.75",stopColor:"#E95C28"})]}),e.jsxs("linearGradient",{id:f,x1:"90.6413",y1:"17.5459",x2:"101.478",y2:"22.6191",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#F4AC5A"}),e.jsx("stop",{offset:"0.15",stopColor:"#F3A656"}),e.jsx("stop",{offset:"0.34",stopColor:"#F0954C"}),e.jsx("stop",{offset:"0.55",stopColor:"#ED7A3B"}),e.jsx("stop",{offset:"0.75",stopColor:"#E95C28"})]}),e.jsxs("linearGradient",{id:p,x1:"96.0564",y1:"25.3525",x2:"101.18",y2:"25.3525",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#46BFE2"}),e.jsx("stop",{offset:"0.44",stopColor:"#46ABD6"}),e.jsx("stop",{offset:"1",stopColor:"#478DC5"})]})]})]})}function gl({height:r=40}){const t=c.useId().replace(/:/g,""),o=r/40,s=`${t}p0`,a=`${t}p1`,l=`${t}p2`,n=`${t}p3`,d=`${t}p4`;return e.jsxs("svg",{width:112*o,height:r,viewBox:"0 0 112 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--foreground, #0F225A)"},children:[e.jsx("path",{d:"M35.1416 9.6433C37.1055 7.19342 34.7117 4.04529 31.8235 5.27532C31.5568 5.38915 31.3122 5.57433 31.1287 5.79859C29.1358 8.25356 31.5568 11.4408 34.4552 10.17C34.7185 10.0544 34.9615 9.86756 35.1416 9.6433Z",fill:`url(#${s})`}),e.jsx("path",{d:"M22.5049 31.1553L23.8691 29.1454L23.8708 29.142L24.5147 28.1923C25.0023 28.2535 25.5647 28.3113 26.2018 28.3401C27.6832 28.4064 29.2887 28.3079 30.5867 27.6453C30.5901 27.6436 30.5918 27.6419 30.5952 27.6402C32.7461 26.6446 35.6632 24.2151 35.8551 18.347C35.8738 17.7812 35.4066 17.3038 34.8086 17.2783C34.8035 17.2783 34.8001 17.2783 34.795 17.2783C34.7814 17.2783 33.5004 17.2325 32.126 17.0303C30.2215 16.7517 29.5742 16.3915 29.3839 16.2505C29.3431 16.2199 29.3142 16.1791 29.2938 16.1316C27.6391 12.2376 24.5334 11.3779 22.4828 11.0891C22.3995 11.0772 22.3333 11.0347 22.2874 10.9668C21.4226 9.70956 19.7594 8.36569 16.5671 8.22298C16.144 8.20429 15.7516 8.23317 15.371 8.28074C15.3472 8.12274 15.264 7.97154 15.1196 7.8662C14.824 7.64704 14.3975 7.69461 14.1665 7.97324C14.017 8.15332 13.9966 8.38268 14.0747 8.58486C10.8824 9.73334 9.6252 13.2926 9.24463 14.7027C9.21575 14.8132 9.1359 14.8862 9.02547 14.91C7.75296 15.192 6.15936 15.7612 5.08053 16.1842C4.74414 16.3167 4.40265 16.4696 4.18859 16.7024C4.05097 16.8519 3.98471 17.0303 4.0034 17.2019C4.02039 17.3599 4.10534 17.4992 4.25145 17.6028C4.46381 17.7557 4.76113 17.8101 4.9735 17.8305C5.1247 17.8441 5.27421 17.8441 5.42372 17.8373C5.67856 17.8237 5.9283 17.7863 6.16955 17.7472C7.03771 17.6045 7.88378 17.4194 8.71456 17.2104L6.11688 21.4951C6.06422 21.5801 6.05742 21.6854 6.0965 21.7771L9.21575 29.0214C9.40094 29.4496 9.87154 29.7061 10.3557 29.6398L18.0061 28.6001C18.3204 28.5576 18.6058 28.4183 18.825 28.211C18.915 28.1261 18.9932 28.0309 19.056 27.9256L19.7169 26.7024C19.9989 26.2878 20.5137 25.4689 20.5902 24.9983C20.8739 23.2433 20.3846 21.8621 18.3187 19.1047C17.5219 18.0412 17.3095 16.9148 17.7207 15.9328C17.967 15.3449 18.3527 14.893 18.8182 14.628C19.4009 14.295 20.0091 14.1268 20.5868 14.047V14.0436C20.5868 14.0436 17.719 13.8516 16.319 14.5583C16.2562 14.5889 16.2069 14.6399 16.1712 14.701C15.1315 16.4628 15.4713 18.5101 16.7183 20.1733C18.808 22.963 18.8063 23.8295 18.6313 24.8216C18.6245 24.8641 18.6075 24.9049 18.5837 24.9406L17.9211 25.9582C17.792 26.1706 17.5881 26.3269 17.3469 26.4034C17.2874 26.4237 17.2263 26.439 17.1617 26.4458L11.263 27.2477C11.1254 27.2664 10.9911 27.1917 10.9368 27.0642L8.56336 21.5495C8.52428 21.4577 8.53108 21.3524 8.58375 21.2675L11.5535 16.366C11.6435 16.3252 11.7421 16.293 11.8253 16.2488C11.9476 16.1842 12.0581 16.1129 12.1651 16.0398L12.1923 16.0466C12.1923 16.0466 15.9962 13.1567 22.3656 13.1992C22.8005 13.2485 23.1709 13.3249 23.4138 13.3929C24.9853 13.838 26.3835 14.7758 27.2942 16.9708C27.6747 17.89 31.4005 18.8635 33.4511 19.2644C33.0553 19.1608 33.2897 19.735 33.4664 19.9457C33.4443 20.8104 33.2388 22.3514 32.2721 23.6952C32.2585 23.7122 32.2466 23.7292 32.2313 23.7462C31.6401 24.3918 30.8314 25.0119 29.812 25.5947C29.7933 25.6065 29.7729 25.615 29.7508 25.6235C28.8232 25.9905 27.6391 26.1859 26.1984 26.1757C26.302 26.1434 26.3988 26.0958 26.511 26.0941L23.6313 25.965C23.6262 25.9633 23.6211 25.9633 23.616 25.9633C23.5293 25.9463 23.4444 25.9514 23.3594 25.9531L22.617 25.9209C22.2211 25.9039 21.8457 26.0857 21.6316 26.4L17.2772 32.8152C17.228 32.8865 15.9673 34.9235 15.9741 35",fill:"currentColor"}),e.jsx("path",{d:"M22.5983 18.3231C22.7937 18.2059 23.0145 18.1142 23.2558 18.0564C23.497 17.9986 23.7383 17.98 23.9676 17.9935C24.2871 18.0139 24.5793 17.7132 24.3873 17.3785C24.0424 16.7737 23.4257 16.4254 22.848 16.5647C22.2704 16.704 21.9085 17.2868 21.9136 17.9732C21.9187 18.3537 22.3282 18.4845 22.5983 18.3231Z",fill:"currentColor"}),e.jsx("path",{d:"M4.0051 23.7819C4.0051 23.7819 3.44444 32.1152 14.0849 34.7944C14.0849 34.7944 6.80665 31.8994 4.0051 23.7819Z",fill:`url(#${a})`}),e.jsx("path",{d:"M44.1229 27.6258C43.9463 27.4492 43.858 27.232 43.858 26.9734V14.5C43.858 14.2423 43.9463 14.0206 44.1229 13.8377C44.2995 13.6548 44.5167 13.5629 44.7753 13.5629H49.4221C50.7124 13.5629 51.7657 13.78 52.5812 14.2152C53.3967 14.6505 53.9805 15.2073 54.3338 15.8867C54.687 16.5661 54.8636 17.3005 54.8636 18.088C54.8636 18.8756 54.687 19.6099 54.3338 20.2893C53.9805 20.9696 53.3958 21.5256 52.5812 21.9608C51.7657 22.396 50.7124 22.6132 49.4221 22.6132H45.7124V26.9752C45.7124 27.2329 45.6205 27.4501 45.4375 27.6276C45.2537 27.8033 45.033 27.8925 44.7753 27.8925C44.5167 27.8907 44.2995 27.8015 44.1229 27.6258ZM49.2391 20.8588C50.625 20.8588 51.5999 20.5939 52.164 20.0641C52.7281 19.5342 53.0092 18.8756 53.0092 18.0871C53.0092 17.2987 52.7272 16.64 52.164 16.1102C51.5999 15.5804 50.625 15.3154 49.2391 15.3154H45.7133V20.8588H49.2391Z",fill:"currentColor"}),e.jsx("path",{d:"M57.6461 27.6258C57.1361 27.3807 56.7324 27.0247 56.4332 26.5562C56.1341 26.0867 55.9845 25.547 55.9845 24.9352C55.9845 23.9296 56.3819 23.1285 57.1766 22.5302C57.9713 21.9328 59.1364 21.6337 60.6718 21.6337H63.1381V21.4706C63.1381 20.574 62.9173 19.9288 62.4758 19.5342C62.0343 19.1404 61.344 18.9431 60.4069 18.9431C59.8906 18.9431 59.432 18.9845 59.031 19.0656C58.63 19.1476 58.1858 19.2702 57.6956 19.4333C57.5866 19.4603 57.4983 19.4738 57.4307 19.4738C57.2271 19.4738 57.0505 19.3999 56.9009 19.2494C56.7513 19.0999 56.6765 18.9169 56.6765 18.6989C56.6765 18.3313 56.8531 18.0736 57.2063 17.9249C58.3615 17.4356 59.5365 17.1914 60.7322 17.1914C61.6702 17.1914 62.4614 17.3815 63.1065 17.7627C63.7517 18.1429 64.2274 18.6358 64.5329 19.2404C64.8384 19.845 64.9916 20.501 64.9916 21.2075V26.9761C64.9916 27.2338 64.8996 27.4509 64.7158 27.6285C64.5329 27.8042 64.3112 27.8934 64.0535 27.8934C63.7949 27.8934 63.5778 27.8051 63.4012 27.6285C63.2246 27.4518 63.1363 27.2347 63.1363 26.9761V26.4463C62.1307 27.4789 60.8539 27.9952 59.304 27.9952C58.7093 27.9925 58.1561 27.8708 57.6461 27.6258ZM61.7324 25.9236C62.2893 25.6317 62.7578 25.2686 63.139 24.8333V23.1213H60.9178C58.8661 23.1213 57.8398 23.6575 57.8398 24.7315C57.8398 25.2208 58.0056 25.6146 58.339 25.9137C58.6715 26.212 59.2256 26.3625 60.0005 26.3625C60.598 26.3625 61.1755 26.2165 61.7324 25.9236Z",fill:"currentColor"}),e.jsx("path",{d:"M68.4787 25.3029V18.9837H67.0316C66.9225 18.9837 66.8315 18.9459 66.7568 18.8711C66.682 18.7972 66.645 18.7053 66.645 18.5962C66.645 18.4602 66.7063 18.3448 66.8288 18.2493L69.6005 15.538C69.7231 15.4164 69.8384 15.3551 69.9474 15.3551C70.0565 15.3551 70.1475 15.3956 70.2223 15.4776C70.297 15.5587 70.334 15.6543 70.334 15.7624V17.3933H72.6371C72.8678 17.3933 73.0579 17.4681 73.2075 17.6177C73.3571 17.7673 73.4318 17.9574 73.4318 18.189C73.4318 18.4061 73.358 18.5935 73.2075 18.7494C73.0579 18.9062 72.8678 18.9846 72.6371 18.9846H70.334V25.1398C70.334 25.6696 70.4592 26.0057 70.7106 26.149C70.962 26.2913 71.2783 26.3634 71.6586 26.3634C71.9307 26.3634 72.2019 26.322 72.474 26.2409C72.5281 26.2274 72.5857 26.2139 72.647 26.1994C72.7083 26.1859 72.7867 26.1796 72.8813 26.1796C73.0714 26.1796 73.2417 26.2508 73.3913 26.3941C73.5409 26.5364 73.6157 26.7094 73.6157 26.914C73.6157 27.2267 73.4598 27.4645 73.1471 27.6276C72.6173 27.8727 72.0532 27.9944 71.4549 27.9944C69.4708 27.9926 68.4787 27.096 68.4787 25.3029Z",fill:`url(#${l})`}),e.jsx("path",{d:"M79.2374 27.9294C76.2828 27.45 74.2689 24.6558 74.7483 21.7003C75.2277 18.7457 78.0219 16.7318 80.9774 17.2112C83.932 17.6906 85.9459 20.4848 85.4665 23.4403C84.9862 26.3949 82.192 28.4087 79.2374 27.9294ZM80.6178 19.4197C78.8806 19.1377 77.2389 20.3217 76.9568 22.058C76.6748 23.7953 77.8588 25.437 79.5951 25.7191C81.3324 26.0011 82.9741 24.8171 83.2562 23.0807C83.5391 21.3444 82.3551 19.7017 80.6178 19.4197Z",fill:`url(#${n})`}),e.jsx("path",{d:"M80.7197 17.1752C77.9562 16.8581 75.3692 18.7233 74.7952 21.4454C74.1528 24.4928 76.1973 27.4357 79.2366 27.9295L79.5952 25.72C77.7841 25.4263 76.5739 23.6521 77.001 21.8346C77.3615 20.301 78.8221 19.2477 80.3917 19.391C81.9623 19.5342 83.1337 20.7759 83.2824 22.25C83.3328 22.7519 83.7176 23.1556 84.215 23.2367C84.9448 23.3547 85.5837 22.7465 85.5071 22.0104C85.2521 19.5504 83.3211 17.4735 80.7197 17.1752Z",fill:`url(#${d})`}),e.jsx("path",{d:"M96.5343 19.7684C96.0999 18.9466 95.4881 18.3114 94.6997 17.8626C93.9112 17.4139 93.0012 17.1904 91.9685 17.1904C91.8622 17.1904 91.7622 17.203 91.6586 17.2076C91.4045 17.2193 91.1585 17.2445 90.9197 17.2832C90.2998 17.3851 89.7285 17.5716 89.2167 17.8626C88.4283 18.3114 87.8209 18.9466 87.392 19.7684C86.964 20.5911 86.7496 21.5318 86.7496 22.5914C86.7496 22.6176 86.7532 22.6419 86.7532 22.6689C86.7532 22.6914 86.7496 22.7113 86.7496 22.7338V24.2629V24.9955V27.0553C86.7496 27.313 86.8415 27.5347 87.0253 27.7176C87.2091 27.9005 87.429 27.9924 87.6876 27.9924C87.9462 27.9924 88.1633 27.9005 88.34 27.7176C88.5166 27.5338 88.6049 27.313 88.6049 27.0553V26.9003V25.4469V24.2629V22.6725C88.6049 22.6563 88.6076 22.6419 88.6076 22.6266C88.6148 21.8318 88.7986 21.1533 89.1653 20.5947C89.5393 20.0243 90.0313 19.5963 90.6431 19.3106C91.0756 19.1088 91.5324 18.9926 92.0055 18.9349C92.065 18.943 92.1244 18.9529 92.183 18.9637C92.566 19.0331 92.9363 19.1448 93.2922 19.3115C93.904 19.5972 94.396 20.0252 94.77 20.5956C95.1376 21.156 95.3223 21.8363 95.3286 22.6329C95.3286 22.6473 95.3313 22.6599 95.3313 22.6743V24.2647V24.7441V26.885V27.0571C95.3313 27.3148 95.4232 27.5365 95.6062 27.7194C95.79 27.9023 96.0107 27.9942 96.2684 27.9942C96.527 27.9942 96.7442 27.9023 96.9208 27.7194C97.0974 27.5356 97.1866 27.3148 97.1866 27.0571V25.7199V24.2647V22.7356C97.1866 22.7131 97.183 22.6923 97.183 22.6698C97.183 22.6437 97.1866 22.6194 97.1866 22.5932C97.1866 21.5318 96.9686 20.5911 96.5343 19.7684Z",fill:"currentColor"}),e.jsx("path",{d:"M106.934 19.2386C106.629 18.634 106.153 18.1411 105.508 17.7609C104.862 17.3806 104.071 17.1896 103.134 17.1896C101.938 17.1896 100.762 17.4347 99.6079 17.923C99.2547 18.0726 99.0781 18.3303 99.0781 18.6971C99.0781 18.9142 99.152 19.098 99.3024 19.2476C99.452 19.3972 99.6286 19.472 99.8323 19.472C99.9007 19.472 99.9881 19.4585 100.098 19.4314C100.587 19.2683 101.032 19.1458 101.433 19.0638C101.834 18.9827 102.292 18.9412 102.808 18.9412C103.746 18.9412 104.436 19.1386 104.877 19.5323C105.319 19.9261 105.54 20.5713 105.54 21.4687V21.6318H103.073C101.538 21.6318 100.373 21.931 99.5782 22.5284C98.7834 23.1267 98.386 23.9277 98.386 24.9333C98.386 25.5452 98.5356 26.0849 98.8348 26.5544C99.133 27.0229 99.5376 27.3797 100.048 27.6239C100.558 27.869 101.111 27.9907 101.709 27.9907C103.258 27.9907 104.535 27.4743 105.541 26.4417V26.9716C105.541 27.2293 105.629 27.4464 105.805 27.6239C105.982 27.7996 106.199 27.8888 106.458 27.8888C106.715 27.8888 106.936 27.8005 107.12 27.6239C107.304 27.4473 107.396 27.2302 107.396 26.9716V21.2029C107.393 20.4992 107.241 19.8432 106.934 19.2386ZM105.539 24.8333C105.158 25.2685 104.689 25.6317 104.132 25.9236C103.575 26.2156 102.998 26.3624 102.399 26.3624C101.625 26.3624 101.071 26.2129 100.739 25.9137C100.405 25.6145 100.24 25.2208 100.24 24.7315C100.24 23.6583 101.265 23.1213 103.318 23.1213H105.539V24.8333Z",fill:"currentColor"}),e.jsx("path",{d:"M90.9616 12.7149C90.9509 12.7432 90.9226 12.7645 90.8686 12.7689C90.7259 13.6273 90.4292 14.5317 90.0102 15.0606C89.9455 15.011 89.849 14.964 89.771 14.9322C90.1714 14.4458 90.4859 13.5378 90.6001 12.6405L90.9616 12.7149ZM92.7598 15.0385C92.5915 14.413 92.177 13.3979 91.8093 12.7361L92.0414 12.6254C92.417 13.265 92.8351 14.2731 93.0212 14.9348L92.7598 15.0385ZM92.7129 12C92.9343 12 93.1133 12.1789 93.1133 12.4039C93.1133 12.6219 92.9343 12.8043 92.7129 12.8043C92.4914 12.8043 92.3125 12.6219 92.3125 12.4039C92.3125 12.171 92.4985 12 92.7129 12ZM92.9955 12.4039C92.9955 12.2427 92.867 12.1178 92.7129 12.1178C92.5552 12.1178 92.4303 12.2427 92.4303 12.4039C92.4303 12.5581 92.5552 12.6865 92.7129 12.6865C92.8741 12.6856 92.9955 12.5501 92.9955 12.4039Z",fill:"currentColor"}),e.jsx("path",{d:"M93.4303 13.5264H96.4147V13.7806H93.5658C93.5446 13.816 93.4976 13.8417 93.4516 13.8488L93.4303 13.5264Z",fill:"currentColor"}),e.jsx("path",{d:"M98.988 14.0586C98.6231 13.862 98.1226 13.6299 97.7337 13.4758V15.2634H97.4653V12.1567L97.8267 12.178C97.8232 12.217 97.7948 12.2427 97.7337 12.2533V13.2968L97.7877 13.2215C98.2058 13.3757 98.7604 13.6219 99.1315 13.8186L98.988 14.0586Z",fill:"currentColor"}),e.jsx("path",{d:"M102.687 13.358H101.392C101.324 14.2766 101.092 14.8347 100.312 15.2811C100.262 15.2235 100.177 15.1562 100.109 15.1057C100.848 14.6947 101.066 14.2048 101.135 13.358H99.7012V13.1117H101.145C101.156 12.8326 101.159 12.5111 101.159 12.1497L101.509 12.1709C101.506 12.2064 101.474 12.2285 101.423 12.2356C101.42 12.5607 101.42 12.8504 101.406 13.1117H102.686V13.358H102.687Z",fill:"currentColor"}),e.jsx("path",{d:"M103.222 13.5264H106.206V13.7806H103.357C103.336 13.816 103.289 13.8417 103.243 13.8488L103.222 13.5264Z",fill:"currentColor"}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:s,x1:"4.13536",y1:"18.0045",x2:"35.6388",y2:"22.498",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#FF0000"}),e.jsx("stop",{offset:"0.1396",stopColor:"#FF0600"}),e.jsx("stop",{offset:"0.3301",stopColor:"#FF1800"}),e.jsx("stop",{offset:"0.55",stopColor:"#FF3400"}),e.jsx("stop",{offset:"0.79",stopColor:"#FF5C00"}),e.jsx("stop",{offset:"1",stopColor:"#FF8500"})]}),e.jsxs("linearGradient",{id:a,x1:"4.00081",y1:"29.2881",x2:"14.0858",y2:"29.2881",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#FF0000"}),e.jsx("stop",{offset:"0.1396",stopColor:"#FF0600"}),e.jsx("stop",{offset:"0.3301",stopColor:"#FF1800"}),e.jsx("stop",{offset:"0.55",stopColor:"#FF3400"}),e.jsx("stop",{offset:"0.79",stopColor:"#FF5C00"}),e.jsx("stop",{offset:"1",stopColor:"#FF8500"})]}),e.jsxs("linearGradient",{id:l,x1:"66.6447",y1:"21.6743",x2:"73.6151",y2:"21.6743",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#FF0000"}),e.jsx("stop",{offset:"1",stopColor:"#FF8500"})]}),e.jsxs("linearGradient",{id:n,x1:"81.2086",y1:"17.2537",x2:"79.0052",y2:"27.8862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#FF0000"}),e.jsx("stop",{offset:"0.2479",stopColor:"#FF1D00"}),e.jsx("stop",{offset:"0.7821",stopColor:"#FF6500"}),e.jsx("stop",{offset:"1",stopColor:"#FF8500"})]}),e.jsxs("linearGradient",{id:d,x1:"83.4637",y1:"18.1954",x2:"75.8553",y2:"25.5201",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{offset:"0.3441",stopColor:"#FF0000"}),e.jsx("stop",{offset:"0.3559",stopColor:"#FF0300"}),e.jsx("stop",{offset:"0.5741",stopColor:"#FF3B00"}),e.jsx("stop",{offset:"0.7618",stopColor:"#FF6300"}),e.jsx("stop",{offset:"0.9099",stopColor:"#FF7C00"}),e.jsx("stop",{offset:"1",stopColor:"#FF8500"})]})]})]})}const vl={product:"sellsuki",brand:{name:"Sellsuki",logoFull:c.createElement(bl,{height:40}),theme:"sellsuki"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},xl={product:"patona",brand:{name:"Patona",logoFull:c.createElement(gl,{height:40}),theme:"patona"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},ml={product:"sukispace",brand:{name:"Sukispace",theme:"sukispace"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},yl={product:"shipmunk",brand:{name:"Shipmunk",theme:"shipmunk"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},wl={product:"akita",brand:{name:"Akita",theme:"akita"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},Nl={product:"oc2plus",brand:{name:"Oc2plus",theme:"oc2plus"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}},Cl={product:"sellsukipay",brand:{name:"SellsukiPay",theme:"sellsukipay"},shell:{sidebarCollapsible:!0,sidebarDefaultOpen:!0}};L.Accordion=Ur,L.AccordionItem=Re,L.AdvancedDataTable=Wa,L.Alert=Qe,L.AppShell=lo,L.AppShellErrorBoundary=eo,L.AppShellProvider=Sr,L.AppShellSkeleton=no,L.AreaChart=At,L.Avatar=Yr,L.AvatarGroup=Gr,L.Badge=mo,L.BarChart=jt,L.Breadcrumb=Ko,L.Button=Ke,L.ButtonGroup=po,L.Card=Xr,L.CardBody=qr,L.CardFooter=Jr,L.CardHeader=Kr,L.Checkbox=Fe,L.CheckboxGroup=wo,L.ChoiceCard=Yt,L.ChoiceCardGroup=Gt,L.ColorPicker=rs,L.ConfirmDialog=Wo,L.DSButton=Ke,L.DSCheckbox=Fe,L.DSInput=qe,L.DSRadio=Br,L.DSTable=Or,L.DSTextarea=Je,L.DatePicker=Lo,L.DateRangePicker=_t,L.DateTimePicker=Zt,L.Divider=Vr,L.DonutChart=Et,L.Drawer=Rr,L.Dropdown=et,L.EmptyState=is,L.FeaturePageScaffold=oo,L.FileUpload=hs,L.FilterBar=$a,L.FormError=zt,L.FormField=da,L.FormHelperText=Lt,L.FormLabel=fr,L.FormSuccess=Ft,L.IconButton=Lr,L.ImageGallery=Qt,L.ImagePreview=bs,L.Input=qe,L.LineChart=Dt,L.Menu=lt,L.MiniSparkline=Tt,L.Modal=Pr,L.Notification=it,L.NotificationCenter=ws,L.NumberInput=pa,L.OTPInput=xa,L.PageHeader=Na,L.Pagination=Eo,L.Popover=Cs,L.ProgressBar=dt,L.Radio=Br,L.RadioCard=Xt,L.RadioGroup=Co,L.Rating=Fs,L.RepeatableFieldList=qt,L.RichTextEditor=Jt,L.ScaffoldKPIRow=ao,L.ScaffoldSection=so,L.SearchField=Io,L.Sidebar=Pe,L.SidebarAccountSwitcher=or,L.Skeleton=ae,L.SkeletonCard=Ts,L.SkeletonList=sr,L.SkeletonTable=Bs,L.Spinner=ht,L.StatCard=Ps,L.Statistic=_s,L.Stepper=mt,L.Switch=Ks,L.Table=Or,L.Tabs=_o,L.Tag=yt,L.TagInput=wt,L.Textarea=Je,L.ThumbnailCell=wr,L.TimePicker=mr,L.Timeline=ta,L.ToastContainer=Er,L.Tooltip=rr,L.TopNavbar=nr,L.TransferList=aa,L.Tree=la,L.akitaBrandConfig=wl,L.oc2plusBrandConfig=Nl,L.patonaBrandConfig=xl,L.sellsukiBrandConfig=vl,L.sellsukiPayBrandConfig=Cl,L.shipmunkBrandConfig=yl,L.sukispaceBrandConfig=ml,L.toast=ye,L.useAppShell=Vt,L.useAppShellFull=Rt,L.useBreadcrumbs=ol,L.useFormField=ia,L.useNavResolver=sl,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}));
|
|
95
95
|
//# sourceMappingURL=sellsuki-ds.umd.cjs.map
|