@zhama/tego-ui 0.0.0-stage → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +172 -0
- package/assets/styles/tokens.css +1 -0
- package/dist/animations-FAPO43TO.css +1 -0
- package/dist/chunk-4MXE2PSC.js +1 -0
- package/dist/chunk-6HRT65AA.cjs +1 -0
- package/dist/chunk-6Z2BWV6F.js +1 -0
- package/dist/chunk-CRTE56HI.js +1 -0
- package/dist/chunk-ERURJLNK.cjs +1 -0
- package/dist/chunk-GZXKQ2K6.cjs +1 -0
- package/dist/chunk-H7AHFBEU.js +1 -0
- package/dist/chunk-M2GCF4FZ.cjs +1 -0
- package/dist/chunk-MTA2XHQG.cjs +1 -0
- package/dist/chunk-MVPRTW7Z.js +1 -0
- package/dist/chunk-NA5M3B4G.js +1 -0
- package/dist/chunk-ON32SVTM.cjs +1 -0
- package/dist/chunk-OS64HXLJ.js +1 -0
- package/dist/chunk-QPXIAUJD.js +1 -0
- package/dist/chunk-RWEJPTVG.cjs +1 -0
- package/dist/chunk-SHFR7LZH.js +1 -0
- package/dist/chunk-SLTTRXOU.cjs +1 -0
- package/dist/chunk-ULCTAAJ2.js +1 -0
- package/dist/chunk-UQZZ6WIZ.cjs +1 -0
- package/dist/chunk-YWPIPAUQ.cjs +1 -0
- package/dist/command-palette.cjs +1 -0
- package/dist/command-palette.d.cts +44 -0
- package/dist/command-palette.d.ts +44 -0
- package/dist/command-palette.js +1 -0
- package/dist/config-form/index.cjs +1 -0
- package/dist/config-form/index.d.cts +99 -0
- package/dist/config-form/index.d.ts +99 -0
- package/dist/config-form/index.js +1 -0
- package/dist/design-system/index.cjs +1 -0
- package/dist/design-system/index.d.cts +629 -0
- package/dist/design-system/index.d.ts +629 -0
- package/dist/design-system/index.js +1 -0
- package/dist/editors.cjs +1 -0
- package/dist/editors.d.cts +68 -0
- package/dist/editors.d.ts +68 -0
- package/dist/editors.js +1 -0
- package/dist/highlight-IORKDKTB.css +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3157 -0
- package/dist/index.d.ts +3157 -0
- package/dist/index.js +2 -0
- package/dist/styles-447PVICJ.css +1 -0
- package/dist/styles-FZ7XXKJP.css +1 -0
- package/dist/summary-charts.cjs +1 -0
- package/dist/summary-charts.d.cts +45 -0
- package/dist/summary-charts.d.ts +45 -0
- package/dist/summary-charts.js +1 -0
- package/dist/tag-input.cjs +1 -0
- package/dist/tag-input.d.cts +15 -0
- package/dist/tag-input.d.ts +15 -0
- package/dist/tag-input.js +1 -0
- package/package.json +122 -4
- package/tailwind-preset.cjs +1 -0
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var ps=Object.defineProperty;var s=(e,r)=>ps(e,"name",{value:r,configurable:!0});export{animations,breakpoints,buildBadgeClass,buildButtonClass,buildCardClass,buildFocusableClass,buildGridClass,buildInputClass,buildSkeletonClass,buildTableClass,chatBubbles,colors,combineTokens,designTokens,focusRing,getAnimation,getContainerClass,getIconSize,getSpacing,getStateStyle,getStatusBadgeVariant,getStatusColor,getTruncateClass,getTypography,iconSizes,interactions,layout,presets,radius,shadows,spacing,states,surfaces,transitions,truncate,typography}from"./chunk-6Z2BWV6F.js";export{Alert,AlertDescription,AlertTitle}from"./chunk-SHFR7LZH.js";import{Label as Te,Input as Fe,Select as Cr,SelectTrigger as kr,SelectValue as Dr,SelectContent as Rr,SelectItem as Sr,Badge as Et}from"./chunk-MVPRTW7Z.js";export{Badge,Input,Label,Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectTrigger,SelectValue,Switch,Textarea}from"./chunk-MVPRTW7Z.js";import{Button as K,buttonVariants as Tr}from"./chunk-OS64HXLJ.js";export{Button}from"./chunk-OS64HXLJ.js";export{SummaryBarChart,SummaryDistributionChart,SummaryLineChart,SummaryPieChart,SummaryTrendChart}from"./chunk-H7AHFBEU.js";import{Tooltip as be,TooltipTrigger as xe,TooltipContent as ye,TooltipProvider as Xe}from"./chunk-CRTE56HI.js";export{Tooltip,TooltipContent,TooltipProvider,TooltipTrigger}from"./chunk-CRTE56HI.js";export{TagPickerInput as TagInput}from"./chunk-4MXE2PSC.js";export{Kbd}from"./chunk-NA5M3B4G.js";import{cn as m}from"./chunk-ULCTAAJ2.js";export{cn}from"./chunk-ULCTAAJ2.js";import{__publicField as q}from"./chunk-QPXIAUJD.js";import"./styles-FZ7XXKJP.css";import"./animations-FAPO43TO.css";import"./highlight-IORKDKTB.css";import*as g from"react";import Q,{useMemo as Y,useState as j,useEffect as X,useCallback as V,useImperativeHandle as gs,createContext as vs,memo as we,useRef as Z,useId as bs,useContext as xs,Fragment as ys,useLayoutEffect as ws,Suspense as Ns}from"react";import{jsx as a,jsxs as u,Fragment as J}from"react/jsx-runtime";import Es from"embla-carousel-react";import{ArrowLeft as Cs,ArrowRight as Ct,Minus as ks,Check as le,ChevronRight as ce,Circle as Ds,Search as Ne,X as oe,ArrowUp as Rs,ArrowDown as Ss,ChevronsUpDown as Fr,Copy as Ts,AlertTriangle as Ar,RefreshCw as kt,Home as Dt,ChevronDown as Qe,Loader2 as Rt,CornerDownRight as Fs,ChevronLeft as Ir,ArrowUpRight as As,ArrowDownRight as Is,UserRound as Ms,CalendarDays as Bs,CircleHelp as Ps,Upload as Ls,File as St,CheckCircle as Os,AlertCircle as _s,Info as $s,FileArchive as Ee,FileVideo as ue,FileAudio as de,FileImage as ie,Code as Tt,FileCode as H,FileText as Ft,FileType as At,Presentation as Ze,FileSpreadsheet as Ae,Archive as zs,Image as Us,VolumeX as js,Volume2 as Ks,Download as Ie,Pause as It,Play as Mt,Mic as Vs,ImageOff as Ws,CalendarRange as Gs,Loader as Hs}from"lucide-react";import*as Mr from"@radix-ui/react-checkbox";import*as Br from"@radix-ui/react-collapsible";import*as Ce from"@radix-ui/react-popover";import*as W from"@radix-ui/react-dropdown-menu";import{cva as Je}from"class-variance-authority";import*as ke from"@radix-ui/react-avatar";import*as Me from"@radix-ui/react-slider";import*as me from"@radix-ui/react-tabs";import*as er from"@radix-ui/react-toggle-group";import{zhCN as rr,enUS as qs}from"react-day-picker/locale";import{DayPicker as Ys}from"react-day-picker";import*as G from"@radix-ui/react-context-menu";import*as ee from"@radix-ui/react-dialog";import{createPortal as Xs}from"react-dom";import*as Bt from"@radix-ui/react-separator";import*as fe from"@radix-ui/react-scroll-area";import*as Be from"@radix-ui/react-hover-card";import*as Pr from"@radix-ui/react-progress";import*as re from"@radix-ui/react-toast";import{marked as Qs}from"marked";import Pt from"react-markdown";import Zs from"remark-breaks";import tr from"dompurify";var Js={default:"border border-border/70 bg-card shadow-subtle",raised:"bg-[hsl(var(--surface-raised))] shadow-[var(--shadow-card)] rounded-[var(--radius-card)]",sunken:"bg-[hsl(var(--surface-sunken))] rounded-[var(--radius-card)]"},eo={default:"hover:border-border-strong hover:shadow-card-hover active:bg-accent/30",raised:"hover:-translate-y-0.5 hover:shadow-[var(--shadow-lift)] motion-reduce:transform-none",sunken:"hover:bg-[hsl(var(--surface-sunken))]/70"},Pe=g.forwardRef(({className:e,interactive:r,surface:t="default",...n},o)=>a("div",{ref:o,className:m("group relative rounded-lg text-card-foreground transition-all duration-150",Js[t],r&&m("cursor-pointer",eo[t]),e),...n}));Pe.displayName="Card";var Lr=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,className:m("flex flex-col space-y-1.5 p-4 pb-2",e),...r}));Lr.displayName="CardHeader";var Or=g.forwardRef(({className:e,...r},t)=>a("h3",{ref:t,className:m("text-sm font-medium leading-tight text-foreground",e),...r}));Or.displayName="CardTitle";var Lt=g.forwardRef(({className:e,...r},t)=>a("p",{ref:t,className:m("text-sm text-muted-foreground",e),...r}));Lt.displayName="CardDescription";var ar=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,className:m("px-4 pb-4 pt-0",e),...r}));ar.displayName="CardContent";var Ot=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,className:m("flex items-center px-4 pb-4 pt-0",e),...r}));Ot.displayName="CardFooter";var _t=g.createContext(null);function Le(){const e=g.useContext(_t);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}s(Le,"useCarousel");var $t=g.forwardRef(({orientation:e="horizontal",opts:r,setApi:t,plugins:n,className:o,children:i,...l},d)=>{const[h,f]=Es({...r,axis:e==="horizontal"?"x":"y"},n),[c,b]=g.useState(!1),[p,v]=g.useState(!1),x=g.useCallback(D=>{D&&(b(D.canScrollPrev()),v(D.canScrollNext()))},[]),w=g.useCallback(()=>f?.scrollPrev(),[f]),E=g.useCallback(()=>f?.scrollNext(),[f]),C=g.useCallback(D=>{D.key==="ArrowLeft"?(D.preventDefault(),w()):D.key==="ArrowRight"&&(D.preventDefault(),E())},[w,E]);return g.useEffect(()=>{!f||!t||t(f)},[f,t]),g.useEffect(()=>{if(f)return x(f),f.on("reInit",x),f.on("select",x),()=>{f.off("reInit",x),f.off("select",x)}},[f,x]),a(_t.Provider,{value:{carouselRef:h,api:f,opts:r,orientation:e||(r?.axis==="y"?"vertical":"horizontal"),scrollPrev:w,scrollNext:E,canScrollPrev:c,canScrollNext:p},children:a("div",{ref:d,onKeyDownCapture:C,className:m("relative",o),role:"region","aria-roledescription":"carousel",...l,children:i})})});$t.displayName="Carousel";var zt=g.forwardRef(({className:e,...r},t)=>{const{carouselRef:n,orientation:o}=Le();return a("div",{ref:n,className:"overflow-hidden",children:a("div",{ref:t,className:m("flex",o==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...r})})});zt.displayName="CarouselContent";var Ut=g.forwardRef(({className:e,...r},t)=>{const{orientation:n}=Le();return a("div",{ref:t,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...r})});Ut.displayName="CarouselItem";var jt=g.forwardRef(({className:e,...r},t)=>{const{orientation:n,scrollPrev:o,canScrollPrev:i}=Le();return a("button",{ref:t,type:"button",disabled:!i,onClick:o,"aria-label":"Previous slide",className:m("absolute z-10 flex h-8 w-8 items-center justify-center rounded-full","border border-border/60 bg-background/80 text-foreground shadow-sm backdrop-blur","transition-opacity hover:bg-background disabled:pointer-events-none disabled:opacity-0",n==="horizontal"?"left-2 top-1/2 -translate-y-1/2":"left-1/2 top-2 -translate-x-1/2 rotate-90",e),...r,children:a(Cs,{className:"h-4 w-4"})})});jt.displayName="CarouselPrevious";var Kt=g.forwardRef(({className:e,...r},t)=>{const{orientation:n,scrollNext:o,canScrollNext:i}=Le();return a("button",{ref:t,type:"button",disabled:!i,onClick:o,"aria-label":"Next slide",className:m("absolute z-10 flex h-8 w-8 items-center justify-center rounded-full","border border-border/60 bg-background/80 text-foreground shadow-sm backdrop-blur","transition-opacity hover:bg-background disabled:pointer-events-none disabled:opacity-0",n==="horizontal"?"right-2 top-1/2 -translate-y-1/2":"bottom-2 left-1/2 -translate-x-1/2 rotate-90",e),...r,children:a(Ct,{className:"h-4 w-4"})})});Kt.displayName="CarouselNext";var De=g.forwardRef(({className:e,...r},t)=>a(Mr.Root,{ref:t,className:m("peer h-3.5 w-3.5 shrink-0 rounded border border-primary ring-offset-background transition-colors duration-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:text-primary-foreground",e),...r,children:a(Mr.Indicator,{className:m("flex items-center justify-center text-current"),children:r.checked==="indeterminate"?a(ks,{className:"h-3 w-3"}):a(le,{className:"h-3 w-3"})})}));De.displayName=Mr.Root.displayName;var Vt=g.createContext(null);function ro({value:e,onValueChange:r,disabled:t=!1,className:n,children:o,...i}){const l=g.useId(),d=g.useMemo(()=>({name:l,value:e,disabled:t,onValueChange:r}),[l,e,t,r]);return a(Vt.Provider,{value:d,children:a("div",{role:"radiogroup","aria-disabled":t||void 0,className:m("grid gap-2",n),...i,children:o})})}s(ro,"RadioGroup");function to({value:e,disabled:r,className:t,children:n}){const o=g.useContext(Vt);if(!o)throw new Error("RadioGroupItem must be inside a RadioGroup");const i=o.disabled||r;return u("label",{className:m("flex cursor-pointer items-start gap-2 text-sm",i&&"cursor-not-allowed opacity-50",t),children:[a("input",{type:"radio",name:o.name,value:e,checked:o.value===e,disabled:i,onChange:s(()=>o.onValueChange(e),"onChange"),className:"mt-0.5 size-3.5 shrink-0 accent-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),a("span",{children:n})]})}s(to,"RadioGroupItem");function _r(e){const r=new Map,t=new Map,n=s((o,i)=>{i!==void 0&&r.set(o.id,i);const l=[];for(const d of o.children??[])l.push(d.id,...n(d,o.id));return t.set(o.id,l),l},"visit2");for(const o of e)n(o);return{parentById:r,descendantsById:t}}s(_r,"createIndexes");function Oe(e,r){const{parentById:t}=_r(e),n=new Set(r);return[...n].filter(o=>{const i=new Set;let l=t.get(o);for(;l!==void 0&&!i.has(l);){if(n.has(l))return!1;i.add(l),l=t.get(l)}return!0})}s(Oe,"normalizeCascadingSelection");function nr(e,r,t){const n=Oe(e,r),o=new Set(n),{parentById:i,descendantsById:l}=_r(e),d=o.has(t);let h=!1;const f=new Set;let c=i.get(t);for(;c!==void 0&&!f.has(c);){if(o.has(c)){h=!0;break}f.add(c),c=i.get(c)}const b=!d&&!h&&(l.get(t)??[]).some(p=>o.has(p));return{checked:d||h,explicit:d,inherited:h,indeterminate:b}}s(nr,"getCascadingSelectionState");function Wt(e,r,t){const n=Oe(e,r),o=nr(e,n,t);if(o.inherited)return n;if(o.explicit)return n.filter(d=>d!==t);const{descendantsById:i}=_r(e),l=new Set(i.get(t)??[]);return Oe(e,[...n.filter(d=>!l.has(d)),t])}s(Wt,"toggleCascadingSelection");function Gt(e,r){return r?e.flatMap(t=>{const n=Gt(t.children??[],r);return(typeof t.label=="string"?t.label:"").toLocaleLowerCase().includes(r)||n.length>0?[{...t,defaultExpanded:!0,children:n}]:[]}):e}s(Gt,"filterTree");function ao({nodes:e,value:r,onValueChange:t,searchable:n=!1,disabledKeys:o=[],placeholder:i="Search",emptyText:l="No options",inheritedText:d="Inherited",selectedText:h=s((b,p)=>`${b} explicit \xB7 ${p} covered`,"selectedText"),className:f,renderNode:c}){const[b,p]=j(""),[v,x]=j(new Set),w=Y(()=>Oe(e,r),[e,r]),E=Y(()=>new Set(o),[o]),C=Y(()=>Gt(e,b.trim().toLocaleLowerCase()),[e,b]),D=Y(()=>{let k=0;const S=s(A=>{for(const _ of A)nr(e,w,_.id).checked&&(k+=1),S(_.children??[])},"visit2");return S(e),k},[e,w]);X(()=>{if(!b.trim())return;const k=new Set,S=s(A=>{for(const _ of A)_.children?.length&&k.add(_.id),S(_.children??[])},"visit2");S(C),x(k)},[C,b]);const y=s((k,S=0)=>k.map(A=>{const _=!!A.children?.length,L=v.has(A.id)||A.defaultExpanded===!0,R=nr(e,w,A.id),I=A.disabled===!0||E.has(A.id)||R.inherited;return u("div",{children:[u("div",{className:m("flex min-h-9 items-center rounded-sm px-2 hover:bg-accent/50",R.checked&&"bg-primary/5"),style:{paddingLeft:`${S*20+8}px`},children:[_?a("button",{type:"button",className:"mr-1 flex h-5 w-5 items-center justify-center rounded hover:bg-muted",onClick:s(()=>x(z=>{const M=new Set(z);return M.has(A.id)?M.delete(A.id):M.add(A.id),M}),"onClick"),children:L?a(Qe,{className:"h-3.5 w-3.5"}):a(ce,{className:"h-3.5 w-3.5"})}):a("span",{className:"mr-1 h-5 w-5"}),a(De,{checked:R.indeterminate?"indeterminate":R.checked,disabled:I,onCheckedChange:s(()=>t(Wt(e,w,A.id)),"onCheckedChange")}),a("div",{className:"ml-2 min-w-0 flex-1 text-sm",children:c?c(A):A.label}),R.inherited&&a("span",{className:"ml-2 text-[10px] text-muted-foreground",children:d})]}),_&&L&&y(A.children??[],S+1)]},A.id)}),"renderItems");return u("div",{className:m("space-y-2",f),children:[n&&u("div",{className:"relative",children:[a(Ne,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),a(Fe,{value:b,onChange:s(k=>p(k.target.value),"onChange"),placeholder:i,className:"h-8 pl-8 text-xs"})]}),a("div",{className:"max-h-64 overflow-y-auto rounded-md border bg-background p-1",children:C.length?y(C):a("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:l})}),a("p",{className:"text-xs text-muted-foreground",children:h(w.length,D)})]})}s(ao,"CascadingTreeSelect");var no={50:"identity-surface [--identity-hue:50]",150:"identity-surface [--identity-hue:150]",190:"identity-surface [--identity-hue:190]",226:"identity-surface [--identity-hue:226]",262:"identity-surface [--identity-hue:262]",298:"identity-surface [--identity-hue:298]",336:"identity-surface [--identity-hue:336]"};function he(e){return m(no[e],"bg-[var(--identity-soft)] text-[var(--identity-text)] ring-[color:var(--identity-soft)]")}s(he,"tagTone");function Ht(e){const r=e.trim().toLowerCase(),t=["\u95EE\u7B54","\u54A8\u8BE2","\u5BA2\u670D","support","qa","answer","assistant"],n=["\u5206\u6790","\u6D1E\u5BDF","\u62A5\u8868","\u6570\u636E","\u8BCA\u65AD","analysis","insight","report","data"],o=["\u68C0\u7D22","\u641C\u7D22","\u67E5\u8BE2","\u8D44\u6599","knowledge","search","retrieve","query","rag"],i=["\u6D41\u7A0B","\u6267\u884C","\u81EA\u52A8","\u534F\u4F5C","\u8C03\u5EA6","workflow","execute","automation","task","agent"],l=["\u5199\u4F5C","\u5185\u5BB9","\u6C9F\u901A","\u8425\u9500","\u8FD0\u8425","\u6587\u6848","writing","content","marketing","communication"],d=["\u8BBE\u5907","\u8FD0\u7EF4","\u76D1\u63A7","\u63A7\u5236","\u90E8\u7F72","\u5B89\u5168","\u4EE3\u7801","device","ops","monitor","control","deploy","security","code"],h=["\u77E5\u8BC6","\u7814\u7A76","research","\u89C4\u5212","\u7B56\u7565","plan","strategy"];return t.some(f=>r.includes(f))?he(150):n.some(f=>r.includes(f))?he(50):o.some(f=>r.includes(f))?he(190):i.some(f=>r.includes(f))?"bg-primary/[0.08] text-primary ring-primary/12":l.some(f=>r.includes(f))?he(262):d.some(f=>r.includes(f))?he(336):h.some(f=>r.includes(f))?he(298):he(226)}s(Ht,"getCapabilityTagTone");function so({label:e,size:r="sm",tone:t="auto",className:n,...o}){return a("span",{className:m("inline-flex max-w-full items-center truncate rounded-full font-medium ring-1",r==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]",t==="neutral"?"text-foreground/44 bg-foreground/[0.035] ring-border/35":Ht(e),n),...o,children:e})}s(so,"CapabilityTag");var oo=Br.Root,io=Br.Trigger,lo=Br.Content,Re=Ce.Root,Se=Ce.Trigger,co=Ce.Anchor,pe=g.forwardRef(({className:e,align:r="center",sideOffset:t=4,portalContainer:n,...o},i)=>a(Ce.Portal,{container:n,children:a(Ce.Content,{ref:i,align:r,sideOffset:t,className:m("z-50 w-64 rounded-md border bg-popover p-3 text-popover-foreground shadow-elevation-2 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));pe.displayName=Ce.Content.displayName;var uo=250;function mo({options:e,value:r,onChange:t,onSearch:n,searching:o=!1,selectedLabel:i,placeholder:l,searchPlaceholder:d,emptyText:h,clearLabel:f,allowClear:c=!0,disabled:b,defaultOpen:p=!1,onOpenChange:v,className:x,align:w="start",...E}){const[C,D]=g.useState(p),[y,k]=g.useState("");g.useEffect(()=>{if(!n)return;const R=window.setTimeout(()=>n(y.trim()),uo);return()=>window.clearTimeout(R)},[n,y]);const S=g.useMemo(()=>{if(n)return e;const R=y.trim().toLowerCase();return R?e.filter(I=>`${I.label} ${I.description??""}`.toLowerCase().includes(R)):e},[n,e,y]),_=e.find(R=>R.value===r)?.label??i??r,L=s(R=>{D(R),R||k(""),v?.(R)},"change");return u(Re,{open:C,onOpenChange:L,children:[a(Se,{asChild:!0,children:u(K,{type:"button",variant:"outline",role:"combobox","aria-expanded":C,disabled:b,className:m("h-9 w-full justify-between gap-2 px-3 font-normal",x),...E,children:[a("span",{className:m("min-w-0 flex-1 truncate text-left",!_&&"text-muted-foreground"),children:_||l}),a(Fr,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}),u(pe,{align:w,className:m("w-[var(--radix-popover-trigger-width)] p-0",e.some(R=>R.depth!==void 0)&&"min-w-72 max-w-[calc(100vw-2rem)]"),children:[u("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a(Ne,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a("input",{type:"text",autoFocus:!0,value:y,placeholder:d,"aria-label":d,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60",onChange:s(R=>k(R.target.value),"onChange")}),y&&a("button",{type:"button","aria-label":f,className:"rounded-sm text-muted-foreground transition-colors hover:text-foreground",onClick:s(()=>k(""),"onClick"),children:a(oe,{className:"h-3.5 w-3.5"})})]}),c&&r!==null&&u("button",{type:"button",className:"flex w-full items-center justify-between border-b px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:s(()=>{t(null),L(!1)},"onClick"),children:[a("span",{children:f}),a(oe,{className:"h-4 w-4"})]}),a("div",{className:"max-h-72 overflow-y-auto py-1",children:o?a("div",{className:"flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:a(Rt,{className:"h-3.5 w-3.5 animate-spin"})}):S.length===0?a("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:h}):S.map(R=>{const I=R.value===r;return u("button",{type:"button",className:m("flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-muted",I&&"bg-muted/50"),style:R.depth===void 0?void 0:{paddingLeft:12+R.depth*16},onClick:s(()=>{t(R.value),L(!1)},"onClick"),children:[R.depth!==void 0&&R.depth>0&&a(Fs,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),u("span",{className:"min-w-0 flex-1",children:[a("span",{className:"block truncate",children:R.label}),R.description&&a("span",{className:"block truncate text-xs text-muted-foreground",children:R.description})]}),a(le,{className:m("h-4 w-4 shrink-0 text-primary",!I&&"text-transparent")})]},R.value)})})]})]})}s(mo,"Combobox");var qt=W.Root,Yt=W.Trigger,fo=W.Group,ho=W.Portal,po=W.Sub,go=W.RadioGroup,Xt=g.forwardRef(({className:e,inset:r,children:t,...n},o)=>u(W.SubTrigger,{ref:o,className:m("flex cursor-default select-none items-center gap-2 rounded-md px-3 py-2 text-sm outline-none transition-colors duration-150","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",e),...n,children:[t,a(ce,{className:"ml-auto h-4 w-4"})]}));Xt.displayName=W.SubTrigger.displayName;var Qt=g.forwardRef(({className:e,...r},t)=>a(W.SubContent,{ref:t,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-elevation-2","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Qt.displayName=W.SubContent.displayName;var $r=g.forwardRef(({className:e,sideOffset:r=4,...t},n)=>a(W.Portal,{children:a(W.Content,{ref:n,sideOffset:r,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-elevation-2","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));$r.displayName=W.Content.displayName;var zr=g.forwardRef(({className:e,inset:r,...t},n)=>a(W.Item,{ref:n,className:m("relative flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none transition-colors duration-100","hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-7",e),...t}));zr.displayName=W.Item.displayName;var Zt=g.forwardRef(({className:e,children:r,checked:t,...n},o)=>u(W.CheckboxItem,{ref:o,className:m("relative flex cursor-default select-none items-center rounded-md py-2 pl-8 pr-3 text-sm outline-none transition-colors duration-150","hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t??!1,...n,children:[a("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a(W.ItemIndicator,{children:a(le,{className:"h-4 w-4"})})}),r]}));Zt.displayName=W.CheckboxItem.displayName;var Jt=g.forwardRef(({className:e,children:r,...t},n)=>u(W.RadioItem,{ref:n,className:m("relative flex cursor-default select-none items-center rounded-md py-2 pl-8 pr-3 text-sm outline-none transition-colors duration-150","hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[a("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a(W.ItemIndicator,{children:a(Ds,{className:"h-2 w-2 fill-current"})})}),r]}));Jt.displayName=W.RadioItem.displayName;var ea=g.forwardRef(({className:e,inset:r,...t},n)=>a(W.Label,{ref:n,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",r&&"pl-7",e),...t}));ea.displayName=W.Label.displayName;var ra=g.forwardRef(({className:e,...r},t)=>a(W.Separator,{ref:t,className:m("-mx-1 my-1 h-px bg-muted",e),...r}));ra.displayName=W.Separator.displayName;var ta=s(({className:e,...r})=>a("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...r}),"DropdownMenuShortcut");ta.displayName="DropdownMenuShortcut";function vo({chips:e,value:r,onValueChange:t,className:n,"aria-label":o}){const i=g.useRef(null),l=g.useRef(new Map),[d,h]=g.useState({start:!1,end:!1}),f=g.useCallback(()=>{const v=i.current;if(!v)return;const x=v.scrollWidth-v.clientWidth;h({start:v.scrollLeft>1,end:x>1&&v.scrollLeft<x-1})},[]);g.useEffect(()=>{const v=i.current;if(!v)return;f();const x=new ResizeObserver(f);return x.observe(v),()=>x.disconnect()},[f,e]);const c=s(v=>{const x=i.current;x&&x.scrollBy({left:v*x.clientWidth*.8,behavior:"smooth"})},"scrollBy"),b=s(v=>{if(e.length===0)return;const x=e.findIndex(D=>D.value===r),E=e[((x===-1?0:x)+v+e.length)%e.length];if(!E)return;t(E.value);const C=l.current.get(E.value);C?.focus(),C?.scrollIntoView({block:"nearest",inline:"nearest"})},"move"),p=s(v=>{v.key==="ArrowRight"?(v.preventDefault(),b(1)):v.key==="ArrowLeft"&&(v.preventDefault(),b(-1))},"handleKeyDown");return u("div",{className:m("relative",n),children:[a("div",{ref:i,role:"radiogroup","aria-label":o,onScroll:f,onKeyDown:p,className:"flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map(v=>{const x=v.value===r;return u("button",{ref:s(w=>{w?l.current.set(v.value,w):l.current.delete(v.value)},"ref"),type:"button",role:"radio","aria-checked":x,tabIndex:x?0:-1,onClick:s(()=>t(v.value),"onClick"),className:m("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1 text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",x?"border-primary/30 bg-primary/10 text-primary":"border-border bg-background text-muted-foreground hover:border-foreground/20 hover:text-foreground"),children:[v.label,v.count!==void 0&&a("span",{className:"tabular-nums opacity-60",children:v.count})]},v.value)})}),d.start&&u(J,{children:[a("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 w-10 bg-gradient-to-r from-background to-transparent"}),a(aa,{side:"start",onClick:s(()=>c(-1),"onClick")})]}),d.end&&u(J,{children:[a("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 w-10 bg-gradient-to-l from-background to-transparent"}),a(aa,{side:"end",onClick:s(()=>c(1),"onClick")})]})]})}s(vo,"FilterChipRail");function aa({side:e,onClick:r}){return a("button",{type:"button","aria-hidden":!0,tabIndex:-1,onClick:r,className:m("absolute top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full","border border-border bg-background text-muted-foreground shadow-sm","transition-colors hover:text-foreground",e==="start"?"left-0":"right-0"),children:e==="start"?a(Ir,{className:"h-3.5 w-3.5"}):a(ce,{className:"h-3.5 w-3.5"})})}s(aa,"EdgeButton");var na=g.forwardRef(({value:e,onValueChange:r,trailing:t,hint:n,clearLabel:o="Clear",className:i,...l},d)=>u("div",{className:m("space-y-2.5",i),children:[u("div",{className:m("flex min-h-11 items-center gap-2.5 rounded-xl border border-border/70 bg-card px-3.5 py-1.5 text-foreground shadow-sm","transition-[border-color,box-shadow] duration-150 hover:border-foreground/20","focus-within:border-primary/40 focus-within:ring-2 focus-within:ring-primary/[0.08]"),children:[a(Ne,{"aria-hidden":!0,className:"h-[18px] w-[18px] shrink-0 text-muted-foreground"}),a("input",{ref:d,type:"search",value:e,onChange:s(h=>r(h.target.value),"onChange"),className:m("min-w-0 flex-1 bg-transparent text-[15px] leading-6 outline-none","placeholder:text-muted-foreground","[&::-webkit-search-cancel-button]:appearance-none"),...l}),e&&a("button",{type:"button",onClick:s(()=>r(""),"onClick"),"aria-label":o,className:"shrink-0 rounded-full p-1 text-muted-foreground transition-colors duration-hover hover:bg-foreground/10 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",children:a(oe,{className:"h-4 w-4"})}),t&&a("div",{className:"flex shrink-0 items-center gap-2 border-l border-border/70 pl-2",children:t})]}),n&&a("div",{className:"flex flex-wrap items-center gap-2 px-1 text-xs text-muted-foreground",children:n})]}));na.displayName="HeroSearch";var Ur=[226,262,298,336,14,50,150,190];function bo(e){let r=2166136261;for(let t=0;t<e.length;t+=1)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}s(bo,"fnv1a");function sa(e){return Ur[bo(e)%Ur.length]}s(sa,"identityHue");function oa(e){return{"--identity-hue":String(sa(e))}}s(oa,"identityStyle");var xo=/[\p{L}\p{N}]/u;function yo(e){const r=[...e.trim()];return(r.find(n=>xo.test(n))??r[0]??"?").toUpperCase()}s(yo,"identityInitial");var wo={sm:{box:"h-9 w-9",text:"text-xs",ring:2},md:{box:"h-12 w-12",text:"text-sm",ring:2},lg:{box:"h-16 w-16",text:"text-lg",ring:3},xl:{box:"h-20 w-20",text:"text-2xl",ring:3}},ia=g.forwardRef(({seed:e,name:r,src:t,size:n="md",ring:o=!0,className:i,style:l,...d},h)=>{const[f,c]=g.useState(!1),b=wo[n],p=!!t&&!f;return u("div",{ref:h,role:"img","aria-label":r,className:m("identity-surface relative shrink-0 overflow-hidden rounded-full",b.box,i),style:{...oa(e),...l},...d,children:[p?a("img",{src:t??void 0,alt:"",className:"h-full w-full object-cover",onError:s(()=>c(!0),"onError")}):a("span",{"aria-hidden":!0,className:m("flex h-full w-full items-center justify-center font-semibold",b.text),style:{backgroundColor:"var(--identity-soft)",color:"var(--identity-text)"},children:yo(r)}),o&&a("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{boxShadow:`inset 0 0 0 ${b.ring}px var(--identity-band)`}})]})});ia.displayName="IdentityAvatar";function la(e){const r=/^\s*(-?[\d.]+)(?:deg)?\s+([\d.]+)%\s+([\d.]+)%\s*(?:\/.*)?$/.exec(e);return r?[Number(r[1]),Number(r[2]),Number(r[3])]:null}s(la,"parseHslTriplet");function ca(e,r,t){const n=r/100,o=t/100,i=s(h=>(h+e/30)%12,"k"),l=n*Math.min(o,1-o),d=s(h=>o-l*Math.max(-1,Math.min(i(h)-3,Math.min(9-i(h),1))),"f");return[Math.round(d(0)*255),Math.round(d(8)*255),Math.round(d(4)*255)]}s(ca,"hslToRgb");function jr(e){const r=la(e);return r?ca(...r):null}s(jr,"hslTripletToRgb");function Kr([e,r,t]){const n=s(o=>{const i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4},"channel");return .2126*n(e)+.7152*n(r)+.0722*n(t)}s(Kr,"relativeLuminance");function No(e,r){const[t,n]=[Kr(e),Kr(r)].sort((o,i)=>i-o);return(t+.05)/(n+.05)}s(No,"contrastRatio");function Eo(e,r){const t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t?r===void 0?`hsl(${t})`:`hsl(${t} / ${r})`:""}s(Eo,"tokenColor");var da=["chart-1","chart-2","chart-3","chart-4","chart-5","chart-6","chart-7","chart-8"];function ua(e,r){const t=s((d,h=1)=>{const f=jr(e(d));return f?`rgba(${f.join(", ")}, ${h})`:void 0},"color"),n=t("muted-foreground"),o={lineStyle:{color:t("border-strong")}},i={lineStyle:{color:t("border")}},l={axisLine:o,axisTick:o,axisLabel:{color:n},splitLine:i,nameTextStyle:{color:n}};return{color:da.map(d=>t(d)).filter(Boolean),backgroundColor:"transparent",textStyle:{color:t("foreground"),fontFamily:r},title:{textStyle:{color:t("foreground")},subtextStyle:{color:n}},legend:{textStyle:{color:n}},tooltip:{backgroundColor:t("popover"),borderColor:t("border"),textStyle:{color:t("popover-foreground")},axisPointer:{lineStyle:{color:t("border-strong")},shadowStyle:{color:t("foreground",.06)}}},categoryAxis:l,valueAxis:l,logAxis:l,timeAxis:l,radar:{axisName:{color:n},axisLine:i,splitLine:i,splitArea:{show:!1}}}}s(ua,"buildChartTheme");function ma(){const e=getComputedStyle(document.documentElement);return r=>e.getPropertyValue(`--${r}`)}s(ma,"documentTokenReader");function Co(e,r){const t=s(o=>{const i=jr(e(o));return i?`#${i.map(l=>l.toString(16).padStart(2,"0")).join("")}`:""},"hex"),n=[["background",t("card")],["mainBkg",t("surface-sunken")],["primaryColor",t("surface-sunken")],["primaryTextColor",t("foreground")],["primaryBorderColor",t("border-strong")],["secondaryColor",t("primary-soft")],["tertiaryColor",t("surface-inset")],["lineColor",t("muted-foreground")],["textColor",t("foreground")],["noteBkgColor",t("warning-soft")],["noteTextColor",t("foreground")],["noteBorderColor",t("border-strong")]];return{darkMode:r,...Object.fromEntries(n.filter(([,o])=>o))}}s(Co,"buildMermaidThemeVariables");var fa=s(()=>String(document.documentElement.classList.contains("dark")),"themeKey");function ha(){const[e,r]=j(fa);return X(()=>{const t=new MutationObserver(()=>r(fa()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),e}s(ha,"useThemeKey");function ko(){const e=ha();return Y(()=>{const r=ma();return ua(r,r("font-sans").trim()||void 0)},[e])}s(ko,"useChartTheme");var Do=Je("flex items-center justify-center",{variants:{size:{sm:"text-sm",default:"text-base",lg:"text-lg",xl:"text-xl"},variant:{spinner:"",dots:"",pulse:"",bars:""}},defaultVariants:{size:"default",variant:"spinner"}}),Ro=Je("rounded-full border-2 border-solid animate-spin",{variants:{size:{sm:"w-4 h-4",default:"w-6 h-6",lg:"w-8 h-8",xl:"w-10 h-10"}},defaultVariants:{size:"default"}}),pa=g.forwardRef(({className:e,variant:r,size:t,text:n,showText:o=!0,...i},l)=>{const d=s(()=>a("div",{className:m(Ro({size:t}),"border-muted-foreground/20 border-t-primary")}),"renderSpinner"),h=s(()=>{const p=t==="sm"?"w-1.5 h-1.5":t==="lg"?"w-2.5 h-2.5":t==="xl"?"w-3 h-3":"w-2 h-2";return u("div",{className:"flex space-x-1",children:[a("div",{className:m(p,"animate-bounce rounded-full bg-primary"),style:{animationDelay:"0ms"}}),a("div",{className:m(p,"animate-bounce rounded-full bg-primary"),style:{animationDelay:"150ms"}}),a("div",{className:m(p,"animate-bounce rounded-full bg-primary"),style:{animationDelay:"300ms"}})]})},"renderDots"),f=s(()=>a("div",{className:m(t==="sm"?"w-4 h-4":t==="lg"?"w-8 h-8":t==="xl"?"w-10 h-10":"w-6 h-6","animate-pulse rounded-full bg-primary")}),"renderPulse"),c=s(()=>{const p=t==="sm"?"h-3":t==="lg"?"h-6":t==="xl"?"h-8":"h-4",v=t==="sm"?"w-0.5":t==="lg"?"w-1":t==="xl"?"w-1.5":"w-0.5";return u("div",{className:"flex items-end space-x-1",children:[a("div",{className:m(v,p,"animate-pulse bg-primary"),style:{animationDelay:"0ms"}}),a("div",{className:m(v,p,"animate-pulse bg-primary"),style:{animationDelay:"100ms"}}),a("div",{className:m(v,p,"animate-pulse bg-primary"),style:{animationDelay:"200ms"}}),a("div",{className:m(v,p,"animate-pulse bg-primary"),style:{animationDelay:"300ms"}})]})},"renderBars"),b=s(()=>{switch(r){case"dots":return h();case"pulse":return f();case"bars":return c();case"spinner":default:return d()}},"renderLoader");return a("div",{ref:l,className:m(Do({size:t,variant:r,className:e})),...i,children:u("div",{className:"flex flex-col items-center space-y-3",children:[b(),o&&n&&a("div",{className:"space-y-1 text-center",children:a("p",{className:m("font-medium text-foreground",t==="sm"?"text-xs":t==="lg"?"text-sm":t==="xl"?"text-base":"text-sm"),children:n})})]})})});pa.displayName="Loading";var So={SMALL:64,MEDIUM:128,LARGE:256};function To({variant:e="primary",size:r="MEDIUM",className:t,priority:n=!1}){const o=typeof r=="number"?r:So[r],l=s(d=>d==="default"||d==="primary"?"/images/logos/logo.png":`/images/logos/logo-${d}.png`,"getLogoSrc")(e);return a("img",{src:l,alt:"Logo",width:o,height:o,className:m("object-contain",t),loading:n?"eager":"lazy"})}s(To,"Logo");function Fo({src:e,alt:r,fallbackSrc:t="/images/illustrations/placeholder.svg",className:n,showLoader:o=!0,showError:i=!0,...l}){const[d,h]=j(!0),[f,c]=j(!1),[b,p]=j(e),v=s(()=>{h(!1),c(!1)},"handleLoad"),x=s(()=>{h(!1),c(!0),b!==t&&(p(t),h(!0))},"handleError");return Q.useEffect(()=>{p(e),h(!0),c(!1)},[e]),u("div",{className:m("relative",n),children:[a("img",{...l,src:b,alt:r,className:m("transition-opacity duration-200",d?"opacity-0":"opacity-100"),onLoad:v,onError:x}),d&&o&&a("div",{className:"absolute inset-0 flex animate-pulse items-center justify-center bg-muted",children:a("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-border-strong border-t-muted-foreground"})}),f&&i&&b===t&&a("div",{className:"absolute inset-0 flex items-center justify-center bg-muted",children:a("div",{className:"text-sm text-muted-foreground",children:"Failed to load image"})})]})}s(Fo,"OptimizedImage");var Ao={default:"truncate text-lg font-semibold text-foreground",display:"text-[2rem] font-semibold leading-[1.15] tracking-[-0.02em] text-foreground"};function Io({title:e,description:r,titleVisuallyHidden:t=!1,actions:n,actionsClassName:o,leading:i,toolbar:l,as:d="h1",size:h="default",className:f,...c}){return u("header",{className:m("flex flex-col gap-4",f),...c,children:[u("div",{className:m("flex flex-col items-start justify-between gap-4 sm:flex-row",t&&!n&&"sr-only"),children:[u("div",{className:m("flex min-w-0 items-start gap-3",t&&"sr-only"),children:[i,u("div",{className:"min-w-0",children:[a(d,{className:Ao[h],children:e}),r&&a("p",{className:m("mt-1 text-sm text-muted-foreground",h==="display"&&"mt-2 max-w-2xl text-[15px]"),children:r})]})]}),n&&a("div",{className:m("flex items-center gap-2",t&&"ml-auto",o??"shrink-0"),children:n})]}),l]})}s(Io,"PageHeader");var Mo="mx-auto w-full max-w-7xl px-4 md:px-8",Bo="w-full px-4 md:px-8",ga="pr-[calc(1rem+var(--shell-scrollbar,0px))] md:pr-[calc(2rem+var(--shell-scrollbar,0px))]";function Po({header:e,divided:r=!1,contentLayout:t="scroll",footer:n,contentClassName:o,fullWidth:i=!1,className:l,children:d,...h}){const f=i?Bo:Mo;return u("div",{className:m("flex h-full min-h-0 flex-col bg-background",l),...h,children:[e&&a("div",{className:m("flex-shrink-0",r&&"border-b border-border/60"),children:a("div",{className:m(f,ga,"pb-4 pt-6 md:pt-8"),children:e})}),t==="fill"?a("div",{className:m(f,"flex min-h-0 flex-1 flex-col overflow-hidden pb-6 pt-5",o),children:d}):a("div",{className:m("min-h-0 flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",o),children:a("div",{className:m(f,n?"pb-6 pt-5":"pb-10 pt-5"),children:d})}),n&&a("div",{className:"flex-shrink-0 border-t border-border/60",children:a("div",{className:m(f,ga,"py-2"),children:n})})]})}s(Po,"PageShell");var Lo="pr-[var(--shell-scrollbar,0px)]";function Oo({options:e,value:r,onValueChange:t,size:n="md",variant:o="default",fullWidth:i=!1,className:l,"aria-label":d}){const h=g.useRef(new Map),f=e.filter(p=>!p.disabled),c=s(p=>{if(f.length===0)return;const v=f.findIndex(E=>E.value===r),w=f[((v===-1?0:v)+p+f.length)%f.length];w&&(t(w.value),h.current.get(w.value)?.focus())},"move");return a("div",{role:"radiogroup","aria-label":d,onKeyDown:s(p=>{p.key==="ArrowRight"||p.key==="ArrowDown"?(p.preventDefault(),c(1)):(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(p.preventDefault(),c(-1))},"handleKeyDown"),className:m("inline-flex items-center gap-1",o==="underline"?"border-b border-border/70":"rounded-lg border border-border bg-muted/50 p-1",i&&"w-full",l),children:e.map(p=>{const v=p.value===r,x=u("button",{ref:s(w=>{w?h.current.set(p.value,w):h.current.delete(p.value)},"ref"),type:"button",role:"radio","aria-checked":v,disabled:p.disabled,tabIndex:v?0:-1,onClick:s(()=>t(p.value),"onClick"),className:m("inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",o==="underline"?'relative rounded-none after:absolute after:inset-x-2 after:-bottom-px after:h-0.5 after:rounded-full after:bg-transparent after:content-[""]':"rounded-md",n==="sm"?o==="underline"?"px-3 py-2 text-sm":"px-2.5 py-1 text-xs":"px-3 py-1.5 text-sm",i&&"flex-1",v?o==="accent"?"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90":o==="underline"?"text-primary after:bg-primary":"bg-background text-foreground shadow-sm":o==="underline"?"text-muted-foreground hover:text-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[p.label,p.count!==void 0&&a("span",{className:m("rounded-full px-1.5 text-[10px] tabular-nums leading-4",v?"bg-primary/10 text-primary":"bg-foreground/[0.06] text-muted-foreground"),children:p.count})]});return!p.disabled||!p.disabledReason?a(g.Fragment,{children:x},p.value):u(be,{children:[a(xe,{asChild:!0,children:a("span",{className:m("inline-flex",i&&"flex-1"),children:x})}),a(ye,{side:"top",children:p.disabledReason})]},p.value)})})}s(Oo,"Segmented");var Vr=g.forwardRef(({className:e,...r},t)=>a(ke.Root,{ref:t,className:m("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...r}));Vr.displayName=ke.Root.displayName;var Wr=g.forwardRef(({className:e,...r},t)=>a(ke.Image,{ref:t,className:m("aspect-square h-full w-full",e),...r}));Wr.displayName=ke.Image.displayName;var Gr=g.forwardRef(({className:e,...r},t)=>a(ke.Fallback,{ref:t,className:m("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...r}));Gr.displayName=ke.Fallback.displayName;var _o={SMALL:32,MEDIUM:48,LARGE:96,XLARGE:128},va="/images/avatars/default-avatar.png";function $o({src:e,alt:r,size:t="MEDIUM",className:n,fallback:o}){const i=typeof t=="number"?t:_o[t],l=e??va,[d,h]=Q.useState(!1),[f,c]=Q.useState(!0),b=s(()=>{c(!1),h(!1)},"handleLoad"),p=s(()=>{c(!1),h(!0)},"handleError");return d&&o?a(J,{children:o}):u("div",{className:m("relative overflow-hidden rounded-full",n),style:{width:i,height:i},children:[a("img",{src:d?va:l,alt:r,className:"h-full w-full object-cover",onLoad:b,onError:p}),f&&a("div",{className:"absolute inset-0 flex animate-pulse items-center justify-center bg-skeleton",children:a("div",{className:"bg-skeleton-highlight h-4 w-4 rounded-full"})})]})}s($o,"AvatarImage2");var ba=g.forwardRef(({className:e,...r},t)=>u(Me.Root,{ref:t,className:m("relative flex w-full touch-none select-none items-center",e),...r,children:[a(Me.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a(Me.Range,{className:"absolute h-full bg-primary"})}),a(Me.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));ba.displayName=Me.Root.displayName;var xa=s(({node:e,level:r,onSelect:t,onExpand:n,selectedValue:o,renderNode:i,showConnectors:l=!0,collapsible:d=!0,defaultExpandAll:h=!1,expandOnSelect:f=!1,checkable:c=!1,checkedKeys:b=[],onCheck:p,checkStrictly:v=!1,allNodes:x,i18n:w})=>{const[E,C]=j(e.defaultExpanded??h??!1),D=e.children&&e.children.length>0,y=o===e.value||o===e.id,k=c&&e.checkable!==!1,S=Y(()=>{if(!k)return{checked:!1,indeterminate:!1};const R=b.includes(e.id);if(!D||v)return{checked:R,indeterminate:!1};const I=s(B=>{let O=[];return B.forEach(N=>{O.push(N.id),N.children&&(O=O.concat(I(N.children)))}),O},"getAllChildrenIds"),z=I(e.children??[]),M=z.filter(B=>b.includes(B));return M.length===0?{checked:R,indeterminate:!1}:M.length===z.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},[k,b,e.id,e.children,D,v]),A=s(R=>{R.stopPropagation(),D&&d&&(C(!E),n?.(e,!E))},"handleToggle"),_=s(()=>{e.disabled||(f&&D&&d&&(C(!E),n?.(e,!E)),t?.(e))},"handleSelect"),L=s(R=>{if(!p)return;let I=[...b];if(v)R?I.includes(e.id)||I.push(e.id):I=I.filter(B=>B!==e.id);else{const B=s(O=>{let N=[];return O.forEach(P=>{N.push(P.id),P.children&&P.children.length>0&&(N=N.concat(B(P.children)))}),N},"getAllChildrenIds");if(R)I.includes(e.id)||I.push(e.id),D&&e.children&&B(e.children).forEach(N=>{I.includes(N)||I.push(N)});else if(I=I.filter(O=>O!==e.id),D&&e.children){const O=B(e.children);I=I.filter(N=>!O.includes(N))}}const z=I.map(B=>x.get(B)).filter(Boolean);p(I,{checked:R,checkedNodes:z,node:e,halfCheckedKeys:[]})},"handleCheck");return u("div",{className:"tree-item",children:[u("div",{className:m("relative flex items-center rounded-sm px-2 py-1 transition-colors hover:bg-accent/50",y&&"bg-accent text-accent-foreground",e.disabled&&"cursor-not-allowed opacity-50"),style:{paddingLeft:`${r*24}px`},children:[l&&r>0&&u(J,{children:[a("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 w-px bg-border/60",style:{left:`${r*24-12}px`}}),a("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-px w-3 bg-border/60",style:{left:`${r*24-12}px`}})]}),D&&d?a(K,{type:"button",variant:"ghost",size:"icon",className:"mr-1 size-11 shrink-0 md:size-8",onClick:A,"aria-label":E?`${w?.collapse??"Collapse"} ${typeof e.label=="string"?e.label:""}`:`${w?.expand??"Expand"} ${typeof e.label=="string"?e.label:""}`,children:E?a(Qe,{className:"h-3 w-3 text-muted-foreground"}):a(ce,{className:"h-3 w-3 text-muted-foreground"})}):a("div",{className:"mr-1 size-11 shrink-0 md:size-8"}),k&&a(De,{id:e.checkboxId,checked:S.indeterminate?"indeterminate":S.checked,onCheckedChange:L,className:"mr-2 h-4 w-4","aria-label":typeof e.label=="string"?e.label:void 0,disabled:e.disabled}),e.icon&&a("span",{className:"mr-2 flex items-center",children:e.icon}),a("div",{className:m("min-w-0 flex-1",!k&&"cursor-pointer"),onClick:k?void 0:_,children:i?i(e,y,E,S):e.label})]}),D&&E&&a("div",{className:"tree-children",children:e.children?.map(R=>a(xa,{node:R,level:r+1,...t&&{onSelect:t},...n&&{onExpand:n},selectedValue:o,...i&&{renderNode:i},showConnectors:l,collapsible:d,defaultExpandAll:h,expandOnSelect:f,checkable:c,checkedKeys:b,...p&&{onCheck:p},checkStrictly:v,allNodes:x,i18n:w},R.id))})]})},"TreeItem"),zo=Q.forwardRef(({data:e,className:r,onSelect:t,onExpand:n,selectedValue:o,renderNode:i,showConnectors:l=!0,collapsible:d=!0,defaultExpandAll:h=!1,expandOnSelect:f=!1,checkable:c=!1,defaultCheckedKeys:b=[],checkedKeys:p,onCheckedChange:v,checkStrictly:x=!1,showSelectAll:w=!1,i18n:E},C)=>{const D=Y(()=>{const B=new Map,O=s(N=>{N.forEach(P=>{B.set(P.id,P),P.children&&O(P.children)})},"addNodes");return O(e),B},[e]),[y,k]=j(b),S=p??y,[A,_]=j(!1);X(()=>{A||(k(b),_(!0))},[b,A]);const L=V(()=>{const B=[],O=s(N=>{N.forEach(P=>{P.checkable!==!1&&B.push(P.id),P.children&&O(P.children)})},"traverse");return O(e),B},[e]),R=V(()=>{const B=L();k(B),v&&v(B)},[L,v]),I=V(()=>{k([]),v&&v([])},[v]),z=V((B,O)=>{k(B),v&&v(B)},[v]);gs(C,()=>({getCheckedKeys:s(()=>S,"getCheckedKeys"),setCheckedKeys:s(B=>{k(B),v&&v(B)},"setCheckedKeys"),selectAll:R,deselectAll:I}),[S,v,R,I]);const M={selectAll:E?.selectAll??"Select All",deselectAll:E?.deselectAll??"Deselect All",permissionSelection:E?.permissionSelection??"Selection"};return u("div",{className:m("tree-container",r),children:[c&&w&&u("div",{className:"tree-select-all-bar mb-2 flex items-center justify-between border-b p-2",children:[a("span",{className:"text-sm font-medium",children:M.permissionSelection}),u("div",{className:"flex items-center space-x-2 text-xs",children:[a("button",{onClick:R,className:"text-primary hover:text-primary/80 hover:underline",children:M.selectAll}),a("span",{className:"text-muted-foreground",children:"|"}),a("button",{onClick:I,className:"text-primary hover:text-primary/80 hover:underline",children:M.deselectAll})]})]}),e.map(B=>a(xa,{node:B,level:0,...t&&{onSelect:t},...n&&{onExpand:n},selectedValue:o,...i&&{renderNode:i},showConnectors:l,collapsible:d,defaultExpandAll:h,expandOnSelect:f,checkable:c,checkedKeys:S,onCheck:z,checkStrictly:x,allNodes:D,i18n:E},B.id))]})}),Uo=Je("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium transition-all duration-200",{variants:{variant:{success:"bg-success-soft text-success border border-success/20 shadow-subtle",warning:"bg-warning-soft text-warning border border-warning/20 shadow-subtle",destructive:"bg-destructive-soft text-destructive border border-destructive/20 shadow-subtle",info:"bg-info-soft text-info border border-info/20 shadow-subtle",default:"bg-muted text-foreground border border-border shadow-subtle",outline:"border border-input bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground"},size:{default:"px-2.5 py-1 text-xs",sm:"px-2 py-0.5 text-xs",lg:"px-3 py-1.5 text-sm"}},defaultVariants:{variant:"default",size:"default"}}),ya=g.forwardRef(({className:e,variant:r,size:t,icon:n,pulse:o=!1,children:i,...l},d)=>u("div",{className:m(Uo({variant:r,size:t}),e),ref:d,...l,children:[n&&a("span",{className:m("flex-shrink-0",o&&"animate-pulse"),children:n}),i]}));ya.displayName="StatusBadge";var wa={active:"bg-success",live:"bg-signal",idle:"bg-muted-foreground/50",pending:"bg-warning",paused:"bg-muted-foreground/70",error:"bg-destructive"},jo={sm:"h-1.5 w-1.5",md:"h-2 w-2"},Na=g.forwardRef(({tone:e,size:r="md",pulse:t=!1,label:n,className:o,...i},l)=>{const d=u("span",{className:m("relative flex",jo[r]),children:[t&&(e==="active"||e==="live")&&a("span",{"aria-hidden":!0,className:m("absolute inset-0 animate-ping rounded-full opacity-60 motion-reduce:animate-none",wa[e])}),a("span",{className:m("relative h-full w-full rounded-full",wa[e])})]});return n?u("span",{ref:l,className:m("inline-flex items-center gap-1.5 text-xs text-muted-foreground",o),...i,children:[d,n]}):a("span",{ref:l,role:"status","aria-label":e,className:m("inline-flex",o),...i,children:d})});Na.displayName="StatusDot";var Ea=g.forwardRef(({label:e,caption:r,icon:t,meta:n,className:o,...i},l)=>u("button",{ref:l,type:"button",className:m("group flex flex-col items-start gap-2 rounded-[var(--radius-card)] p-4 text-left","bg-[hsl(var(--surface-raised))] shadow-[var(--shadow-card)]","transition-[transform,box-shadow] duration-hover","hover:-translate-y-0.5 hover:shadow-[var(--shadow-lift)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50","motion-reduce:transform-none motion-reduce:transition-none",o),...i,children:[t&&a("span",{className:"flex h-9 w-9 items-center justify-center rounded-[var(--radius-control)] bg-accent text-accent-foreground",children:t}),a("span",{className:"text-sm font-medium leading-snug text-foreground",children:e}),r&&a("span",{className:"text-xs leading-relaxed text-muted-foreground",children:r}),n&&a("span",{className:"mt-auto pt-1 text-xs text-muted-foreground/80",children:n})]}));Ea.displayName="TaskEntryTile";var Ca=g.forwardRef(({steps:e,currentStep:r,onStepChange:t,children:n,className:o,showStepIndicator:i=!0,allowStepNavigation:l=!0,...d},h)=>u("div",{ref:h,className:m("w-full",o),...d,children:[i&&a("div",{className:"mb-8",children:a("div",{className:"flex items-center justify-between",children:e.map((f,c)=>u("div",{className:"flex flex-1 items-center",children:[u("div",{className:"flex items-center",children:[a("button",{type:"button",onClick:s(()=>l&&!f.isDisabled&&t(c),"onClick"),disabled:f.isDisabled||!l,className:m("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-200",c===r&&"scale-110 border-primary bg-primary text-primary-foreground shadow-lg",c<r&&"border-success bg-success text-success-foreground",c>r&&"border-border-strong bg-card text-muted-foreground",l&&!f.isDisabled&&"cursor-pointer hover:scale-105",f.isDisabled&&"cursor-not-allowed opacity-50"),children:f.isCompleted||c<r?a("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:a("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):f.icon?f.icon:a("span",{className:"text-sm font-semibold",children:c+1})}),u("div",{className:"ml-3 min-w-0",children:[a("p",{className:m("text-sm font-medium transition-colors",c===r&&"text-primary",c<r&&"text-success",c>r&&"text-muted-foreground"),children:f.title}),f.description&&a("p",{className:"mt-0.5 text-xs text-muted-foreground",children:f.description})]})]}),c<e.length-1&&a("div",{className:m("mx-4 h-0.5 flex-1 transition-colors duration-300",c<r?"bg-success":"bg-border")})]},f.id))})}),a("div",{className:"min-h-[400px]",children:n})]}));Ca.displayName="FormWizard";var ka=g.forwardRef(({children:e,className:r,...t},n)=>a("div",{ref:n,className:m("duration-300 animate-in slide-in-from-right-4",r),...t,children:e}));ka.displayName="FormWizardStep";var Da=g.forwardRef(({onPrevious:e,onNext:r,onSubmit:t,isFirstStep:n=!1,isLastStep:o=!1,isPreviousDisabled:i=!1,isNextDisabled:l=!1,isSubmitDisabled:d=!1,previousLabel:h="Previous",nextLabel:f="Next",submitLabel:c="Submit",className:b,...p},v)=>u("div",{ref:v,className:m("flex items-center justify-between border-t border-border pt-6",b),...p,children:[a("div",{children:!n&&a(K,{type:"button",variant:"outline",onClick:e,disabled:i,children:h})}),a("div",{className:"flex gap-3",children:o?a(K,{type:"submit",onClick:t,disabled:d,variant:"gradient",children:c}):a(K,{type:"button",onClick:r,disabled:l,children:f})})]}));Da.displayName="FormWizardNavigation";var Ra=g.forwardRef(({label:e,description:r,error:t,success:n,leftIcon:o,rightIcon:i,isLoading:l=!1,showCharacterCount:d=!1,maxCharacters:h,onValueChange:f,containerClassName:c,labelClassName:b,descriptionClassName:p,errorClassName:v,successClassName:x,className:w,id:E,value:C="",onChange:D,...y},k)=>{const S=g.useId(),A=E??S,_=r?`${A}-description`:void 0,L=t?`${A}-error`:void 0,R=n?`${A}-success`:void 0,I=typeof C=="string"?C.length:0,z=h?I>h:!1,M=s(N=>{D?.(N),f?.(N.target.value)},"handleChange"),B=!!t,O=!!(n&&!t);return u("div",{className:m("space-y-2",c),children:[e&&u(Te,{htmlFor:A,className:m("text-sm font-medium text-foreground",B&&"text-destructive",O&&"text-success",b),children:[e,y.required&&a("span",{className:"ml-1 text-destructive",children:"*"})]}),u("div",{className:"relative",children:[o&&a("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 transform text-muted-foreground",children:o}),a(Fe,{ref:k,id:A,value:C,onChange:M,className:m("transition-all duration-200",o&&"pl-10",(i||l||d)&&"pr-10",B&&"border-destructive/50 focus:border-destructive focus:ring-destructive",O&&"border-success/50 focus:border-success focus:ring-success",z&&"border-destructive/50 focus:border-destructive focus:ring-destructive",w),"aria-describedby":m(_,L,R).trim()||void 0,"aria-invalid":B,...y}),u("div",{className:"absolute right-3 top-1/2 flex -translate-y-1/2 transform items-center gap-2",children:[l&&a("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-border-strong border-t-primary"}),d&&h&&u("span",{className:m("text-xs font-medium",z?"text-destructive":"text-muted-foreground"),children:[I,"/",h]}),i&&!l&&a("div",{className:"text-muted-foreground",children:i}),B&&!l&&!i&&a("svg",{className:"h-4 w-4 text-destructive",fill:"currentColor",viewBox:"0 0 20 20",children:a("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),O&&!l&&!i&&a("svg",{className:"h-4 w-4 text-success",fill:"currentColor",viewBox:"0 0 20 20",children:a("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})]})]}),r&&!t&&!n&&a("p",{id:_,className:m("text-xs text-muted-foreground",p),children:r}),t&&u("p",{id:L,className:m("flex items-center gap-1 text-xs text-destructive",v),children:[a("svg",{className:"h-3 w-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:a("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),t]}),n&&!t&&u("p",{id:R,className:m("flex items-center gap-1 text-xs text-success",x),children:[a("svg",{className:"h-3 w-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:a("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),n]})]})});Ra.displayName="EnhancedInput";var F=g.forwardRef(({className:e,variant:r="default",width:t,height:n,count:o=1,style:i,...l},d)=>{const h=m("animate-shimmer",r==="default"&&"rounded-md",r==="circular"&&"rounded-full",r==="text"&&"rounded h-4",r==="card"&&"rounded-lg",e),f={width:typeof t=="number"?`${t}px`:t,height:typeof n=="number"?`${n}px`:n,...i};return o>1?a("div",{className:"space-y-2",children:Array.from({length:o},(c,b)=>a("div",{ref:b===0?d:void 0,className:h,style:f,...l},b))}):a("div",{ref:d,className:h,style:f,...l})});F.displayName="Skeleton";var Ko=s(({className:e,...r})=>u("div",{className:m("space-y-4 p-6",e),...r,children:[u("div",{className:"flex items-center space-x-4",children:[a(F,{variant:"circular",width:40,height:40}),u("div",{className:"flex-1 space-y-2",children:[a(F,{variant:"text",width:"60%"}),a(F,{variant:"text",width:"40%"})]})]}),a(F,{variant:"default",height:100}),u("div",{className:"flex space-x-2",children:[a(F,{variant:"default",width:80,height:32}),a(F,{variant:"default",width:80,height:32})]})]}),"SkeletonCard"),Vo=s(({count:e=3,className:r,...t})=>a("div",{className:m("space-y-4",r),...t,children:Array.from({length:e},(n,o)=>u("div",{className:"flex items-center space-x-4 rounded-lg border p-4",children:[a(F,{variant:"circular",width:48,height:48}),u("div",{className:"flex-1 space-y-2",children:[a(F,{variant:"text",width:"70%"}),a(F,{variant:"text",width:"50%"}),u("div",{className:"flex space-x-2",children:[a(F,{variant:"default",width:60,height:20}),a(F,{variant:"default",width:60,height:20})]})]}),u("div",{className:"space-x-2",children:[a(F,{variant:"default",width:80,height:32}),a(F,{variant:"default",width:32,height:32})]})]},o))}),"SkeletonList"),Wo=s(({rows:e=5,columns:r=4,className:t,...n})=>u("div",{className:m("space-y-3",t),...n,children:[a("div",{className:"flex space-x-4 border-b p-4",children:Array.from({length:r},(o,i)=>a(F,{variant:"text",width:"100%",height:16},i))}),Array.from({length:e},(o,i)=>a("div",{className:"flex space-x-4 p-4",children:Array.from({length:r},(l,d)=>a(F,{variant:"text",width:"100%",height:20},d))},i))]}),"SkeletonTable");function Sa(){return u("div",{className:"space-y-3 rounded-lg border bg-card p-6",children:[u("div",{className:"flex items-center justify-between",children:[a(F,{className:"h-4 w-20"}),a(F,{className:"h-4 w-4 rounded-full"})]}),a(F,{className:"h-8 w-24"}),u("div",{className:"flex items-center space-x-2",children:[a(F,{className:"h-3 w-3"}),a(F,{className:"h-3 w-32"})]})]})}s(Sa,"StatCardSkeleton");function Go({count:e=4}){return a("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:e}).map((r,t)=>a(Sa,{},t))})}s(Go,"StatsGridSkeleton");function Ho({rows:e=5,columns:r=4}){return u("div",{className:"space-y-3",children:[a("div",{className:"flex space-x-4 border-b pb-3",children:Array.from({length:r}).map((t,n)=>a(F,{className:"h-4 flex-1"},n))}),Array.from({length:e}).map((t,n)=>a("div",{className:"flex space-x-4 py-3",children:Array.from({length:r}).map((o,i)=>a(F,{className:"h-4 flex-1"},i))},n))]})}s(Ho,"TableSkeleton");function qo({count:e=3}){return a("div",{className:"space-y-4",children:Array.from({length:e}).map((r,t)=>u("div",{className:"space-y-4 rounded-lg border bg-card p-6",children:[u("div",{className:"flex items-start justify-between",children:[u("div",{className:"flex flex-1 items-center space-x-3",children:[a(F,{className:"h-12 w-12 rounded-lg"}),u("div",{className:"flex-1 space-y-2",children:[a(F,{className:"h-4 w-32"}),a(F,{className:"h-3 w-24"})]})]}),a(F,{className:"h-8 w-20"})]}),a(F,{className:"h-3 w-full"}),a(F,{className:"h-3 w-3/4"})]},t))})}s(qo,"CardListSkeleton");function Yo(){return u("div",{className:"overflow-hidden rounded-[var(--radius-card)] bg-[hsl(var(--surface-raised))] shadow-[var(--shadow-card)]",children:[a(F,{className:"h-1.5 w-full rounded-none"}),u("div",{className:"space-y-4 p-5",children:[a(F,{className:"h-16 w-16 rounded-full"}),u("div",{className:"space-y-2",children:[a(F,{className:"h-5 w-28"}),a(F,{className:"h-3 w-20"})]}),u("div",{className:"flex gap-1.5",children:[a(F,{className:"h-6 w-16 rounded-full"}),a(F,{className:"h-6 w-20 rounded-full"})]}),a(F,{className:"h-9 w-full rounded-[var(--radius-control)]"})]})]})}s(Yo,"EmployeeCardSkeleton");function Xo(){return u("div",{className:"rounded-[var(--radius-card)] bg-[hsl(var(--surface-raised))] shadow-[var(--shadow-card)]",children:[u("div",{className:"space-y-3 p-5 pb-3",children:[u("div",{className:"flex items-start gap-3.5",children:[a(F,{className:"h-16 w-16 shrink-0 rounded-full"}),u("div",{className:"flex-1 space-y-2 pt-1",children:[a(F,{className:"h-[0.9375rem] w-28"}),a(F,{className:"h-3 w-20"})]})]}),u("div",{className:"space-y-2",children:[a(F,{className:"h-3 w-full"}),a(F,{className:"h-3 w-4/5"})]}),u("div",{className:"flex h-6 gap-1.5 pt-1",children:[a(F,{className:"h-5 w-20 rounded-full"}),a(F,{className:"h-5 w-16 rounded-full"})]})]}),u("div",{className:"mx-5 flex items-center justify-between border-t border-border/50 py-2",children:[a(F,{className:"h-4 w-24"}),a(F,{className:"h-4 w-12"})]})]})}s(Xo,"CandidateCardSkeleton");function Qo(){return u("div",{className:"rounded-card bg-raised shadow-card",children:[u("div",{className:"flex items-start gap-3 p-5 pb-3",children:[a(F,{className:"mt-px h-5 w-5 shrink-0 rounded"}),u("div",{className:"min-w-0 flex-1 space-y-2",children:[a(F,{className:"h-[0.875rem] w-full"}),a(F,{className:"h-[0.875rem] w-4/5"}),a(F,{className:"h-3 w-28"})]})]}),u("div",{className:"mx-5 flex items-center justify-between border-t border-border/50 py-2",children:[a(F,{className:"h-3 w-24"}),a(F,{className:"h-4 w-10"})]})]})}s(Qo,"SkillCardSkeleton");function Zo({count:e=4}){return a("div",{className:"flex h-full min-h-0 gap-2.5",children:Array.from({length:e},(r,t)=>u("div",{className:"flex min-h-0 flex-1 flex-col rounded-xl border border-border/60 bg-muted/25",children:[u("div",{className:"flex items-center justify-between px-3 py-2.5",children:[u("div",{className:"flex items-center gap-2",children:[a(F,{className:"h-1.5 w-1.5 rounded-full"}),a(F,{className:"h-3.5 w-14"})]}),a(F,{className:"h-3 w-4"})]}),a("div",{className:"space-y-2.5 p-2.5",children:Array.from({length:2},(n,o)=>a(F,{className:"h-20 rounded-lg"},o))})]},t))})}s(Zo,"BoardColumnsSkeleton");function Jo({count:e=4}){return a("div",{className:"space-y-1",children:Array.from({length:e},(r,t)=>u("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[u("div",{className:"min-w-0 flex-1 space-y-1.5",children:[a(F,{className:"h-3.5 w-2/5"}),a(F,{className:"h-3 w-24"})]}),a(F,{className:"h-5 w-14 rounded-full"}),a(F,{className:"h-3 w-12"})]},t))})}s(Jo,"ListRowsSkeleton");function ei(){return u("div",{className:"rounded-[var(--radius-card)] bg-[hsl(var(--surface-raised))] shadow-[var(--shadow-card)]",children:[u("div",{className:"flex items-start gap-3 p-4",children:[a(F,{className:"h-9 w-9 rounded-[var(--radius-control)]"}),u("div",{className:"flex-1 space-y-2 py-0.5",children:[a(F,{className:"h-4 w-28"}),a(F,{className:"h-3 w-40"})]})]}),a("div",{className:"space-y-3 border-t border-border/50 px-4 py-3",children:Array.from({length:3},(e,r)=>u("div",{className:"flex items-center justify-between gap-3",children:[a(F,{className:"h-3 flex-1"}),a(F,{className:"h-3 w-12 shrink-0"})]},r))})]})}s(ei,"LibraryCardSkeleton");function ri(){return u("div",{className:"space-y-2",children:[a(F,{className:"h-8 w-48"}),a(F,{className:"h-4 w-64"})]})}s(ri,"PageHeaderSkeleton");var ti=me.Root,Ta=g.forwardRef(({className:e,...r},t)=>a(me.List,{ref:t,className:m("flex border-b border-border",e),...r}));Ta.displayName=me.List.displayName;var Fa=g.forwardRef(({className:e,...r},t)=>a(me.Trigger,{ref:t,className:m("relative inline-flex items-center justify-center whitespace-nowrap px-4 py-3 text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50","text-muted-foreground hover:text-foreground",'after:absolute after:inset-x-0 after:-bottom-px after:h-[2px] after:content-[""]',"data-[state=active]:text-primary data-[state=active]:after:bg-primary",e),...r}));Fa.displayName=me.Trigger.displayName;var Aa=g.forwardRef(({className:e,...r},t)=>a(me.Content,{ref:t,className:m("mt-4 ring-offset-background focus-visible:outline-none",e),...r}));Aa.displayName=me.Content.displayName;var Ia=g.forwardRef(({className:e,...r},t)=>a(er.Root,{ref:t,className:m("inline-flex items-center gap-0.5",e),...r}));Ia.displayName=er.Root.displayName;var Ma=g.forwardRef(({className:e,...r},t)=>a(er.Item,{ref:t,className:m("inline-flex h-8 min-w-8 items-center justify-center gap-1.5 rounded-md px-2 text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","text-muted-foreground hover:bg-muted hover:text-foreground","data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",e),...r}));Ma.displayName=er.Item.displayName;var ai=s(e=>`${e>0?"+":""}${(e*100).toFixed(Math.abs(e)<.1?1:0)}%`,"percent");function Ba({value:e,direction:r="up",emptyLabel:t="\u2014",comparisonLabel:n,className:o}){if(e===null||!Number.isFinite(e))return a("span",{className:m("text-xs text-muted-foreground",o),children:t});const i=Math.abs(e)<5e-4,l=i?null:e>0==(r==="up"),d=i?Ct:e>0?As:Is,h=i?"0%":ai(e);return u("span",{className:m("inline-flex items-center gap-0.5 text-xs font-medium tabular-nums",l===null?"text-muted-foreground":l?"text-success":"text-destructive",o),"aria-label":n?`${h} ${n}`:h,children:[a(d,{"aria-hidden":!0,className:"size-3.5"}),h,n&&a("span",{className:"ml-1 font-normal text-muted-foreground",children:n})]})}s(Ba,"DeltaIndicator");var ni={sm:"text-base",md:"text-xl",lg:"text-3xl"};function si({value:e,label:r,unit:t,delta:n,size:o="md",className:i,...l}){return u("div",{className:m("min-w-0",i),...l,children:[r&&a("div",{className:"text-xs text-muted-foreground",children:r}),u("div",{className:m("flex items-baseline gap-1",r&&"mt-1"),children:[a("span",{className:m("font-mono font-semibold tabular-nums tracking-tight text-foreground",ni[o]),children:e??"\u2014"}),t&&a("span",{className:"text-xs text-muted-foreground",children:t}),n&&a(Ba,{className:"ml-1 font-mono",...n})]})]})}s(si,"MetricValue");var Pa=g.forwardRef(({title:e,icon:r,actions:t,className:n,...o},i)=>u("header",{ref:i,className:m("flex min-h-9 items-center gap-2 border-b border-hairline bg-[var(--panel-head-bg)] px-3.5 text-xs font-semibold text-muted-foreground",n),...o,children:[r&&a("span",{className:"flex shrink-0 [&>svg]:size-3.5","aria-hidden":!0,children:r}),a("span",{className:"min-w-0 flex-1 truncate",children:e}),t&&a("div",{className:"flex shrink-0 items-center gap-1",children:t})]}));Pa.displayName="PanelHeader";var oi="inline-flex h-11 w-fit max-w-full items-center gap-6 overflow-x-auto border-b border-border/60 bg-transparent [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",ii='relative inline-flex !h-11 flex-shrink-0 items-center gap-2 !rounded-none !px-0 !py-0 text-sm font-semibold !text-muted-foreground transition-colors after:absolute after:inset-x-0 after:-bottom-px after:!h-0.5 after:rounded-full after:!bg-transparent after:content-[""] hover:!bg-transparent hover:!text-foreground data-[state=active]:!bg-transparent data-[state=active]:!text-primary data-[state=active]:shadow-none data-[state=active]:after:!bg-primary',li='relative inline-flex h-11 flex-shrink-0 items-center gap-2 rounded-none bg-transparent px-0 py-0 text-sm font-semibold transition-colors after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:rounded-full after:content-[""]',ci="text-primary after:bg-primary hover:bg-transparent hover:text-primary",di="text-muted-foreground after:bg-transparent hover:bg-transparent hover:text-foreground";function ui(e){for(const r of e){const t=r?.trim();if(t)return t}return null}s(ui,"firstNonEmpty");function _e(e){return ui([e.displayName,e.fullName,e.username,e.email])??e.id}s(_e,"getUserPrimaryLabel");function mi(e){const r=_e(e),t=e.username?.trim(),n=e.email?.trim(),o=[t&&t!==r?`@${t}`:null,n&&n!==r?n:null,e.description].filter(i=>!!i);return o.length>0?o.join(" \xB7 "):null}s(mi,"getUserSecondaryLabel");function fi(e){return _e(e).slice(0,1).toUpperCase()}s(fi,"getUserInitial");function hi(e,r){const t=r.trim().toLowerCase();return t?[e.displayName,e.fullName,e.username,e.email,e.description,e.id].some(n=>n?.toLowerCase().includes(t)):!0}s(hi,"matchesUser");function Hr(e,r){const t=new Map(e);for(const n of r)t.set(n.id,n);return t}s(Hr,"updateKnownUsers");function pi(e){const{users:r,onSearch:t,placeholder:n=e.multiple?"Select users":"Select a user",searchPlaceholder:o="Search users...",emptyText:i="No users found",loadingText:l="Loading...",loading:d=!1,errorText:h="Could not load users",retryLabel:f="Retry",clearLabel:c="Clear",disabled:b,className:p,triggerClassName:v,align:x="start"}=e,[w,E]=g.useState(!1),[C,D]=g.useState(""),[y,k]=g.useState(r),[S,A]=g.useState(!1),[_,L]=g.useState(!1),[R,I]=g.useState(0),[z,M]=g.useState(()=>Hr(new Map,r));g.useEffect(()=>{M(U=>Hr(U,r)),(!w||C.trim().length===0)&&k(r)},[w,C,r]),g.useEffect(()=>{M(U=>Hr(U,y))},[y]),g.useEffect(()=>{if(!w)return;const U=C.trim();if(L(!1),!t){k(r.filter(Er=>hi(Er,U))),A(!1);return}if(!U){k(r),A(!1);return}let se=!1;A(!0);const ve=window.setTimeout(async()=>{try{const Er=await t(U);se||k(Er)}catch{se||(k([]),L(!0))}finally{se||A(!1)}},250);return()=>{se=!0,window.clearTimeout(ve)}},[w,t,C,r,R]);const B=g.useMemo(()=>e.multiple?e.value:e.value?[e.value]:[],[e.multiple,e.value]),O=g.useMemo(()=>new Set(B),[B]),N=B.map(U=>z.get(U)??{id:U,username:U}),P=s(U=>{E(U),U||(D(""),k(r),A(!1))},"handleOpenChange"),$=s(U=>{if(e.multiple){const se=O.has(U)?e.value.filter(ve=>ve!==U):[...e.value,U];e.onChange(se);return}e.onChange(U),P(!1)},"toggleUser"),ne=s(()=>{e.multiple?e.onChange([]):e.onChange("")},"clearSelection"),Ye=e.multiple?e.value.length>0:!!(e.allowClear&&e.value),Nr=e.multiple?e.maxVisibleUsers??2:1;return u(Re,{open:w,onOpenChange:P,children:[a(Se,{asChild:!0,children:u(K,{type:"button",variant:"outline",role:"combobox","aria-expanded":w,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],disabled:b,className:m("h-9 w-full justify-between gap-2 px-3 font-normal",p,v),children:[a("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden",children:N.length===0?a("span",{className:"truncate text-muted-foreground",children:n}):e.multiple?u(J,{children:[N.slice(0,Nr).map(U=>a(Et,{variant:"secondary",className:"min-w-0 max-w-28 rounded-md px-1.5 py-0 text-xs font-medium",children:a("span",{className:"truncate",children:_e(U)})},U.id)),N.length>Nr&&u(Et,{variant:"secondary",className:"rounded-md px-1.5 py-0 text-xs font-medium",children:["+",N.length-Nr]})]}):a("span",{className:"truncate",children:_e(N[0])})}),a(Fr,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}),u(pe,{align:x,className:"w-[var(--radix-popover-trigger-width)] p-0",children:[u("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[a(Ne,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a("input",{type:"text",autoFocus:!0,value:C,disabled:b,onChange:s(U=>D(U.target.value),"onChange"),placeholder:o,"aria-label":o,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),C?a("button",{type:"button",onClick:s(()=>D(""),"onClick"),className:"rounded-sm text-muted-foreground transition-colors hover:text-foreground","aria-label":c,children:a(oe,{className:"h-3.5 w-3.5"})}):null]}),Ye?u("button",{type:"button",onClick:ne,className:"flex w-full items-center justify-between border-b px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:[a("span",{children:c}),a(oe,{className:"h-4 w-4"})]}):null,a("div",{className:"max-h-72 overflow-y-auto py-1",children:S||d?u("div",{className:"flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:[a(Rt,{className:"h-3.5 w-3.5 animate-spin"}),l]}):_?u("div",{role:"alert",className:"space-y-2 px-3 py-3 text-xs text-destructive",children:[a("p",{children:h}),a(K,{type:"button",variant:"outline",size:"sm",onClick:s(()=>I(U=>U+1),"onClick"),children:f})]}):y.length===0?a("div",{className:"px-3 py-3 text-xs text-muted-foreground",children:i}):y.map(U=>{const se=O.has(U.id),ve=mi(U);return u("button",{type:"button",onClick:s(()=>$(U.id),"onClick"),className:m("flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-muted",se&&"bg-muted/50"),children:[u(Vr,{className:"h-7 w-7 shrink-0",children:[U.avatar?a(Wr,{src:U.avatar}):null,a(Gr,{className:"text-[11px]",children:fi(U)||a(Ms,{className:"h-3.5 w-3.5"})})]}),u("span",{className:"min-w-0 flex-1",children:[a("span",{className:"block truncate font-medium",children:_e(U)}),ve?a("span",{className:"block truncate text-xs text-muted-foreground",children:ve}):null]}),a("span",{className:m("flex h-5 w-5 shrink-0 items-center justify-center rounded border border-border text-transparent",se&&"border-primary bg-primary text-primary-foreground"),children:a(le,{className:"h-3.5 w-3.5"})})]},U.id)})})]})]})}s(pi,"UserPicker");function sr({className:e,classNames:r,captionLayout:t="dropdown",locale:n=rr,navLayout:o="around",showOutsideDays:i=!0,fixedWeeks:l=!0,labels:d,...h}){return a(Ys,{fixedWeeks:l,labels:{labelNav:s(()=>"\u65E5\u5386\u5BFC\u822A","labelNav"),labelNext:s(()=>"\u4E0B\u4E2A\u6708","labelNext"),labelPrevious:s(()=>"\u4E0A\u4E2A\u6708","labelPrevious"),...d},locale:n,navLayout:o,captionLayout:t,showOutsideDays:i,className:m("w-[18rem] p-3",e),classNames:{months:"flex flex-col gap-4",month:"relative w-full",month_caption:"flex h-8 items-center justify-center px-12",nav:"flex h-8 items-center",caption_label:"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-2.5 text-sm font-medium",dropdowns:"flex items-center justify-center gap-2",dropdown_root:"relative inline-flex h-8 items-center",dropdown:"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0",months_dropdown:"min-w-[5.25rem]",years_dropdown:"min-w-[5rem]",chevron:"h-4 w-4 opacity-60",button_previous:m(Tr({variant:"outline"}),"absolute left-0 top-0 h-8 w-8 bg-transparent p-0 opacity-70 hover:opacity-100"),button_next:m(Tr({variant:"outline"}),"absolute right-0 top-0 h-8 w-8 bg-transparent p-0 opacity-70 hover:opacity-100"),month_grid:"mt-3 w-full table-fixed border-collapse",weekdays:"grid grid-cols-7",weekday:"flex h-8 items-center justify-center text-xs font-normal text-muted-foreground",weeks:"block",week:"grid grid-cols-7",day:"relative flex h-9 w-9 items-center justify-center p-0 text-center text-sm",day_button:m(Tr({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),range_end:"day-range-end",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",today:"bg-accent text-accent-foreground",outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...r},components:{Chevron:s(({...f})=>f.orientation==="left"?a(Ir,{className:"h-4 w-4"}):f.orientation==="down"?a(Qe,{className:"h-4 w-4"}):a(ce,{className:"h-4 w-4"}),"Chevron")},...h})}s(sr,"Calendar"),sr.displayName="Calendar";var gi={enUS:qs,zhCN:rr};function vi(e){const r=e.getFullYear(),t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${r}-${t}-${n}`}s(vi,"formatDateValue");function bi(e){const r=e?.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!r)return;const[,t,n,o]=r;return new Date(Number(t),Number(n)-1,Number(o))}s(bi,"parseDateValue");function xi(e){return e?e.replaceAll("-","/"):""}s(xi,"formatDateDisplay");function La({value:e,onChange:r,placeholder:t="\u5E74 / \u6708 / \u65E5",locale:n=rr,labels:o,weekStartsOn:i,startMonth:l,endMonth:d,formatDisplay:h=xi,disabled:f,defaultOpen:c=!1,onOpenChange:b,className:p,calendarClassName:v,...x}){const[w,E]=g.useState(c),C=s(S=>{E(S),b?.(S)},"change"),D=new Date().getFullYear(),y=g.useMemo(()=>new Date(D-10,0),[D]),k=g.useMemo(()=>new Date(D+20,11),[D]);return u(Re,{open:w,onOpenChange:C,children:[a(Se,{asChild:!0,children:u(K,{type:"button",variant:"outline",disabled:f,...x,className:m("h-9 w-full justify-between px-3 text-left text-sm font-normal",!e&&"text-muted-foreground",p),children:[a("span",{children:e?h(e):t}),a(Bs,{className:"h-4 w-4 opacity-70"})]})}),a(pe,{align:"end",className:"w-auto p-0",children:a(sr,{locale:n,mode:"single",selected:bi(e),startMonth:l??y,endMonth:d??k,onSelect:s(S=>{S&&(r(vi(S)),C(!1))},"onSelect"),...v?{className:v}:{},...o?{labels:o}:{},...i!==void 0?{weekStartsOn:i}:{}})})]})}s(La,"DatePicker"),La.displayName="DatePicker";var qr=g.forwardRef(({className:e,...r},t)=>a("div",{className:"relative w-full overflow-auto",children:a("table",{ref:t,className:m("w-full caption-bottom text-sm",e),...r})}));qr.displayName="Table";var Yr=g.forwardRef(({className:e,...r},t)=>a("thead",{ref:t,className:m("bg-[var(--table-head-bg)] [&_tr]:border-b",e),...r}));Yr.displayName="TableHeader";var Xr=g.forwardRef(({className:e,...r},t)=>a("tbody",{ref:t,className:m("[&_tr:last-child]:border-0",e),...r}));Xr.displayName="TableBody";var Oa=g.forwardRef(({className:e,...r},t)=>a("tfoot",{ref:t,className:m("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...r}));Oa.displayName="TableFooter";var $e=g.forwardRef(({className:e,...r},t)=>a("tr",{ref:t,className:m("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...r}));$e.displayName="TableRow";var ze=g.forwardRef(({className:e,...r},t)=>a("th",{ref:t,className:m("h-9 px-3 text-left align-middle text-xs font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...r}));ze.displayName="TableHead";var Qr=g.forwardRef(({className:e,children:r,direction:t,onSort:n,...o},i)=>{const l=t==="asc"?Rs:t==="desc"?Ss:null;return a(ze,{ref:i,className:m("p-0",e),"aria-sort":t==="asc"?"ascending":t==="desc"?"descending":"none",...o,children:u("button",{type:"button",onClick:s(()=>n(t==="desc"?"asc":"desc"),"onClick"),className:"group flex h-9 w-full items-center gap-1 px-3 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[r,l?a(l,{className:"h-3 w-3 shrink-0",strokeWidth:2.5}):a(Fr,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-50"})]})})});Qr.displayName="SortableTableHead";var Ue=g.forwardRef(({className:e,...r},t)=>a("td",{ref:t,className:m("px-3 py-2 align-middle text-[13px] [&:has([role=checkbox])]:pr-0",e),...r}));Ue.displayName="TableCell";var _a=g.forwardRef(({className:e,...r},t)=>a("caption",{ref:t,className:m("mt-4 text-sm text-muted-foreground",e),...r}));_a.displayName="TableCaption";var yi=G.Root,wi=G.Trigger,Ni=G.Group,Ei=G.Portal,Ci=G.Sub,$a=g.forwardRef(({className:e,children:r,...t},n)=>u(G.SubTrigger,{ref:n,className:m("flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none transition-colors duration-100","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[r,a(ce,{className:"ml-auto h-4 w-4"})]}));$a.displayName=G.SubTrigger.displayName;var za=g.forwardRef(({className:e,...r},t)=>a(G.SubContent,{ref:t,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-elevation-2","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r}));za.displayName=G.SubContent.displayName;var Ua=g.forwardRef(({className:e,...r},t)=>a(G.Portal,{children:a(G.Content,{ref:t,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-elevation-2","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r})}));Ua.displayName=G.Content.displayName;var ja=g.forwardRef(({className:e,...r},t)=>a(G.Item,{ref:t,className:m("relative flex cursor-default select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none transition-colors duration-100","hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r}));ja.displayName=G.Item.displayName;var Ka=g.forwardRef(({className:e,children:r,checked:t,...n},o)=>u(G.CheckboxItem,{ref:o,className:m("relative flex cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-[13px] outline-none transition-colors duration-100","hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t??!1,...n,children:[a("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a(G.ItemIndicator,{children:a(le,{className:"h-4 w-4"})})}),r]}));Ka.displayName=G.CheckboxItem.displayName;var Va=g.forwardRef(({className:e,...r},t)=>a(G.Label,{ref:t,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...r}));Va.displayName=G.Label.displayName;var Wa=g.forwardRef(({className:e,...r},t)=>a(G.Separator,{ref:t,className:m("-mx-1 my-1 h-px bg-muted",e),...r}));Wa.displayName=G.Separator.displayName;var Ga=g.forwardRef(({icon:e,name:r,meta:t,actions:n,trailing:o,selected:i,busy:l,onOpen:d,className:h,...f},c)=>u("div",{ref:c,role:d?"button":void 0,tabIndex:d?0:void 0,onClick:d,onKeyDown:d?b=>{b.target===b.currentTarget&&(b.key!=="Enter"&&b.key!==" "||(b.preventDefault(),d()))}:void 0,"data-state":i?"selected":void 0,className:m("group/file flex min-w-0 items-center gap-3 rounded-md px-3 py-2 transition-colors",d&&"cursor-pointer",i?"bg-accent text-accent-foreground":"hover:bg-muted/60",l&&"opacity-60","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",h),...f,children:[e&&a("span",{className:"flex shrink-0 items-center",children:e}),u("div",{className:"min-w-0 flex-1",children:[a("div",{className:"truncate text-[13px]",children:r}),t&&a("div",{className:"truncate text-[11px] text-muted-foreground",children:t})]}),o&&a("div",{className:"shrink-0",children:o}),n&&a("div",{onClick:s(b=>b.stopPropagation(),"onClick"),className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity focus-within:opacity-100 group-hover/file:opacity-100 data-[state=selected]:opacity-100",children:n})]}));Ga.displayName="FileListRow";var Zr=ee.Root,ki=ee.Trigger,Ha=ee.Portal,Di=ee.Close,Jr=g.forwardRef(({className:e,...r},t)=>a(ee.Overlay,{ref:t,className:m("fixed inset-0 z-50 bg-overlay/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Jr.displayName=ee.Overlay.displayName;var or=g.forwardRef(({className:e,children:r,hideCloseButton:t,overlayClassName:n,closeOnOutsideClick:o=!1,onPointerDownOutside:i,onInteractOutside:l,...d},h)=>u(Ha,{children:[a(Jr,{className:n}),u(ee.Content,{ref:h,className:m("fixed left-[50%] top-[50%] z-50 grid w-full max-w-md translate-x-[-50%] translate-y-[-50%] gap-3 border bg-card p-4 shadow-elevation-3 duration-150 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onPointerDownOutside:s(f=>{i?.(f),o||f.preventDefault()},"onPointerDownOutside"),onInteractOutside:s(f=>{l?.(f),o||f.preventDefault()},"onInteractOutside"),...d,children:[r,!t&&u(ee.Close,{className:"absolute right-3 top-3 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a(oe,{className:"h-3.5 w-3.5"}),a("span",{className:"sr-only",children:"Close"})]})]})]}));or.displayName=ee.Content.displayName;var ir=s(({className:e,...r})=>a("div",{"data-ai-launcher-avoid":"true",className:m("flex flex-col space-y-1.5 text-center sm:text-left",e),...r}),"DialogHeader");ir.displayName="DialogHeader";var lr=s(({className:e,...r})=>a("div",{"data-ai-launcher-avoid":"true",className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r}),"DialogFooter");lr.displayName="DialogFooter";var cr=g.forwardRef(({className:e,...r},t)=>a(ee.Title,{ref:t,className:m("text-[15px] font-medium leading-none tracking-tight",e),...r}));cr.displayName=ee.Title.displayName;var dr=g.forwardRef(({className:e,...r},t)=>a(ee.Description,{ref:t,className:m("text-[13px] text-muted-foreground",e),...r}));dr.displayName=ee.Description.displayName;var qa=g.createContext(void 0),je=[];function ur(){const e=g.useContext(qa);if(!e)throw new Error("useDrawer must be used within a Drawer");return e}s(ur,"useDrawer");var et=g.createContext(void 0),Ri=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function Si(e,r){g.useEffect(()=>{if(!r)return;const t=e.current;if(!t)return;const n=document.activeElement,o=s(()=>Array.from(t.querySelectorAll(Ri)).filter(l=>l.getAttribute("aria-hidden")!=="true"&&!l.hasAttribute("inert")),"focusable");(o()[0]??t).focus();const i=s(l=>{if(l.key!=="Tab")return;const d=o();if(d.length===0){l.preventDefault(),t.focus();return}const h=d[0],f=d[d.length-1],c=document.activeElement;l.shiftKey&&(c===h||c===t)?(l.preventDefault(),f.focus()):(!l.shiftKey&&c===f||c instanceof Node&&!t.contains(c))&&(l.preventDefault(),h.focus())},"handleKeyDown");return t.addEventListener("keydown",i),()=>{t.removeEventListener("keydown",i),n?.focus?.()}},[r,e])}s(Si,"useFocusTrap");var Ya=g.forwardRef(({children:e,open:r,onOpenChange:t},n)=>{const[o,i]=g.useState(!1),l=r??o,d=g.useCallback(f=>{r===void 0&&i(f),t?.(f)},[r,t]),h=g.useMemo(()=>({open:l,setOpen:d}),[l,d]);return a(qa.Provider,{value:h,children:a("div",{ref:n,children:e})})});Ya.displayName="Drawer";var Xa=g.forwardRef(({children:e,asChild:r=!1,onClick:t,onPointerDown:n,...o},i)=>{const{setOpen:l}=ur(),d=g.useCallback(f=>{l(!0),t?.(f)},[l,t]),h=g.useCallback(f=>{l(!0),n?.(f)},[l,n]);return r&&g.isValidElement(e)?g.cloneElement(e,{...o,onClick:d,onPointerDown:h,ref:i}):a("button",{ref:i,onPointerDown:h,onClick:d,...o,children:e})});Xa.displayName="DrawerTrigger";var rt=s(({children:e})=>typeof document>"u"?null:Xs(e,document.body),"DrawerPortal");rt.displayName="DrawerPortal";var Qa=g.forwardRef(({className:e,onClick:r,...t},n)=>{const{setOpen:o}=ur(),i=g.useCallback(l=>{o(!1),r?.(l)},[o,r]);return a("div",{ref:n,className:m("fixed inset-0 z-40 animate-fade-in bg-overlay/50 transition-opacity",e),onClick:i,...t})});Qa.displayName="DrawerOverlay";var Za=g.forwardRef(({children:e,className:r,side:t="right",modal:n=!0,closeOnOverlayClick:o=!0,closeOnEscape:i=!0,overlayClassName:l,...d},h)=>{const{open:f,setOpen:c}=ur(),b=g.useRef(null),p=g.useId(),v=`${p}-title`,x=`${p}-description`,[w,E]=g.useState(!1),[C,D]=g.useState(!1),y=g.useMemo(()=>({titleId:v,descriptionId:x,registerTitle:s(()=>E(!0),"registerTitle"),registerDescription:s(()=>D(!0),"registerDescription")}),[x,v]);Si(b,f&&n);const k=g.useCallback(z=>{z.stopPropagation()},[]),S=g.useCallback(()=>{o&&c(!1)},[c,o]);if(g.useEffect(()=>{const z=Symbol("drawer"),M=s(O=>{O.key!=="Escape"||!f||O.defaultPrevented||je[je.length-1]===z&&i&&c(!1)},"handleKeyDown"),B=document.body.style.overflow;return f&&(je.push(z),document.addEventListener("keydown",M),n&&(document.body.style.overflow="hidden")),()=>{const O=je.indexOf(z);O!==-1&&je.splice(O,1),document.removeEventListener("keydown",M),n&&(document.body.style.overflow=B)}},[f,c,i,n]),!f)return null;const A={right:"h-full max-w-md w-full border-l border-border animate-slide-in-right",left:"h-full max-w-md w-full border-r border-border animate-slide-in-left",top:"w-full max-h-[80vh] border-b border-border animate-fade-in",bottom:"w-full max-h-[80vh] border-t border-border animate-fade-in"},_=t==="left"||t==="right",L=m("fixed inset-0 z-50",_?"flex":"flex flex-col",!n&&"pointer-events-none",!n&&t==="right"&&"justify-end",!n&&t==="bottom"&&"justify-end"),R=a("div",{ref:s(z=>{b.current=z,typeof h=="function"?h(z):h&&(h.current=z)},"ref"),role:"dialog","aria-modal":n,tabIndex:-1,...w?{"aria-labelledby":v}:{},...C?{"aria-describedby":x}:{},className:m("pointer-events-auto flex flex-col bg-background shadow-elevation-3 outline-none",A[t],r),onClick:k,...d,children:a(et.Provider,{value:y,children:e})}),I=a("div",{className:m("animate-fade-in bg-overlay/50 transition-opacity","flex-1",l),onClick:S});return a(rt,{children:a("div",{className:L,children:n?t==="left"||t==="top"?u(J,{children:[R,I]}):u(J,{children:[I,R]}):R})})});Za.displayName="DrawerContent";var Ja=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,"data-ai-launcher-avoid":"true",className:m("flex items-center justify-between space-y-1 border-b border-border/60 p-3",e),...r}));Ja.displayName="DrawerHeader";var en=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,"data-ai-launcher-avoid":"true",className:m("flex items-center justify-end space-x-2 border-t border-border/60 p-3",e),...r}));en.displayName="DrawerFooter";var rn=g.forwardRef(({className:e,id:r,...t},n)=>{const o=g.useContext(et);return g.useEffect(()=>o?.registerTitle(),[o]),a("h2",{ref:n,id:r??o?.titleId,className:m("text-[15px] font-medium leading-none tracking-tight",e),...t})});rn.displayName="DrawerTitle";var tn=g.forwardRef(({className:e,id:r,...t},n)=>{const o=g.useContext(et);return g.useEffect(()=>o?.registerDescription(),[o]),a("p",{ref:n,id:r??o?.descriptionId,className:m("text-[13px] text-muted-foreground",e),...t})});tn.displayName="DrawerDescription";var an=g.forwardRef(({className:e,...r},t)=>a("div",{ref:t,className:m("flex-1 overflow-y-auto p-3",e),...r}));an.displayName="DrawerBody";var nn=g.forwardRef(({children:e,asChild:r=!1,onClick:t,...n},o)=>{const{setOpen:i}=ur(),l=g.useCallback(d=>{i(!1),t?.(d)},[i,t]);return r&&g.isValidElement(e)?g.cloneElement(e,{...n,onClick:l,ref:o}):a("button",{ref:o,onClick:l,...n,children:e})});nn.displayName="DrawerClose";var sn=g.forwardRef(({className:e,orientation:r="horizontal",decorative:t=!0,...n},o)=>a(Bt.Root,{ref:o,decorative:t,orientation:r,className:m("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));sn.displayName=Bt.Root.displayName;var on=g.forwardRef(({className:e,children:r,viewportRef:t,viewportClassName:n,horizontalScroll:o=!1,type:i="scroll",...l},d)=>u(fe.Root,{ref:d,type:i,className:m("relative overflow-hidden",e),...l,children:[a(fe.Viewport,{ref:t,className:m("h-full w-full rounded-[inherit]",n),children:r}),a(mr,{}),o&&a(mr,{orientation:"horizontal"}),a(fe.Corner,{})]}));on.displayName=fe.Root.displayName;var mr=g.forwardRef(({className:e,orientation:r="vertical",...t},n)=>a(fe.ScrollAreaScrollbar,{ref:n,orientation:r,className:m("flex touch-none select-none transition-colors",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:a(fe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mr.displayName=fe.ScrollAreaScrollbar.displayName;var Ti=Be.Root,Fi=Be.Trigger,ln=g.forwardRef(({className:e,align:r="center",sideOffset:t=4,...n},o)=>a(Be.Portal,{children:a(Be.Content,{ref:o,align:r,sideOffset:t,className:m("z-50 w-64 rounded-md border bg-popover p-0 text-popover-foreground shadow-elevation-2 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ln.displayName=Be.Content.displayName;function Ai({label:e,children:r,className:t,contentClassName:n}){return u(Re,{children:[a(Se,{asChild:!0,children:a(K,{type:"button",variant:"ghost",size:"icon",className:m("h-6 w-6 shrink-0 text-muted-foreground",t),"aria-label":e,children:a(Ps,{className:"h-3.5 w-3.5"})})}),a(pe,{className:m("w-80 max-w-[calc(100vw-2rem)] text-sm leading-6",n),align:"start",children:r})]})}s(Ai,"InfoTip");var Ii={compact:{root:"min-h-8 items-start px-2 py-1.5 text-left",iconWrap:"mb-1 p-1",icon:"h-4 w-4",title:"text-xs font-normal text-muted-foreground",description:"mt-1 text-xs"},sm:{root:"py-10",iconWrap:"mb-3 p-3",icon:"h-6 w-6",title:"mb-1 text-sm font-medium",description:"mb-4 text-xs"},md:{root:"py-12",iconWrap:"mb-4 p-6",icon:"h-12 w-12",title:"mb-2 text-lg font-semibold",description:"mb-6 text-sm"}};function Mi({icon:e,title:r,description:t,action:n,secondaryAction:o,size:i="md",className:l}){const d=Ii[i];return u("div",{className:m("flex flex-col items-center justify-center px-4 text-center",d.root,l),children:[e&&a("div",{className:m("rounded-full bg-muted/50",d.iconWrap),children:a("div",{className:m("text-muted-foreground",d.icon),children:e})}),a("h3",{className:m("text-foreground",d.title),children:r}),t&&a("p",{className:m("max-w-md text-muted-foreground",d.description),children:t}),(n||o)&&u("div",{className:"flex flex-col gap-3 sm:flex-row",children:[n&&u(K,{size:i==="md"?"default":"sm",onClick:n.onClick,children:[n.icon&&a("span",{className:"mr-2",children:n.icon}),n.label]}),o&&a(K,{size:i==="md"?"default":"sm",variant:"outline",onClick:o.onClick,children:o.label})]})]})}s(Mi,"EmptyState");function Bi({items:e,homeHref:r="/",onHomeClick:t,showHome:n=!0,className:o}){const i=r||t?"a":"span";return u("nav",{"aria-label":"Breadcrumb",className:m("flex items-center space-x-1 text-sm text-muted-foreground",o),children:[n&&a(i,{...r?{href:r}:{},...t?{onClick:t}:{},className:m("flex items-center transition-colors",(r||t)&&"cursor-pointer hover:text-foreground"),"aria-label":"\u9996\u9875",children:a(Dt,{className:"h-4 w-4"})}),e.map((l,d)=>{const h=d===e.length-1,f=!h&&(!!l.href||!!l.onClick),c=f?"a":"span";return u(ys,{children:[(n||d>0)&&a(ce,{className:"h-4 w-4"}),u(c,{...l.href&&!h?{href:l.href}:{},...l.onClick&&!h?{onClick:l.onClick}:{},className:m("flex items-center",f&&"cursor-pointer transition-colors hover:text-foreground",h&&"font-medium text-foreground"),children:[l.icon&&a("span",{className:"mr-1.5",children:l.icon}),l.label]})]},d)})]})}s(Bi,"Breadcrumb");var cn=g.forwardRef(({className:e,value:r,...t},n)=>a(Pr.Root,{ref:n,value:r,className:m("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...t,children:a(Pr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r??0)}%)`}})}));cn.displayName=Pr.Root.displayName;var Pi={primary:"bg-primary",secondary:"bg-secondary-foreground",destructive:"bg-destructive",warning:"bg-warning"};function Li({loading:e,color:r="primary",height:t=2,speed:n=200,minDisplayTime:o=300,className:i}){const[l,d]=j(0),[h,f]=j(!1),c=Z(null);return X(()=>{let b,p,v;if(e)f(!0),c.current=Date.now(),d(0),b=setInterval(()=>{d(x=>x>=90?x+Math.random()*2:x>=70?x+Math.random()*5:x+Math.random()*10+5)},n);else{b&&clearInterval(b),d(100);const x=c.current?Math.max(0,o-(Date.now()-c.current)):0;p=setTimeout(()=>{v=setTimeout(()=>{f(!1),d(0),c.current=null},n)},x)}return()=>{b&&clearInterval(b),p&&clearTimeout(p),v&&clearTimeout(v)}},[e,n,o]),h?a("div",{className:m("fixed left-0 top-0 z-50 w-full bg-background/20 backdrop-blur-sm",i),style:{height:t},children:a("div",{className:m("h-full transition-all duration-300 ease-out",Pi[r],l===100?"opacity-0":"opacity-100"),style:{width:`${Math.min(l,100)}%`,transitionDuration:l===100?`${n}ms`:"300ms"}})}):null}s(Li,"TopProgressBar");function Oi({value:e,onChange:r,multiple:t=!1,files:n=[],onFilesChange:o,accept:i,maxSize:l=50*1024*1024,disabled:d=!1,showFileInfo:h=!0,className:f,hint:c="\u62D6\u62FD\u60A8\u7684\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216\u70B9\u51FB\u6D4F\u89C8",supportedFormats:b="\u652F\u6301\u683C\u5F0F\uFF1APDF\u3001Word\u3001Excel\u3001PowerPoint\u3001TXT\u3001Markdown",maxSizeText:p="\u6700\u5927\u6587\u4EF6\u5927\u5C0F\uFF1A50MB"}){const v=g.useRef(null),[x,w]=g.useState(!1),[E,C]=g.useState(""),D=s(M=>{if(M.size>l)return`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236\uFF08\u6700\u5927 ${z(l)}\uFF09`;if(i){const B=i.split(",").map(P=>P.trim()),O="."+M.name.split(".").pop()?.toLowerCase();if(!B.some(P=>P===O||P.includes("*")&&M.type.startsWith(P.split("/")[0]+"/")))return"\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F"}return null},"validateFile"),y=s(M=>{const B=D(M);if(B){C(B);return}if(C(""),r?.(M),v.current){const O=new DataTransfer;O.items.add(M),v.current.files=O.files}},"handleFileSelect"),k=s(M=>{if(!t){M[0]&&y(M[0]);return}const B=M.map(D).find(Boolean);if(B){C(B);return}C(""),o?.([...n,...M.filter(O=>!n.some(N=>N.name===O.name&&N.size===O.size&&N.lastModified===O.lastModified))])},"handleFiles"),S=s(M=>{k(Array.from(M.target.files??[])),t&&(M.target.value="")},"handleFileChange"),A=s(M=>{M.preventDefault(),d||w(!0)},"handleDragOver"),_=s(M=>{M.preventDefault(),w(!1)},"handleDragLeave"),L=s(M=>{M.preventDefault(),w(!1),!d&&k(Array.from(M.dataTransfer.files??[]))},"handleDrop"),R=s(()=>{d||v.current?.click()},"handleBrowseClick"),I=s(M=>{M.stopPropagation(),C(""),r?.(null),v.current&&(v.current.value="")},"handleRemoveFile"),z=s(M=>{if(M===0)return"0 Bytes";const B=1024,O=["Bytes","KB","MB","GB"],N=Math.floor(Math.log(M)/Math.log(B));return Math.round(M/Math.pow(B,N)*100)/100+" "+O[N]},"formatFileSize2");return u("div",{className:m("space-y-4",f),children:[u("div",{"data-file-drop-zone":"",className:m("relative cursor-pointer rounded-lg border-2 border-dashed p-8 transition-all",x&&"scale-[1.02] border-primary bg-primary/5",!x&&!d&&"border-border hover:border-primary/50",d&&"cursor-not-allowed opacity-50",E&&"border-destructive bg-destructive/5"),onDragOver:A,onDragLeave:_,onDrop:L,onClick:R,children:[a("input",{ref:v,type:"file",className:"hidden",onChange:S,disabled:d,accept:i,multiple:t}),u("div",{className:"flex flex-col items-center justify-center space-y-3 text-center",children:[a("div",{className:m("rounded-full p-4 transition-colors",E?"bg-destructive/10":"bg-muted"),children:a(Ls,{className:m("h-8 w-8",E?"text-destructive":"text-muted-foreground")})}),u("div",{className:"space-y-1",children:[a("p",{className:"text-base font-medium text-foreground",children:c}),b&&a("p",{className:"text-sm text-muted-foreground",children:b}),p&&a("p",{className:"text-xs text-muted-foreground",children:p})]}),E&&a("p",{className:"text-sm font-medium text-destructive",children:E})]})]}),h&&u(J,{children:[(t?n:e?[e]:[]).map((M,B)=>a("div",{className:"rounded-lg border border-border bg-muted/40 p-4",children:u("div",{className:"flex items-center justify-between",children:[u("div",{className:"flex items-center gap-3",children:[a("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:a(St,{className:"h-5 w-5 text-primary"})}),u("div",{className:"min-w-0 flex-1",children:[a("p",{className:"truncate font-medium text-foreground",children:M.name}),a("p",{className:"text-sm text-muted-foreground",children:z(M.size)})]})]}),!d&&a(K,{variant:"ghost",size:"sm",onClick:t?()=>o?.(n.filter((O,N)=>N!==B)):I,className:"h-8 w-8 p-0",title:"\u79FB\u9664\u6587\u4EF6",children:a(oe,{className:"h-4 w-4"})})]})},`${M.name}-${B}`)),(t?n.length===0:!e)&&a("div",{className:"text-center text-sm text-muted-foreground",children:"\u672A\u9009\u62E9\u6587\u4EF6"})]})]})}s(Oi,"FileUpload");var dn=re.Provider,tt=g.forwardRef(({className:e,...r},t)=>a(re.Viewport,{ref:t,className:m("fixed bottom-0 right-0 top-auto z-[100] flex max-h-screen w-full flex-col p-4 md:max-w-[420px]",e),...r}));tt.displayName=re.Viewport.displayName;var _i=Je("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-elevation-3 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive border-destructive bg-destructive text-destructive-foreground",success:"border-success/25 bg-success-soft text-foreground",warning:"border-warning/25 bg-warning-soft text-foreground",info:"border-info/25 bg-info-soft text-foreground"}},defaultVariants:{variant:"default"}}),at=g.forwardRef(({className:e,variant:r,...t},n)=>{const{errorId:o,severity:i,retryable:l,retryAction:d,helpUrl:h,duration:f,priority:c,deduplicationKey:b,timestamp:p,count:v,...x}=t;return a(re.Root,{ref:n,className:m(_i({variant:r}),e),duration:f,...x})});at.displayName=re.Root.displayName;var un=g.forwardRef(({className:e,...r},t)=>a(re.Action,{ref:t,className:m("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...r}));un.displayName=re.Action.displayName;var nt=g.forwardRef(({className:e,...r},t)=>a(re.Close,{ref:t,className:m("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground/70 group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive-foreground/60 group-[.destructive]:focus:ring-offset-destructive",e),"toast-close":"",...r,children:a(oe,{className:"h-4 w-4"})}));nt.displayName=re.Close.displayName;function mn(e){return r=>{r.stopPropagation(),e?.(r)}}s(mn,"allowTextSelection");var st=g.forwardRef(({className:e,onPointerDown:r,...t},n)=>a(re.Title,{ref:n,className:m("select-text text-sm font-semibold",e),onPointerDown:mn(r),...t}));st.displayName=re.Title.displayName;var ot=g.forwardRef(({className:e,onPointerDown:r,...t},n)=>a(re.Description,{ref:n,className:m("select-text text-sm opacity-90",e),onPointerDown:mn(r),...t}));ot.displayName=re.Description.displayName;var $i=0,ge=[],it=new Set;function fn(){it.forEach(e=>e())}s(fn,"emitChange");function zi(e){ge=ge.findIndex(t=>t.id===e.id)===-1?[...ge,e]:ge.map(t=>t.id===e.id?e:t),fn()}s(zi,"setOverride");function Ui(e){ge=ge.filter(r=>r.id!==e),fn()}s(Ui,"removeOverride");function ji(e){return it.add(e),()=>it.delete(e)}s(ji,"subscribe");function Ki(){return ge.at(-1)??null}s(Ki,"getSnapshot");function Vi({bottomOffset:e}){const r=g.useRef(0);return r.current===0&&(r.current=++$i),g.useLayoutEffect(()=>{const t=r.current;return()=>Ui(t)},[]),g.useLayoutEffect(()=>{zi({id:r.current,bottomOffset:Math.max(0,e)})},[e]),null}s(Vi,"ToastViewportOverride");function Wi(){return g.useSyncExternalStore(ji,Ki,()=>null)}s(Wi,"useToastViewportOverride");var Gi=3,Hi=300,qi=3e3,Yi=0,Xi=5e3,lt=0;function Qi(){return lt=(lt+1)%Number.MAX_SAFE_INTEGER,lt.toString()}s(Qi,"genId");var ct=new Map;function Zi(e){if(e.priority!==void 0)return e.priority;let t={critical:1e3,error:500,warning:300,success:200,info:100}[e.severity]??100;return e.retryable&&(t+=50),e.helpUrl&&(t+=25),t}s(Zi,"calculateToastPriority");function hn(e){const r=typeof e.title=="string"?e.title:"",t=typeof e.description=="string"?e.description:"";return`${e.severity??"info"}:${r}:${t}`.toLowerCase()}s(hn,"generateDeduplicationKey");function Ji(e,r){const t=e.deduplicationKey||hn(e),n=Date.now();return r.find(o=>!o.deduplicationKey||o.deduplicationKey!==t?!1:n-(o.timestamp??0)<Xi)??null}s(Ji,"findDuplicateToast");function el(e){const r=(e.count??1)+1,t=typeof e.description=="string"?`${e.description}${r>2?` (${r}\u6B21)`:" (\u91CD\u590D)"}`:e.description;return{...e,count:r,description:t,timestamp:Date.now()}}s(el,"updateDuplicateToast");var pn=s(e=>{if(ct.has(e))return;const r=setTimeout(()=>{ct.delete(e),Ke({type:"REMOVE_TOAST",toastId:e})},Hi);ct.set(e,r)},"addToRemoveQueue"),rl=s((e,r)=>{switch(r.type){case"ADD_TOAST":{const t=Ji(r.toast,e.toasts);if(t){const i=el(t);return{...e,toasts:e.toasts.map(l=>l.id===t.id?i:l)}}const o=[{...r.toast,priority:Zi(r.toast),deduplicationKey:r.toast.deduplicationKey??hn(r.toast),timestamp:Date.now(),count:1},...e.toasts].sort((i,l)=>(l.priority??0)-(i.priority??0)).slice(0,Gi);return{...e,toasts:o}}case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(t=>t.id===r.toast.id?{...t,...r.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=r;return t?pn(t):e.toasts.forEach(n=>{pn(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===t||t===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return r.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(t=>t.id!==r.toastId)}}},"reducer"),fr=[],hr={toasts:[]};function Ke(e){hr=rl(hr,e),fr.forEach(r=>{r(hr)})}s(Ke,"dispatch");function te({...e}){const r=Qi(),t=s(o=>Ke({type:"UPDATE_TOAST",toast:{...o,id:r}}),"update"),n=s(()=>Ke({type:"DISMISS_TOAST",toastId:r}),"dismiss");return Ke({type:"ADD_TOAST",toast:{...e,duration:e.duration??qi,id:r,open:!0,onOpenChange:s(o=>{o||n()},"onOpenChange")}}),{id:r,dismiss:n,update:t}}s(te,"toast");function gn(){const[e,r]=g.useState(hr);return g.useEffect(()=>(fr.push(r),()=>{const t=fr.indexOf(r);t>-1&&fr.splice(t,1)}),[e]),{...e,toast:te,dismiss:s(t=>Ke({type:"DISMISS_TOAST",...t!==void 0&&{toastId:t}}),"dismiss")}}s(gn,"useToast");function pr(e){const r=e.severity??"error",t=r==="critical",n={variant:"destructive",title:e.title??(t?"\u4E25\u91CD\u9519\u8BEF":"\u9519\u8BEF"),description:e.description,severity:r,duration:t?Yi:e.duration??8e3};return e.errorId&&(n.errorId=e.errorId),e.retryable!==void 0&&(n.retryable=e.retryable),e.retryAction&&(n.retryAction=e.retryAction),e.helpUrl&&(n.helpUrl=e.helpUrl),e.deduplicationKey&&(n.deduplicationKey=e.deduplicationKey),te(n)}s(pr,"showErrorToast");function vn(e){const r={variant:"warning",title:e.title??"\u8B66\u544A",description:e.description,severity:"warning",duration:e.duration??6e3};return e.helpUrl&&(r.helpUrl=e.helpUrl),e.deduplicationKey&&(r.deduplicationKey=e.deduplicationKey),te(r)}s(vn,"showWarningToast");function bn(e){const r={variant:"default",title:e.title??"\u4FE1\u606F",description:e.description,severity:"info",duration:e.duration??4e3};return e.deduplicationKey&&(r.deduplicationKey=e.deduplicationKey),te(r)}s(bn,"showInfoToast");function gr(e){const r={variant:"success",title:e.title??"\u6210\u529F",description:e.description,severity:"success",duration:e.duration??4e3};return e.deduplicationKey&&(r.deduplicationKey=e.deduplicationKey),te(r)}s(gr,"showSuccessToast");function tl({id:e,title:r,description:t,action:n,duration:o=0,timestamp:i,dismiss:l,onMouseEnter:d,onMouseLeave:h,...f}){const c=Z(null),b=Z(0),p=Z(o),v=Z(!1),x=V(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),w=V(()=>{x(),!(p.current<=0||p.current===1/0)&&(b.current=Date.now(),c.current=setTimeout(()=>{c.current=null,l(e)},p.current))},[x,l,e]);return X(()=>(p.current=o,v.current||w(),x),[x,o,w,i]),u(at,{...f,duration:1/0,onMouseEnter:s(D=>{v.current=!0,c.current&&(p.current=Math.max(0,p.current-(Date.now()-b.current)),x()),d?.(D)},"handleMouseEnter"),onMouseLeave:s(D=>{v.current=!1,w(),h?.(D)},"handleMouseLeave"),children:[u("div",{className:"grid gap-1",children:[r&&a(st,{children:r}),t&&a(ot,{children:t})]}),n,a(nt,{})]})}s(tl,"ManagedToast");function al(){const{toasts:e,dismiss:r}=gn(),t=Z(r),n=Wi();t.current=r;const o=V(l=>{t.current(l)},[]),i=V(({id:l,title:d,description:h,action:f,...c})=>a(tl,{id:l,title:d,description:h,action:f,dismiss:o,...c},l),[o]);return u(dn,{children:[e.map(i),a(tt,{style:{bottom:n?.bottomOffset??0}})]})}s(al,"Toaster");function xn(){return{success:s((e,r)=>te({title:e,description:r,variant:"success",severity:"success",duration:4e3}),"success"),error:s((e,r)=>te({title:e,description:r,variant:"destructive",severity:"error",duration:6e3}),"error"),warning:s((e,r)=>te({title:e,description:r,variant:"warning",severity:"warning",duration:5e3}),"warning"),info:s((e,r)=>te({title:e,description:r,variant:"info",severity:"info",duration:4e3}),"info"),promise:s(async(e,r)=>{const t=te({title:r.loading,duration:0});try{const n=await e;t.dismiss();const o=typeof r.success=="function"?r.success(n):r.success;return te({title:o,variant:"success",severity:"success"}),n}catch(n){t.dismiss();const o=typeof r.error=="function"?r.error(n):r.error;throw te({title:o,description:n instanceof Error?n.message:void 0,variant:"destructive",severity:"error"}),n}},"promise")}}s(xn,"createToastHelpers");var nl=xn(),sl=16;function dt(e,r,t){return Math.min(t,Math.max(r,e))}s(dt,"clamp");function ol(e){try{const r=Number(localStorage.getItem(e));return Number.isFinite(r)&&r>0?r:null}catch{return null}}s(ol,"readStored");function yn(e,r){try{localStorage.setItem(e,String(Math.round(r)))}catch{}}s(yn,"writeStored");function il({min:e,max:r,initial:t,storageKey:n,edge:o="right"}){const i=o==="right"?1:-1,[l,d]=j(()=>dt(ol(n)??t,e,r)),[h,f]=j(!1),c=Z({x:0,width:l});X(()=>{if(!h)return;const v=s(w=>{d(dt(c.current.width+i*(w.clientX-c.current.x),e,r))},"move"),x=s(()=>{f(!1),d(w=>(yn(n,w),w))},"end");return document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",v),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),window.addEventListener("blur",x),()=>{document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),window.removeEventListener("blur",x)}},[h,e,r,n,i]);const b=V(v=>{v.button===0&&(v.preventDefault(),v.currentTarget.setPointerCapture?.(v.pointerId),c.current={x:v.clientX,width:l},f(!0))},[l]),p=V(v=>{if(v.key!=="ArrowLeft"&&v.key!=="ArrowRight")return;v.preventDefault();const x=sl*(v.shiftKey?5:1)*i;d(w=>{const E=dt(w+(v.key==="ArrowRight"?x:-x),e,r);return yn(n,E),E})},[e,r,n,i]);return{width:l,resizing:h,separatorProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":e,"aria-valuemax":r,"aria-valuenow":Math.round(l),tabIndex:0,onPointerDown:b,onKeyDown:p}}}s(il,"useResizableWidth");function ll({separator:e,edge:r,resizing:t,label:n,className:o}){return a("div",{...e,"aria-label":n,title:n,className:m("absolute top-0 z-30 hidden h-full w-3 cursor-col-resize focus-visible:outline-none md:block","after:absolute after:top-0 after:h-full after:w-px after:bg-transparent","hover:after:bg-primary/30 focus-visible:after:bg-primary/50",r==="right"?"-right-1.5 after:right-1.5":"-left-1.5 after:left-1.5",t&&"after:bg-primary/50",o)})}s(ll,"ResizeHandle");var cl={default:{icon:$s,iconClassName:"h-5 w-5 text-info",confirmVariant:"default"},destructive:{icon:Ar,iconClassName:"h-5 w-5 text-destructive",confirmVariant:"destructive"},warning:{icon:_s,iconClassName:"h-5 w-5 text-warning",confirmVariant:"default"},info:{icon:Os,iconClassName:"h-5 w-5 text-success",confirmVariant:"success"}};function wn({open:e,onOpenChange:r,title:t,description:n,confirmText:o,cancelText:i,hideCancel:l=!1,alternateText:d,variant:h="default",onConfirm:f,onAlternate:c,onCancel:b,loading:p=!1,texts:v={}}){const x=cl[h],w=x.icon,C={...{title:"Confirm Action",confirm:"Confirm",cancel:"Cancel",processing:"Processing..."},...v},D=s(async()=>{f&&await f(),r(!1)},"handleConfirm"),y=s(()=>{c&&c(),r(!1)},"handleAlternate"),k=s(()=>{b&&b(),r(!1)},"handleCancel");return a(Zr,{open:e,onOpenChange:r,children:u(or,{className:"sm:max-w-md",children:[u(ir,{children:[u(cr,{className:"flex items-center gap-3",children:[a(w,{className:m(x.iconClassName)}),t||C.title]}),n&&a(dr,{className:"pt-2 text-left",children:n})]}),u(lr,{className:"flex-row justify-end gap-2 pt-4",children:[!l&&a(K,{variant:"outline",onClick:k,disabled:p,children:i||C.cancel}),d&&a(K,{variant:"outline",onClick:y,disabled:p,children:d}),a(K,{variant:x.confirmVariant,onClick:D,disabled:p,className:"min-w-20",children:p?u("div",{className:"flex items-center gap-2",children:[a("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),C.processing]}):o||C.confirm})]})]})})}s(wn,"ConfirmDialog");function dl(){const[e,r]=g.useState({open:!1,props:{}}),t=g.useCallback(l=>new Promise(d=>{const{onConfirm:h,onAlternate:f,onCancel:c,...b}=l;r({open:!0,props:{...b,onConfirm:s(async()=>{h&&await h(),d("confirm")},"onConfirm"),onAlternate:s(()=>{f&&f(),d("alternate")},"onAlternate"),onCancel:s(()=>{c&&c(),d("cancel")},"onCancel")},resolve:d})}),[]),n=g.useCallback(async l=>await t(l)==="confirm",[t]),o=g.useCallback(l=>{!l&&e.resolve&&e.resolve("cancel"),r(d=>({...d,open:l}))},[e.resolve]),i=g.useCallback(()=>a(wn,{...e.props,open:e.open,onOpenChange:o}),[e,o]);return{confirm:n,choose:t,ConfirmDialog:i}}s(dl,"useConfirm");function Nn({open:e,onOpenChange:r,title:t,description:n,label:o,placeholder:i,defaultValue:l="",confirmText:d="OK",cancelText:h="Cancel",allowEmpty:f=!1,onConfirm:c,onCancel:b}){const[p,v]=g.useState(l);g.useEffect(()=>{e&&v(l)},[e,l]);const x=p.trim(),w=s(()=>{!x&&!f||(c?.(x),r(!1))},"submit"),E=s(()=>{b?.(),r(!1)},"cancel");return a(Zr,{open:e,onOpenChange:s(C=>C?void 0:E(),"onOpenChange"),children:u(or,{className:"sm:max-w-md",children:[u(ir,{children:[a(cr,{children:t}),n&&a(dr,{className:"pt-1 text-left",children:n})]}),u("div",{className:"space-y-2",children:[o&&a(Te,{htmlFor:"prompt-dialog-value",children:o}),a(Fe,{id:"prompt-dialog-value",autoFocus:!0,value:p,placeholder:i,onChange:s(C=>v(C.target.value),"onChange"),onKeyDown:s(C=>{C.key==="Enter"&&(C.preventDefault(),w())},"onKeyDown")})]}),u(lr,{className:"flex-row justify-end gap-2 pt-4",children:[a(K,{variant:"outline",onClick:E,children:h}),a(K,{onClick:w,disabled:!x&&!f,className:"min-w-20",children:d})]})]})})}s(Nn,"PromptDialog");function ul(){const[e,r]=g.useState({open:!1,request:{}}),t=g.useRef(null),n=g.useCallback(l=>new Promise(d=>{t.current=d,r({open:!0,request:l})}),[]),o=g.useCallback(l=>{t.current?.(l),t.current=null,r(d=>({...d,open:!1}))},[]),i=g.useCallback(()=>a(Nn,{...e.request,open:e.open,onOpenChange:s(l=>{l||o(null)},"onOpenChange"),onConfirm:o,onCancel:s(()=>o(null),"onCancel")}),[e,o]);return{prompt:n,PromptDialog:i}}s(ul,"usePrompt");var ut;function mt(){if(!tr.isSupported)throw new Error("Trusted HTML sanitization requires a DOM")}s(mt,"ensureDomPurify");function ml(e){return mt(),tr.sanitize(e,{RETURN_TRUSTED_TYPE:!0,USE_PROFILES:{html:!0,mathMl:!0},FORBID_TAGS:["script","iframe","object","embed","form","base"],FORBID_ATTR:["srcdoc","formaction"]})}s(ml,"sanitizeTrustedHtml");function fl(e){return mt(),tr.sanitize(e,{RETURN_TRUSTED_TYPE:!0,USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","foreignObject"],FORBID_ATTR:["srcdoc","formaction"]})}s(fl,"sanitizeTrustedSvg");function hl(e){return mt(),tr.sanitize(e,{RETURN_TRUSTED_TYPE:!0,USE_PROFILES:{svg:!0,svgFilters:!0,html:!0},ADD_TAGS:["foreignObject"],HTML_INTEGRATION_POINTS:{foreignobject:!0},FORBID_TAGS:["script","iframe","object","embed","form","base"],FORBID_ATTR:["srcdoc","formaction"]})}s(hl,"sanitizeTrustedMermaidSvg");function En(e){if(!e.hasAttribute("sandbox"))throw new Error("srcdoc requires a sandboxed iframe");const r=new Set(e.sandbox.value.split(/\s+/).filter(Boolean));if(r.has("allow-scripts")&&r.has("allow-same-origin"))throw new Error("sandboxed srcdoc cannot combine scripts with same-origin")}s(En,"assertScriptlessSandbox");function Cn(e){const r=globalThis.trustedTypes;return r?(ut??(ut=r.createPolicy("tego-sandboxed-srcdoc",{createHTML:s(t=>t,"createHTML")})),ut.createHTML(e)):e}s(Cn,"sandboxedHtml");function pl(e,r){En(e),e.srcdoc=Cn(r)}s(pl,"setSandboxedFrameSrcDoc");function gl(e,r){const t=e.defaultView?.frameElement;if(!t||t.tagName!=="IFRAME")throw new Error("sandboxed HTML requires an iframe document");return En(t),Cn(r)}s(gl,"sandboxedFrameHtml");var vl=/\*\*([^\s*](?:[^*\n]*?[^\s*])?)\*\*/g,kn=/\p{P}/u,Dn=/[\p{L}\p{N}]/u;function bl(e,r,t,n){const o=e[r-1]??"",i=e[t]??"",l=kn.test(n[0]??"")&&Dn.test(o),d=kn.test(n.at(-1)??"")&&Dn.test(i);return l||d}s(bl,"isCjkFlankingFailure");function xl(e){return e.type==="text"?!0:e.type==="strong"&&(e.children??[]).every(r=>r.type==="text")}s(xl,"isRunNode");function yl(e){let r="";const t=new Set;for(const l of e)if(l.type==="text")r+=l.value??"";else{const d=(l.children??[]).map(h=>h.value??"").join("");t.add(`${r.length}:${r.length+d.length+4}`),r+=`**${d}**`}const n=[];let o=0,i=!1;for(const l of r.matchAll(vl)){const d=l.index,h=d+l[0].length,f=l[1],c=t.has(`${d}:${h}`);!c&&!bl(r,d,h,f)||(c||(i=!0),d>o&&n.push({type:"text",value:r.slice(o,d)}),n.push({type:"strong",children:[{type:"text",value:f}]}),o=h)}return i?(o<r.length&&n.push({type:"text",value:r.slice(o)}),n):null}s(yl,"repairRun");function Rn(e){if(!e.children)return;const r=[];let t=[];const n=s(()=>{const i=t.some(l=>l.type==="text"&&l.value?.includes("**"))?yl(t):null;r.push(...i??t),t=[]},"flush");for(const o of e.children){if(xl(o)){t.push(o);continue}n(),Rn(o),r.push(o)}n(),e.children=r}s(Rn,"visit");function wl(){return e=>{Rn(e)}}s(wl,"remarkCjkEmphasis");var ft=null,ht=null,pt=null,gt=null;function Nl(){return ht??(ht=import("remark-math").then(e=>e.default).catch(e=>(console.warn("[MarkdownRenderer] remark-math disabled:",e),null))),ht}s(Nl,"loadRemarkMathPlugin");function El(){return pt??(pt=Promise.all([import("rehype-katex"),import("katex/dist/katex.min.css")]).then(([e])=>e.default).catch(e=>(console.warn("[MarkdownRenderer] rehype-katex disabled:",e),null))),pt}s(El,"loadRehypeKatexPlugin");var Sn={startOnLoad:!1,theme:"default",securityLevel:"loose",fontFamily:"inherit"};function Cl(){return gt??(gt=import("mermaid").then(e=>(e.default.initialize(Sn),e.default)).catch(e=>(console.warn("[MarkdownRenderer] mermaid disabled:",e),null))),gt}s(Cl,"loadMermaid");function kl(){try{return new RegExp("(?<=a)b"),!0}catch{return!1}}s(kl,"supportsRegexLookbehind");function Dl(){return kl()?(ft??(ft=import("remark-gfm").then(e=>e.default).catch(e=>(console.warn("[MarkdownRenderer] remark-gfm disabled:",e),null))),ft):Promise.resolve(null)}s(Dl,"loadRemarkGfmPlugin");async function Rl(e){const r=globalThis.navigator?.clipboard;if(r?.writeText)try{return await r.writeText(e),!0}catch{}return Sl(e)}s(Rl,"writeTextToClipboard");function Sl(e){const r=globalThis.document;if(!r?.body||typeof r.execCommand!="function")return!1;const t=r.createElement("textarea"),n=r.activeElement,o=r.getSelection?.(),i=o&&o.rangeCount>0?o.getRangeAt(0):null;t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",t.style.top="0",t.style.opacity="0",r.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,t.value.length);try{return r.execCommand("copy")}catch{return!1}finally{t.remove(),i&&o&&(o.removeAllRanges(),o.addRange(i)),n?.focus?.()}}s(Sl,"copyTextWithSelectionFallback");function Tn(e,r){return r>0&&e[r-1]==="\\"}s(Tn,"isEscaped");function Tl(e,r){return e[r]==="$"&&e[r-1]!=="$"&&e[r+1]!=="$"&&!Tn(e,r)}s(Tl,"isSingleDollarDelimiter");function Fn(e,r){for(let t=r;t<e.length;t+=1)if(Tl(e,t))return t;return-1}s(Fn,"findSingleDollarDelimiter");function An(e,r,t={}){const{allowNewlines:n=!1,allowInnerDollars:o=!1}=t;let i="",l=0;for(;l<e.length;){const d=Fn(e,l);if(d===-1)return i+e.slice(l);const h=Fn(e,d+1);if(h===-1)return i+e.slice(l);const f=e.slice(d+1,h);if(!n&&f.includes(`
|
|
2
|
+
`)||!o&&f.includes("$")){i+=e.slice(l,d+1),l=d+1;continue}const c=e.slice(d,h+1);i+=e.slice(l,d),i+=r(c,f),l=h+1}return i}s(An,"replaceSingleDollarDelimited");function Ve(e,r,t){return e.replace(r,n=>(t.push(n),`<<PROTECTED_${t.length-1}>>`))}s(Ve,"protectPattern");function Fl(e){const r=/(```[\S\s]*?```|`.*?`)|\\\[([\S\s]*?[^\\])\\]|\\\((.*?)\\\)/g;return e.replace(r,(t,n,o,i)=>n!==void 0?n:o!==void 0?`$$${o}$$`:i!==void 0?`$${i}$`:t)}s(Fl,"convertLatexDelimiters");function Al(e){const r=s(o=>{let i="";for(let l=0;l<o.length;l+=1)i+=o[l]==="|"&&!Tn(o,l)?"\\vert{}":o[l];return i},"replaceUnescapedPipes"),t=[];let n=e.replace(/(```[\S\s]*?```|`[^\n`]*`)/g,o=>(t.push(o),`<<CODE_${t.length-1}>>`));return n=n.replace(/\$\$([\S\s]*?)\$\$/g,(o,i)=>`$$${r(i)}$$`),n=An(n,(o,i)=>`$${r(i)}$`),n=n.replace(/<<CODE_(\d+)>>/g,(o,i)=>t[Number.parseInt(i)]||""),n}s(Al,"escapeLatexPipes");function Il(e){const r=[];let t=Ve(e,/(```[\S\s]*?```|`[^\n`]*`)/g,r);t=Ve(t,/\$\$[\S\s]*?\$\$/g,r),t=An(t,(l,d)=>d.includes("\\")?(r.push(l),`<<PROTECTED_${r.length-1}>>`):l,{allowNewlines:!0,allowInnerDollars:!0}),t=Ve(t,/\$\d+\$/g,r),t=Ve(t,/\$-?\d+(?:,-?\d+)+\$/g,r),t=Ve(t,/\\\[[\S\s]*?\\]|\\\(.*?\\\)/g,r);const n=/^(\d{1,3}(?:,\d{3})*(?:\.\d+)?(?:-\d{1,3}(?:,\d{3})*(?:\.\d+)?)?\+?)/;let o="",i=0;for(;i<t.length;){if(t[i]!=="$"||t[i-1]==="$"){o+=t[i],i+=1;continue}const d=n.exec(t.slice(i+1))?.[1];if(!d||t[i+1+d.length]==="$"){o+=t[i],i+=1;continue}o+=`\\$${d}`,i+=1+d.length}return t=o,t=t.replace(/<<PROTECTED_(\d+)>>/g,(l,d)=>r[Number.parseInt(d)]||""),t}s(Il,"escapeCurrencyDollars");function Ml(e){let r=e;return r=Il(r),r=Fl(r),r=Al(r),r}s(Ml,"preprocessLaTeX");function Bl(e,r){return e?r?Ml(e):e:""}s(Bl,"preprocessMarkdownContent");var In=vs({}),Pl=s(()=>xs(In),"useMarkdownContext"),Ll=0,Mn=we(({code:e})=>{const r=Z(null),[t,n]=j(""),[o,i]=j(null),l=ha(),d=l.startsWith("next:")?l:"";return X(()=>{let h=!1;return s(async()=>{if(!e.trim())return;const c=`mermaid-${Date.now().toString(36)}-${(Ll++).toString(36)}`;try{const b=await Cl();if(h)return;if(!b){i("Mermaid failed to load");return}if(b.initialize({...Sn,theme:"base",themeVariables:Co(ma(),document.documentElement.classList.contains("dark"))}),!await b.parse(e)){h||i("Invalid Mermaid syntax");return}const{svg:v}=await b.render(c,e);if(h)return;n(v),i(null)}catch(b){if(h)return;console.error("[Mermaid] Render error:",b),i(b instanceof Error?b.message:"Failed to render diagram")}},"renderDiagram")(),()=>{h=!0}},[e,d]),o?u("div",{className:"my-3 rounded-lg border border-destructive/30 bg-destructive/10 p-4",children:[u("p",{className:"text-sm text-destructive",children:["Mermaid \u6E32\u67D3\u9519\u8BEF: ",o]}),a("pre",{className:"mt-2 overflow-x-auto text-xs text-muted-foreground",children:e})]}):a("div",{ref:r,className:"my-4 flex justify-center overflow-x-auto rounded-lg border border-border bg-card p-4",dangerouslySetInnerHTML:{__html:hl(t)}})});Mn.displayName="MermaidDiagram";var Bn=we(({children:e,className:r,language:t,showCopyButton:n=!0})=>{const[o,i]=j(!1),{enableMermaid:l}=Pl(),d=V(()=>{const h=String(e).replace(/\n$/,"");Rl(h).then(f=>{f&&(i(!0),setTimeout(()=>i(!1),2e3))})},[e]);return t==="mermaid"&&l?a(Mn,{code:String(e).replace(/\n$/,"")}):u("div",{className:"group relative my-3 rounded-lg border border-border bg-muted",children:[u("div",{className:"flex items-center justify-between border-b border-border/60 px-4 py-2",children:[a("span",{className:"text-xs font-medium text-muted-foreground",children:t||"code"}),n&&a("button",{type:"button",onClick:d,className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground",children:o?u(J,{children:[a(le,{className:"h-3.5 w-3.5"}),a("span",{children:"\u5DF2\u590D\u5236"})]}):u(J,{children:[a(Ts,{className:"h-3.5 w-3.5"}),a("span",{children:"\u590D\u5236"})]})})]}),a("pre",{className:"overflow-x-auto p-4",children:a("code",{className:m("text-sm leading-relaxed text-foreground",r),children:e})})]})});Bn.displayName="CodeBlock";var Pn=we(({children:e,className:r,fontSize:t=14,headerMultiple:n=.25,marginMultiple:o=1,lineHeight:i=1.6,borderRadius:l=8})=>a("article",{className:m("markdown-typography w-full max-w-none",r),style:{"--md-font-size":`${t}px`,"--md-header-multiple":n,"--md-margin-multiple":o,"--md-line-height":i,"--md-border-radius":`${l}px`},children:e}));Pn.displayName="Typography";var Ol=s(({showCopyButton:e,transformImageSrc:r})=>Y(()=>({h1:s(({children:t})=>a("h1",{className:"mb-4 mt-6 border-b border-border pb-2 text-2xl font-bold text-foreground first:mt-0",children:t}),"h1"),h2:s(({children:t})=>a("h2",{className:"mb-3 mt-5 border-b border-border/60 pb-1.5 text-xl font-semibold text-foreground first:mt-0",children:t}),"h2"),h3:s(({children:t})=>a("h3",{className:"mb-2 mt-4 text-lg font-semibold text-foreground first:mt-0",children:t}),"h3"),h4:s(({children:t})=>a("h4",{className:"mb-2 mt-3 text-base font-semibold text-foreground first:mt-0",children:t}),"h4"),h5:s(({children:t})=>a("h5",{className:"mb-1.5 mt-2.5 text-sm font-semibold text-foreground first:mt-0",children:t}),"h5"),h6:s(({children:t})=>a("h6",{className:"mb-1 mt-2 text-sm font-medium text-foreground first:mt-0",children:t}),"h6"),p:s(({children:t,...n})=>Q.isValidElement(t)&&(t.type==="img"||t.type==="video")?t:a("p",{className:"mb-3 leading-7 text-foreground last:mb-0",...n,children:t}),"p"),ul:s(({children:t})=>a("ul",{className:"mb-3 ml-6 list-disc space-y-1.5 text-foreground last:mb-0",children:t}),"ul"),ol:s(({children:t})=>a("ol",{className:"mb-3 ml-6 list-decimal space-y-1.5 text-foreground last:mb-0",children:t}),"ol"),li:s(({children:t})=>a("li",{className:"leading-7",children:t}),"li"),blockquote:s(({children:t})=>a("blockquote",{className:"my-4 border-l-[3px] border-border py-1 pl-4 pr-3 text-muted-foreground",children:t}),"blockquote"),code:s(({children:t,className:n,...o})=>a("code",{className:m("rounded bg-muted px-1.5 py-0.5 font-mono text-[0.9em] text-foreground",n),...o,children:t}),"code"),pre:s(({children:t})=>{const n=Q.Children.only(t);if(!Q.isValidElement(n))return a("pre",{children:t});const o=n.props,i=/language-(\w+)/.exec(o.className||"");return a(Bn,{className:o.className,language:i?.[1],showCopyButton:e,children:o.children})},"pre"),table:s(({children:t})=>a("div",{className:"my-4 overflow-x-auto rounded-lg border border-border",children:a("table",{className:"min-w-full divide-y divide-border",children:t})}),"table"),thead:s(({children:t})=>a("thead",{className:"bg-muted",children:t}),"thead"),tbody:s(({children:t})=>a("tbody",{className:"divide-y divide-border",children:t}),"tbody"),tr:s(({children:t})=>a("tr",{className:"transition-colors hover:bg-muted/50",children:t}),"tr"),th:s(({children:t})=>a("th",{className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:t}),"th"),td:s(({children:t})=>a("td",{className:"px-4 py-3 text-sm text-foreground",children:t}),"td"),a:s(({href:t,children:n})=>a("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline decoration-primary/40 underline-offset-2 transition-colors hover:decoration-primary",children:n}),"a"),strong:s(({children:t})=>a("strong",{className:"font-semibold text-foreground",children:t}),"strong"),em:s(({children:t})=>a("em",{className:"italic",children:t}),"em"),del:s(({children:t})=>a("del",{className:"text-muted-foreground line-through",children:t}),"del"),hr:s(()=>a("hr",{className:"my-6 border-border"}),"hr"),img:s(({src:t,alt:n})=>a("img",{src:typeof t=="string"&&r?r(t):t,alt:n,className:"my-4 max-w-full rounded-lg shadow-sm",loading:"lazy"}),"img")}),[e,r]),"useMarkdownComponents"),vt=s(e=>{const[r,t]=j(null);return X(()=>{if(!e)return;let n=!1;return e().then(o=>{n||t(o?()=>o:null)}),()=>{n=!0}},[e]),r},"useLazyPlugin"),_l=s((e,r,t=[])=>{const n=vt(Dl),o=vt(e?Nl:null);return Y(()=>{const i=[];return n&&i.push(n),o&&i.push(o),i.push(wl),r==="chat"&&i.push(Zs),[...i,...t]},[r,t,n,o])},"useRemarkPlugins"),$l=s((e,r=[])=>{const t=vt(e?El:null);return Y(()=>{const n=[];return t&&n.push(t),[...n,...r]},[t,r])},"useRehypePlugins"),zl=s(e=>Qs.lexer(e).map(t=>t.raw),"parseMarkdownIntoBlocks"),Ln=we(({children:e,components:r,remarkPlugins:t,rehypePlugins:n})=>a(Pt,{components:r,remarkPlugins:t,rehypePlugins:n,children:e}),(e,r)=>e.children===r.children);Ln.displayName="StreamdownBlock";var On=we(({children:e,components:r,remarkPlugins:t,rehypePlugins:n})=>{const o=bs(),i=Y(()=>zl(e||""),[e]);return a("div",{className:"markdown-stream",children:i.map((l,d)=>a(Ln,{components:r,remarkPlugins:t,rehypePlugins:n,children:l},`${o}-block_${d}`))})});On.displayName="StreamdownRender";var _n=we(({children:e="",className:r,animated:t=!1,enableLatex:n=!0,enableMermaid:o=!0,enableStream:i=!0,showCopyButton:l=!0,variant:d="chat",fontSize:h=d==="chat"?14:16,headerMultiple:f=d==="chat"?.25:1,marginMultiple:c=d==="chat"?1:2,lineHeight:b=d==="chat"?1.6:1.8,borderRadius:p=8,components:v,remarkPlugins:x=[],rehypePlugins:w=[],transformImageSrc:E})=>{const C=Y(()=>({animated:t,enableLatex:n,enableMermaid:o,showCopyButton:l,variant:d,transformImageSrc:E}),[t,n,o,l,d,E]),D=Ol(C),y=Y(()=>({...D,...v}),[D,v]),k=_l(n,d,x),S=$l(n,w),A=Y(()=>Bl(e,n),[e,n]),_=i&&t;return a(In.Provider,{value:C,children:a(Pn,{className:m("markdown-content",d==="chat"&&"chat-markdown",r),fontSize:h,headerMultiple:f,marginMultiple:c,lineHeight:b,borderRadius:p,children:_?a(On,{components:y,remarkPlugins:k,rehypePlugins:S,children:A}):a(Pt,{components:y,remarkPlugins:k,rehypePlugins:S,children:A})})})});_n.displayName="Markdown";var Ul=_n,$n=(e=>(e.INFO="info",e.WARNING="warning",e.ERROR="error",e.CRITICAL="critical",e))($n||{}),zn=(e=>(e.NETWORK="network",e.AUTH="auth",e.BUSINESS="business",e.VALIDATION="validation",e.SYSTEM="system",e.USER="user",e.EXTERNAL="external",e.UNKNOWN="unknown",e))(zn||{}),Un=(e=>(e.NONE="none",e.RETRY="retry",e.REFRESH="refresh",e.REAUTH="reauth",e.CONTACT_SUPPORT="contact_support",e.AUTO_RECOVER="auto_recover",e))(Un||{}),jn=(e=>(e.TOAST="toast",e.MODAL="modal",e.INLINE="inline",e.PAGE="page",e.SILENT="silent",e))(jn||{}),vr=class ae extends Error{static{s(this,"_AppError")}constructor(r){super(r.message),q(this,"id"),q(this,"code"),q(this,"category"),q(this,"severity"),q(this,"timestamp"),q(this,"source"),q(this,"context"),q(this,"originalError"),q(this,"userMessage"),q(this,"technicalDetails"),q(this,"recoveryStrategy"),q(this,"displayMode"),q(this,"retryable"),q(this,"retryCount"),q(this,"maxRetries"),q(this,"requiresUserAction"),q(this,"helpUrl"),q(this,"tags"),this.name="AppError",this.id=this.generateErrorId(),this.code=r.code,this.message=r.message,this.category=r.category,this.severity=r.severity??"error",this.timestamp=new Date,r.source!==void 0&&(this.source=r.source),r.context!==void 0&&(this.context=r.context),r.originalError!==void 0&&(this.originalError=r.originalError),r.userMessage!==void 0&&(this.userMessage=r.userMessage),r.technicalDetails!==void 0&&(this.technicalDetails=r.technicalDetails),r.recoveryStrategy!==void 0&&(this.recoveryStrategy=r.recoveryStrategy),r.displayMode!==void 0&&(this.displayMode=r.displayMode),r.retryable!==void 0&&(this.retryable=r.retryable),this.retryCount=0,this.maxRetries=r.maxRetries??(r.retryable?3:0),r.requiresUserAction!==void 0&&(this.requiresUserAction=r.requiresUserAction),r.helpUrl!==void 0&&(this.helpUrl=r.helpUrl),r.tags!==void 0&&(this.tags=r.tags),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ae)}generateErrorId(){return`err_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}static createNetworkError(r){return new ae({code:r.code,message:r.message,category:"network",severity:"error",originalError:r.originalError,context:{url:r.url,method:r.method,timeout:r.timeout},recoveryStrategy:"retry",displayMode:"toast",retryable:!0,maxRetries:3,tags:["network","api"]})}static createAuthError(r){return new ae({code:r.code,message:r.message,category:"auth",severity:"warning",originalError:r.originalError,recoveryStrategy:"reauth",displayMode:"modal",retryable:!1,requiresUserAction:!0,tags:["auth","security"]})}static createBusinessError(r){return new ae({code:r.code,message:r.message,category:"business",severity:r.severity??"warning",...r.userMessage&&{userMessage:r.userMessage},...r.context&&{context:r.context},recoveryStrategy:"none",displayMode:"toast",retryable:!1,tags:["business","logic"]})}static createValidationError(r){return new ae({code:r.code,message:r.message,category:"validation",severity:"warning",context:{field:r.field,rule:r.rule,expectedValue:r.expectedValue,actualValue:r.actualValue},recoveryStrategy:"none",displayMode:"inline",retryable:!1,requiresUserAction:!0,tags:["validation","input"]})}static createSystemError(r){return new ae({code:r.code,message:r.message,category:"system",severity:"critical",originalError:r.originalError,...r.technicalDetails&&{technicalDetails:r.technicalDetails},recoveryStrategy:"contact_support",displayMode:"modal",retryable:!1,requiresUserAction:!0,tags:["system","critical"]})}static createUserError(r){return new ae({code:r.code,message:r.message,category:"user",severity:"info",userMessage:r.userMessage,...r.context&&{context:r.context},recoveryStrategy:"none",displayMode:"toast",retryable:!1,tags:["user","operation"]})}static fromError(r,t){return new ae({code:t?.code??"UNKNOWN_ERROR",message:r.message,category:t?.category??"unknown",severity:t?.severity??"error",originalError:r,...t?.context&&{context:t.context},...r.stack&&{technicalDetails:r.stack},recoveryStrategy:"retry",displayMode:"toast",retryable:!0,tags:["unknown","system"]})}static fromUnknown(r,t){if(r instanceof Error)return ae.fromError(r,t);const n=typeof r=="string"?r:"Unknown error occurred";return new ae({code:t?.code??"UNKNOWN_ERROR",message:n,category:t?.category??"unknown",severity:t?.severity??"error",originalError:r,...t?.context&&{context:t.context},recoveryStrategy:"retry",displayMode:"toast",retryable:!1,tags:["unknown"]})}static isAppError(r){return r instanceof ae}withRetry(){const r=Object.create(ae.prototype);return Object.assign(r,this),r.retryCount=(this.retryCount??0)+1,r}getUserMessage(){return this.userMessage??this.message}getTechnicalDetails(){return this.technicalDetails??this.stack}canRetry(){return this.retryable?(this.retryCount??0)<(this.maxRetries??0):!1}toJSON(){return{id:this.id,code:this.code,message:this.message,category:this.category,severity:this.severity,timestamp:this.timestamp.toISOString(),source:this.source,context:this.context,userMessage:this.userMessage,technicalDetails:this.getTechnicalDetails(),recoveryStrategy:this.recoveryStrategy,displayMode:this.displayMode,retryable:this.retryable,retryCount:this.retryCount,maxRetries:this.maxRetries,requiresUserAction:this.requiresUserAction,helpUrl:this.helpUrl,tags:this.tags}}toString(){return`${this.name} [${this.code}]: ${this.message}`}},bt=class extends Q.Component{static{s(this,"ErrorBoundary")}constructor(e){super(e),q(this,"resetError",()=>{this.setState({hasError:!1,error:null,errorInfo:null,errorId:null})}),this.state={hasError:!1,error:null,errorInfo:null,errorId:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e,errorId:`boundary_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}componentDidCatch(e,r){this.setState({error:e,errorInfo:r}),this.props.onError&&this.props.onError(e,r);const t={code:"REACT_ERROR_BOUNDARY",message:e.message,category:"system",severity:this.getErrorSeverity(),source:this.props.name??"ErrorBoundary",context:{componentStack:r.componentStack,errorBoundaryLevel:this.props.level??"component",errorBoundaryName:this.props.name},originalError:e};e.stack&&(t.technicalDetails=e.stack);const n=new vr(t);this.props.level==="component"&&pr({title:"\u7EC4\u4EF6\u9519\u8BEF",description:`${this.props.name??"\u7EC4\u4EF6"}\u6E32\u67D3\u5931\u8D25: ${e.message}`,errorId:n.id,duration:8e3}),console.group("\u{1F6A8} React Error Boundary"),console.error("Error:",e),console.error("Component Stack:",r.componentStack),console.error("Error Boundary Props:",this.props),console.groupEnd()}getErrorSeverity(){switch(this.props.level){case"page":return"critical";case"section":return"error";case"component":default:return"warning"}}render(){if(this.state.hasError){if(this.props.fallback){const r=this.props.fallback,t={error:this.state.error,errorInfo:this.state.errorInfo,resetError:this.resetError,level:this.props.level??"component",...this.props.name&&{name:this.props.name},...this.props.texts&&{texts:this.props.texts}};return a(r,{...t})}const e={error:this.state.error,errorInfo:this.state.errorInfo,resetError:this.resetError,level:this.props.level??"component",showDetails:this.props.showDetails??!1,...this.props.name&&{name:this.props.name},...this.props.texts&&{texts:this.props.texts}};return a(jl,{...e})}return this.props.children}};function jl({error:e,errorInfo:r,resetError:t,level:n,name:o,showDetails:i=!1,texts:l={}}){const h={...{title:"Something went wrong",message:"An error occurred while rendering this component",retry:"Retry",refreshPage:"Refresh Page",backToHome:"Back to Home",errorDetails:"Error Details",pageLoadFailed:"Page Load Failed",blockRenderFailed:"Block Render Failed",componentRenderFailed:"Component Render Failed"},...l},f=s(()=>{switch(n){case"page":return h.pageLoadFailed;case"section":return h.blockRenderFailed;case"component":default:return h.componentRenderFailed}},"getErrorTitle"),c=s(()=>h.message,"getErrorDescription"),b=V(()=>{n==="page"?window.location.reload():t()},[n,t]),p=V(()=>{window.location.href="/"},[]);return a(Pe,{className:"m-4 border-destructive/20 bg-destructive-soft",children:a(ar,{className:"p-6",children:u("div",{className:"flex items-start space-x-4",children:[a("div",{className:"flex-shrink-0",children:a(Ar,{className:"h-8 w-8 text-destructive"})}),u("div",{className:"flex-1",children:[a("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:f()}),a("p",{className:"mb-4 text-foreground/80",children:c()}),i&&u("details",{className:"mb-4",children:[a("summary",{className:"cursor-pointer text-sm font-medium text-destructive hover:text-foreground",children:h.errorDetails}),u("div",{className:"mt-2 rounded border border-destructive/20 bg-card p-3",children:[u("p",{className:"mb-2 font-mono text-xs text-foreground",children:[a("strong",{children:"Error Message:"})," ",e.message]}),e.stack&&a("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:e.stack}),r.componentStack&&u("details",{className:"mt-2",children:[a("summary",{className:"cursor-pointer text-xs font-medium text-destructive",children:"Component Stack"}),a("pre",{className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:r.componentStack})]})]})]}),u("div",{className:"flex space-x-3",children:[u(K,{onClick:b,size:"sm",variant:"outline",className:"border-destructive/30 text-destructive hover:bg-destructive/10",children:[a(kt,{className:"mr-2 h-4 w-4"}),n==="page"?h.refreshPage:h.retry]}),n==="page"&&u(K,{onClick:p,size:"sm",variant:"outline",className:"border-destructive/30 text-destructive hover:bg-destructive/10",children:[a(Dt,{className:"mr-2 h-4 w-4"}),h.backToHome]})]})]})]})})})}s(jl,"DefaultErrorFallback");function Kl(e,r){const t=s(n=>a(bt,{...r,children:a(e,{...n})}),"WrappedComponent");return t.displayName=`withErrorBoundary(${e.displayName??e.name})`,t}s(Kl,"withErrorBoundary");function Kn(e){const[r,t]=Q.useState(null),o={...{operationFailed:"Operation Failed"},...e},i=Q.useCallback(()=>{t(null)},[]),l=Q.useCallback(d=>{t(d);const h=new vr({code:"COMPONENT_ERROR",message:d.message,category:"system",severity:"error",originalError:d});pr({title:o.operationFailed,description:d.message,errorId:h.id,duration:6e3})},[o.operationFailed]);if(r)throw r;return{captureError:l,resetError:i}}s(Kn,"useErrorHandler");function br({text:e,size:r="md",showText:t=!0}){const n="Loading...",o={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"};return u("div",{className:`flex flex-col items-center justify-center ${{sm:"p-2",md:"p-4",lg:"p-6"}[r]}`,children:[a(Hs,{className:`animate-spin text-primary ${o[r]}`}),t&&a("p",{className:"mt-2 text-sm text-muted-foreground",children:e??n})]})}s(br,"DefaultLoadingFallback");function We({children:e,fallback:r,errorBoundaryProps:t={},loadingText:n,name:o="SuspenseComponent",enableErrorBoundary:i=!0}){const l=r??a(br,{...n?{text:n}:{}}),d=a(Ns,{fallback:l,children:e});return i?a(bt,{level:"section",name:o,...t,children:d}):d}s(We,"SuspenseErrorBoundary");function Vl({children:e,fallback:r,name:t="Page",texts:n}){return a(We,{fallback:r??a("div",{className:"flex min-h-screen items-center justify-center",children:a(br,{text:"Loading page...",size:"lg"})}),errorBoundaryProps:{level:"page",showDetails:!1,...n&&{texts:n}},name:t,children:e})}s(Vl,"PageSuspenseErrorBoundary");function Wl({children:e,fallback:r,name:t="Section",className:n="",texts:o}){const i=r??a("div",{className:`flex items-center justify-center p-8 ${n}`,children:a(br,{text:"Loading content..."})});return a(We,{fallback:i,errorBoundaryProps:{level:"section",showDetails:!1,...o&&{texts:o}},name:t,children:e})}s(Wl,"SectionSuspenseErrorBoundary");function Gl({children:e,fallback:r,name:t="Component",size:n="md"}){return a(We,{fallback:r??a(br,{size:n,showText:!1}),errorBoundaryProps:{level:"component",showDetails:!1},name:t,children:e})}s(Gl,"ComponentSuspenseErrorBoundary");function Hl(e,r={}){const t=s(n=>a(We,{fallback:r.fallback,errorBoundaryProps:r.errorBoundaryProps??{},...r.loadingText&&{loadingText:r.loadingText},name:r.name??e.displayName??e.name,children:a(e,{...n})}),"WrappedComponent");return t.displayName=`withSuspenseErrorBoundary(${e.displayName??e.name})`,t}s(Hl,"withSuspenseErrorBoundary");function ql(e){const{captureError:r}=Kn();return{handleSuspenseError:Q.useCallback(n=>{const o=new vr({code:"SUSPENSE_ERROR",message:n.message,category:"system",severity:"warning",source:e??"SuspenseComponent",context:{suspenseError:!0,componentName:e},originalError:n});r(o)},[r,e])}}s(ql,"useSuspenseErrorHandler");var Vn=class{static{s(this,"ToastErrorNotificationHandler")}async showError(e){if(e.context?.isSuccess===!0){gr({title:"\u6210\u529F",description:e.userMessage??e.message,duration:4e3});return}const t={title:this.getErrorTitle(e),description:e.userMessage??e.message,errorId:e.id,duration:this.getErrorDuration(e),severity:e.severity==="critical"?"critical":"error"};if(e.retryable){t.retryable=e.retryable;const n=this.createRetryAction(e);n&&(t.retryAction=n)}e.helpUrl&&(t.helpUrl=e.helpUrl),pr(t)}async showWarning(e){if(e.context?.isSuccess===!0){gr({title:"\u6210\u529F",description:e.userMessage??e.message,duration:4e3});return}const t={title:this.getErrorTitle(e),description:e.userMessage??e.message,duration:this.getErrorDuration(e)};e.helpUrl&&(t.helpUrl=e.helpUrl),vn(t)}async showInfo(e){if(e.context?.isSuccess===!0){gr({title:"\u6210\u529F",description:e.userMessage??e.message,duration:4e3});return}bn({title:this.getErrorTitle(e),description:e.userMessage??e.message,duration:this.getErrorDuration(e)})}async dismiss(e){}getErrorTitle(e){switch(e.severity){case"critical":return"\u4E25\u91CD\u9519\u8BEF";case"error":return"\u9519\u8BEF";case"warning":return"\u8B66\u544A";case"info":return"\u63D0\u793A";default:return"\u901A\u77E5"}}getErrorDuration(e){switch(e.severity){case"critical":return 0;case"error":return 8e3;case"warning":return 6e3;case"info":return 4e3;default:return 5e3}}createRetryAction(e){}};function Yl(){return new Vn}s(Yl,"createToastErrorNotificationHandler");var Wn={NETWORK_ERROR:"errors.network.general",CONNECTION_TIMEOUT:"errors.network.timeout",CONNECTION_FAILED:"errors.network.failed",NETWORK_UNAVAILABLE:"errors.network.unavailable",REQUEST_FAILED:"errors.network.requestFailed",CORS_ERROR:"errors.network.cors",DNS_ERROR:"errors.network.dns",UNAUTHORIZED:"errors.auth.unauthorized",FORBIDDEN:"errors.auth.forbidden",TOKEN_EXPIRED:"errors.auth.tokenExpired",TOKEN_INVALID:"errors.auth.tokenInvalid",LOGIN_REQUIRED:"errors.auth.loginRequired",PERMISSION_DENIED:"errors.auth.permissionDenied",BAD_REQUEST:"errors.http.badRequest",NOT_FOUND:"errors.http.notFound",VALIDATION_ERROR:"errors.http.validationError",RATE_LIMITED:"errors.http.rateLimited",INTERNAL_SERVER_ERROR:"errors.http.internalServerError",BAD_GATEWAY:"errors.http.badGateway",SERVICE_UNAVAILABLE:"errors.http.serviceUnavailable",GATEWAY_TIMEOUT:"errors.http.gatewayTimeout",BUSINESS_RULE_VIOLATION:"errors.business.ruleViolation",OPERATION_NOT_ALLOWED:"errors.business.operationNotAllowed",RESOURCE_CONFLICT:"errors.business.resourceConflict",RESOURCE_NOT_FOUND:"errors.business.resourceNotFound",RESOURCE_ALREADY_EXISTS:"errors.business.resourceAlreadyExists",QUOTA_EXCEEDED:"errors.business.quotaExceeded",REQUIRED_FIELD_MISSING:"errors.validation.requiredFieldMissing",INVALID_FORMAT:"errors.validation.invalidFormat",VALUE_OUT_OF_RANGE:"errors.validation.valueOutOfRange",INVALID_EMAIL:"errors.validation.invalidEmail",INVALID_PASSWORD:"errors.validation.invalidPassword",PASSWORD_TOO_WEAK:"errors.validation.passwordTooWeak",DATABASE_ERROR:"errors.system.database",FILE_SYSTEM_ERROR:"errors.system.fileSystem",MEMORY_ERROR:"errors.system.memory",CONFIGURATION_ERROR:"errors.system.configuration",OPERATION_CANCELLED:"errors.user.operationCancelled",OPERATION_TIMEOUT:"errors.user.operationTimeout",INVALID_OPERATION:"errors.user.invalidOperation",OPERATION_FAILED:"errors.user.operationFailed",EXTERNAL_SERVICE_ERROR:"errors.external.serviceError",EXTERNAL_API_ERROR:"errors.external.apiError",PAYMENT_ERROR:"errors.external.paymentError",EMAIL_SERVICE_ERROR:"errors.external.emailServiceError",FILE_NOT_FOUND:"errors.file.notFound",FILE_TOO_LARGE:"errors.file.tooLarge",FILE_TYPE_NOT_SUPPORTED:"errors.file.typeNotSupported",FILE_UPLOAD_FAILED:"errors.file.uploadFailed",FILE_DOWNLOAD_FAILED:"errors.file.downloadFailed",STORAGE_ERROR:"errors.storage.general",STORAGE_QUOTA_EXCEEDED:"errors.storage.quotaExceeded",STORAGE_UNAVAILABLE:"errors.storage.unavailable",CACHE_ERROR:"errors.storage.cache",REACT_ERROR_BOUNDARY:"errors.react.boundary",COMPONENT_ERROR:"errors.react.component",SUSPENSE_ERROR:"errors.react.suspense",NEXTJS_PAGE_ERROR:"errors.nextjs.page",UNKNOWN_ERROR:"errors.unknown.general",UNEXPECTED_ERROR:"errors.unknown.unexpected"},Gn={zh:{"errors.network.general":"\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8BBE\u7F6E","errors.network.timeout":"\u7F51\u7EDC\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","errors.network.failed":"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25","errors.network.unavailable":"\u7F51\u7EDC\u4E0D\u53EF\u7528","errors.network.requestFailed":"\u8BF7\u6C42\u5931\u8D25","errors.network.cors":"\u8DE8\u57DF\u8BF7\u6C42\u88AB\u963B\u6B62","errors.network.dns":"DNS\u89E3\u6790\u5931\u8D25","errors.auth.unauthorized":"\u672A\u6388\u6743\u8BBF\u95EE\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55","errors.auth.forbidden":"\u6743\u9650\u4E0D\u8DB3\uFF0C\u65E0\u6CD5\u6267\u884C\u6B64\u64CD\u4F5C","errors.auth.tokenExpired":"\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55","errors.auth.tokenInvalid":"\u767B\u5F55\u72B6\u6001\u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55","errors.auth.loginRequired":"\u8BF7\u5148\u767B\u5F55","errors.auth.permissionDenied":"\u6743\u9650\u4E0D\u8DB3","errors.http.badRequest":"\u8BF7\u6C42\u53C2\u6570\u6709\u8BEF","errors.http.notFound":"\u8D44\u6E90\u4E0D\u5B58\u5728","errors.http.validationError":"\u6570\u636E\u9A8C\u8BC1\u5931\u8D25","errors.http.rateLimited":"\u8BF7\u6C42\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","errors.http.internalServerError":"\u670D\u52A1\u5668\u5185\u90E8\u9519\u8BEF","errors.http.badGateway":"\u7F51\u5173\u9519\u8BEF","errors.http.serviceUnavailable":"\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528","errors.http.gatewayTimeout":"\u7F51\u5173\u8D85\u65F6","errors.business.ruleViolation":"\u8FDD\u53CD\u4E1A\u52A1\u89C4\u5219","errors.business.operationNotAllowed":"\u64CD\u4F5C\u4E0D\u88AB\u5141\u8BB8","errors.business.resourceConflict":"\u8D44\u6E90\u51B2\u7A81","errors.business.resourceNotFound":"\u8D44\u6E90\u4E0D\u5B58\u5728","errors.business.resourceAlreadyExists":"\u8D44\u6E90\u5DF2\u5B58\u5728","errors.business.quotaExceeded":"\u8D85\u51FA\u914D\u989D\u9650\u5236","errors.validation.requiredFieldMissing":"\u5FC5\u586B\u5B57\u6BB5\u7F3A\u5931","errors.validation.invalidFormat":"\u683C\u5F0F\u4E0D\u6B63\u786E","errors.validation.valueOutOfRange":"\u503C\u8D85\u51FA\u8303\u56F4","errors.validation.invalidEmail":"\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E","errors.validation.invalidPassword":"\u5BC6\u7801\u683C\u5F0F\u4E0D\u6B63\u786E","errors.validation.passwordTooWeak":"\u5BC6\u7801\u5F3A\u5EA6\u4E0D\u591F","errors.system.database":"\u6570\u636E\u5E93\u9519\u8BEF","errors.system.fileSystem":"\u6587\u4EF6\u7CFB\u7EDF\u9519\u8BEF","errors.system.memory":"\u5185\u5B58\u4E0D\u8DB3","errors.system.configuration":"\u914D\u7F6E\u9519\u8BEF","errors.user.operationCancelled":"\u64CD\u4F5C\u5DF2\u53D6\u6D88","errors.user.operationTimeout":"\u64CD\u4F5C\u8D85\u65F6","errors.user.invalidOperation":"\u65E0\u6548\u64CD\u4F5C","errors.user.operationFailed":"\u64CD\u4F5C\u5931\u8D25","errors.external.serviceError":"\u7B2C\u4E09\u65B9\u670D\u52A1\u9519\u8BEF","errors.external.apiError":"\u5916\u90E8API\u9519\u8BEF","errors.external.paymentError":"\u652F\u4ED8\u670D\u52A1\u9519\u8BEF","errors.external.emailServiceError":"\u90AE\u4EF6\u670D\u52A1\u9519\u8BEF","errors.file.notFound":"\u6587\u4EF6\u4E0D\u5B58\u5728","errors.file.tooLarge":"\u6587\u4EF6\u8FC7\u5927","errors.file.typeNotSupported":"\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301","errors.file.uploadFailed":"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25","errors.file.downloadFailed":"\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25","errors.storage.general":"\u5B58\u50A8\u9519\u8BEF","errors.storage.quotaExceeded":"\u5B58\u50A8\u7A7A\u95F4\u4E0D\u8DB3","errors.storage.unavailable":"\u5B58\u50A8\u670D\u52A1\u4E0D\u53EF\u7528","errors.storage.cache":"\u7F13\u5B58\u9519\u8BEF","errors.react.boundary":"\u7EC4\u4EF6\u6E32\u67D3\u9519\u8BEF","errors.react.component":"\u7EC4\u4EF6\u9519\u8BEF","errors.react.suspense":"\u7EC4\u4EF6\u52A0\u8F7D\u9519\u8BEF","errors.nextjs.page":"\u9875\u9762\u9519\u8BEF","errors.unknown.general":"\u53D1\u751F\u672A\u77E5\u9519\u8BEF","errors.unknown.unexpected":"\u53D1\u751F\u610F\u5916\u9519\u8BEF"},en:{"errors.network.general":"Network connection failed, please check your network settings","errors.network.timeout":"Network request timeout, please try again later","errors.network.failed":"Network request failed","errors.network.unavailable":"Network unavailable","errors.network.requestFailed":"Request failed","errors.network.cors":"Cross-origin request blocked","errors.network.dns":"DNS resolution failed","errors.auth.unauthorized":"Unauthorized access, please login again","errors.auth.forbidden":"Insufficient permissions to perform this operation","errors.auth.tokenExpired":"Login expired, please login again","errors.auth.tokenInvalid":"Invalid login status, please login again","errors.auth.loginRequired":"Please login first","errors.auth.permissionDenied":"Permission denied","errors.http.badRequest":"Invalid request parameters","errors.http.notFound":"Resource not found","errors.http.validationError":"Data validation failed","errors.http.rateLimited":"Too many requests, please try again later","errors.http.internalServerError":"Internal server error","errors.http.badGateway":"Bad gateway","errors.http.serviceUnavailable":"Service temporarily unavailable","errors.http.gatewayTimeout":"Gateway timeout","errors.business.ruleViolation":"Business rule violation","errors.business.operationNotAllowed":"Operation not allowed","errors.business.resourceConflict":"Resource conflict","errors.business.resourceNotFound":"Resource not found","errors.business.resourceAlreadyExists":"Resource already exists","errors.business.quotaExceeded":"Quota exceeded","errors.validation.requiredFieldMissing":"Required field missing","errors.validation.invalidFormat":"Invalid format","errors.validation.valueOutOfRange":"Value out of range","errors.validation.invalidEmail":"Invalid email format","errors.validation.invalidPassword":"Invalid password format","errors.validation.passwordTooWeak":"Password too weak","errors.system.database":"Database error","errors.system.fileSystem":"File system error","errors.system.memory":"Out of memory","errors.system.configuration":"Configuration error","errors.user.operationCancelled":"Operation cancelled","errors.user.operationTimeout":"Operation timeout","errors.user.invalidOperation":"Invalid operation","errors.user.operationFailed":"Operation failed","errors.external.serviceError":"External service error","errors.external.apiError":"External API error","errors.external.paymentError":"Payment service error","errors.external.emailServiceError":"Email service error","errors.file.notFound":"File not found","errors.file.tooLarge":"File too large","errors.file.typeNotSupported":"File type not supported","errors.file.uploadFailed":"File upload failed","errors.file.downloadFailed":"File download failed","errors.storage.general":"Storage error","errors.storage.quotaExceeded":"Storage quota exceeded","errors.storage.unavailable":"Storage service unavailable","errors.storage.cache":"Cache error","errors.react.boundary":"Component rendering error","errors.react.component":"Component error","errors.react.suspense":"Component loading error","errors.nextjs.page":"Page error","errors.unknown.general":"Unknown error occurred","errors.unknown.unexpected":"Unexpected error occurred"}};function Hn(e={}){const{defaultLocale:r="zh",translate:t,texts:n={}}=e,o=V(f=>Wn[f]||"errors.unknown.general",[]),i=V((f,c=r)=>{const b=Gn[c];return b[f]||b["errors.unknown.general"]},[r]),l=V((f,c)=>{const b=typeof f=="string"?f:f.code,p=o(b);if(t)try{const x=t(p,c);return x===p?i(p):x}catch{return i(p)}const v=n[p];return v||i(p)},[o,i,t,n]),d=V(f=>{const c=`errors.titles.${f.severity}`;if(t)try{const w=t(c);if(w!==c)return w}catch{}const b=`error.${f.severity}`,p={zh:{critical:"\u4E25\u91CD\u9519\u8BEF",error:"\u9519\u8BEF",warning:"\u8B66\u544A",info:"\u63D0\u793A"},en:{critical:"Critical Error",error:"Error",warning:"Warning",info:"Information"}},v=p[r][f.severity]||p[r].error,x=n[b];return x||v},[r,t,n]),h=V((f,c)=>f.userMessage?f.userMessage:l(f,c),[l]);return{getErrorMessage:l,getErrorTitle:d,getErrorDescription:h,getErrorMessageKey:o}}s(Hn,"useErrorMessages");function Xl(e,r="zh"){return s(function(){return Hn({translate:e,defaultLocale:r})},"useErrorMessagesWithTranslation")}s(Xl,"createErrorMessagesHook");function qn({className:e,label:r}){return u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:e,children:[a("path",{d:"M5 1.5h9L20 7.5V21a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 21V3a1.5 1.5 0 0 1 1-1.5Z",fill:"currentColor"}),a("path",{d:"M14 1.5 20 7.5h-4.5A1.5 1.5 0 0 1 14 6Z",fill:"hsl(var(--card))",fillOpacity:"0.35"}),a("text",{x:"11.5",y:"18.5",textAnchor:"middle",fontFamily:"ui-sans-serif, system-ui, -apple-system, sans-serif",fontSize:"7",fontWeight:"800",letterSpacing:"-0.4",fill:"hsl(var(--card))",children:r})]})}s(qn,"FileBadge");function Yn({className:e}){return a(qn,{label:"PDF",className:e})}s(Yn,"PdfFileIcon");function Ge({className:e}){return a(qn,{label:"DOC",className:e})}s(Ge,"DocFileIcon");var Ql={pdf:{color:"text-file-pdf",bgColor:"bg-file-pdf/10"},doc:{color:"text-file-doc",bgColor:"bg-file-doc/10"},sheet:{color:"text-file-sheet",bgColor:"bg-file-sheet/10"},slide:{color:"text-file-slide",bgColor:"bg-file-slide/10"},text:{color:"text-file-text",bgColor:"bg-file-text/10"},code:{color:"text-file-code",bgColor:"bg-file-code/10"},image:{color:"text-file-image",bgColor:"bg-file-image/10"},audio:{color:"text-file-audio",bgColor:"bg-file-audio/10"},video:{color:"text-file-video",bgColor:"bg-file-video/10"},archive:{color:"text-file-archive",bgColor:"bg-file-archive/10"}},T=s(e=>Ql[e],"kind"),Xn={pdf:{icon:Yn,...T("pdf")},doc:{icon:Ge,...T("doc")},docx:{icon:Ge,...T("doc")},odt:{icon:Ge,...T("doc")},rtf:{icon:Ge,...T("doc")},xls:{icon:Ae,...T("sheet")},xlsx:{icon:Ae,...T("sheet")},csv:{icon:Ae,...T("sheet")},tsv:{icon:Ae,...T("sheet")},ods:{icon:Ae,...T("sheet")},ppt:{icon:Ze,...T("slide")},pptx:{icon:Ze,...T("slide")},odp:{icon:Ze,...T("slide")},key:{icon:Ze,...T("slide")},txt:{icon:At,...T("text")},md:{icon:Ft,...T("text")},js:{icon:H,...T("code")},ts:{icon:H,...T("code")},jsx:{icon:H,...T("code")},tsx:{icon:H,...T("code")},py:{icon:H,...T("code")},java:{icon:H,...T("code")},c:{icon:H,...T("code")},cpp:{icon:H,...T("code")},h:{icon:H,...T("code")},go:{icon:H,...T("code")},rs:{icon:H,...T("code")},rb:{icon:H,...T("code")},php:{icon:H,...T("code")},html:{icon:H,...T("code")},css:{icon:H,...T("code")},json:{icon:H,...T("code")},xml:{icon:H,...T("code")},yml:{icon:H,...T("code")},yaml:{icon:H,...T("code")},sql:{icon:H,...T("code")},sh:{icon:Tt,...T("code")},jpg:{icon:ie,...T("image")},jpeg:{icon:ie,...T("image")},png:{icon:ie,...T("image")},gif:{icon:ie,...T("image")},webp:{icon:ie,...T("image")},svg:{icon:ie,...T("image")},bmp:{icon:ie,...T("image")},avif:{icon:ie,...T("image")},heic:{icon:ie,...T("image")},mp3:{icon:de,...T("audio")},wav:{icon:de,...T("audio")},ogg:{icon:de,...T("audio")},m4a:{icon:de,...T("audio")},aac:{icon:de,...T("audio")},flac:{icon:de,...T("audio")},opus:{icon:de,...T("audio")},mp4:{icon:ue,...T("video")},mov:{icon:ue,...T("video")},webm:{icon:ue,...T("video")},mkv:{icon:ue,...T("video")},avi:{icon:ue,...T("video")},m4v:{icon:ue,...T("video")},zip:{icon:Ee,...T("archive")},rar:{icon:Ee,...T("archive")},"7z":{icon:Ee,...T("archive")},tar:{icon:Ee,...T("archive")},gz:{icon:Ee,...T("archive")},bz2:{icon:Ee,...T("archive")}},Zl={icon:St,color:"text-muted-foreground",bgColor:"bg-muted"},Qn={document:{icon:Ft,...T("doc")},text:{icon:At,...T("text")},code:{icon:Tt,...T("code")},image:{icon:Us,...T("image")},audio:{icon:de,...T("audio")},video:{icon:ue,...T("video")},archive:{icon:zs,...T("archive")}};function Jl(e){if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e.startsWith("text/"))return"text"}s(Jl,"mimeCategory");function Zn(e){const t=((e??"").toLowerCase().split(/[?#]/,1)[0]??"").trim();return t.includes(".")?t.split(".").at(-1)??"":""}s(Zn,"getFileExtension");function ec(e,r){const t=Zn(e);if(t&&Xn[t])return Xn[t];if(r?.category){const n=Qn[r.category];if(n)return n}if(r?.mimeType){const n=Jl(r.mimeType);if(n){const o=Qn[n];if(o)return o}}return Zl}s(ec,"getFileIconConfig");function rc(e){if(e===0)return"0 B";const r=1024,t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(r));return`${(e/Math.pow(r,n)).toFixed(1)} ${t[n]}`}s(rc,"formatFileSize");var xt=g.forwardRef(({pagination:e,onPageChange:r,onPageSizeChange:t,pageSizeOptions:n=[10,20,50,100],showPageSizeSelector:o=!0,showPageInfo:i=!0,className:l,texts:d={}},h)=>{const c={...{showing:"Showing {start} to {end} of {total} items",itemsPerPage:"Items per page",firstPage:"First",previous:"Previous",next:"Next",lastPage:"Last"},...d},{page:b,limit:p,total:v,totalPages:x,hasNext:w,hasPrev:E,offset:C=(b-1)*p}=e,D=C+1,y=Math.min(C+p,v),k=s(()=>r(0),"handleFirstPage"),S=s(()=>r(Math.max(0,C-p)),"handlePrevPage"),A=s(()=>r(C+p),"handleNextPage"),_=s(()=>{const L=Math.floor((v-1)/p)*p;r(L)},"handleLastPage");return v===0?null:u("div",{ref:h,className:m("flex flex-col items-center justify-between gap-3 pt-3 sm:flex-row",l),children:[i&&a("div",{className:"text-[13px] text-muted-foreground",children:c.showing.replace("{start}",D.toString()).replace("{end}",y.toString()).replace("{total}",v.toString())}),u("div",{className:"flex items-center gap-2",children:[o&&u("div",{className:"flex items-center gap-1.5 text-[13px]",children:[a("span",{children:c.itemsPerPage}),u(Cr,{value:p.toString(),onValueChange:s(L=>t(Number(L)),"onValueChange"),children:[a(kr,{className:"w-16",children:a(Dr,{})}),a(Rr,{children:[...new Set([...n,e.limit])].sort((L,R)=>L-R).map(L=>a(Sr,{value:L.toString(),children:L},L))})]})]}),u("div",{className:"flex items-center gap-1",children:[a(K,{variant:"outline",size:"sm",onClick:k,disabled:C===0||E!==void 0&&!E,children:c.firstPage}),a(K,{variant:"outline",size:"sm",onClick:S,disabled:C===0||E!==void 0&&!E,children:c.previous}),a(K,{variant:"outline",size:"sm",onClick:A,disabled:C+p>=v||w!==void 0&&!w,children:c.next}),a(K,{variant:"outline",size:"sm",onClick:_,disabled:C+p>=v||w!==void 0&&!w,children:c.lastPage})]})]})]})});xt.displayName="Pagination";function tc({data:e,columns:r,loading:t=!1,pagination:n,onPageChange:o,onPageSizeChange:i,searchable:l=!1,searchValue:d="",onSearchChange:h,searchPlaceholder:f,filters:c=[],sort:b,onSortChange:p,actions:v,toolbar:x,rowSelection:w,className:E,tableClassName:C,emptyText:D,emptyIcon:y,emptyActions:k,rowKey:S="id",onRowClick:A,rowClassName:_,texts:L={}}){const I={...{search:"Search",refresh:"Refresh",noData:"No data available",loading:"Loading data...",itemsPerPage:"Items per page",page:"Page",of:"of",items:"items",previous:"Previous",next:"Next",firstPage:"First",lastPage:"Last",showing:"Showing {start} to {end} of {total} items"},...L},z=s((N,P)=>typeof S=="function"?S(N):String(N[S]||P),"getRowKey"),M=s((N,P)=>{let $="hover:bg-muted/50 transition-colors";return A&&($+=" cursor-pointer"),_&&(typeof _=="function"?$+=` ${_(N,P)}`:$+=` ${_}`),$},"getRowClassName"),B=V((N,P,$)=>N.render?N.render(P[N.dataIndex],P,$):N.dataIndex?String(P[N.dataIndex]??""):"",[]),O=V((N,P)=>()=>A?.(N,P),[A]);return t?u("div",{className:m("space-y-4",E),children:[x??u("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[u("div",{className:"flex flex-wrap items-end gap-3",children:[l&&u("div",{className:"relative w-full sm:w-64",children:[a(Ne,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a(Fe,{placeholder:f||I.search,value:d,onChange:s(N=>h?.(N.target.value),"onChange"),className:"pl-10",disabled:!0})]}),c.map(N=>u("div",{className:"w-full sm:w-48",children:[a(Te,{children:N.label}),u(Cr,{value:N.value,onValueChange:N.onChange,disabled:!0,children:[a(kr,{children:a(Dr,{})}),a(Rr,{children:N.options.map(P=>a(Sr,{value:P.value,children:P.label},P.value))})]})]},N.key))]}),v]}),u("div",{className:"flex items-center justify-center py-8",children:[a(kt,{className:"h-6 w-6 animate-spin text-muted-foreground"}),a("span",{className:"ml-2 text-muted-foreground",children:I.loading})]})]}):u("div",{className:m("space-y-4",E),children:[x??u("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[u("div",{className:"flex flex-wrap items-end gap-3",children:[l&&u("div",{className:"w-full sm:w-64",children:[a(Te,{children:I.search}),u("div",{className:"relative",children:[a(Ne,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a(Fe,{placeholder:f||I.search,value:d,onChange:s(N=>h?.(N.target.value),"onChange"),className:"pl-10"})]})]}),c.map(N=>u("div",{className:"w-full sm:w-48",children:[a(Te,{children:N.label}),u(Cr,{value:N.value,onValueChange:N.onChange,children:[a(kr,{children:a(Dr,{})}),a(Rr,{children:N.options.map(P=>a(Sr,{value:P.value,children:P.label},P.value))})]})]},N.key))]}),v]}),a("div",{className:"rounded-md border",children:u(qr,{className:C,children:[a(Yr,{children:u($e,{children:[w&&a(ze,{className:"w-10",children:a(De,{"aria-label":w.label??"Select current page",checked:e.length>0&&e.every((N,P)=>w.selectedKeys.includes(z(N,P))),onCheckedChange:s(N=>w.onChange(N?e.map(z):[]),"onCheckedChange")})}),r.map(N=>{const P=m(N.align==="center"&&"text-center",N.align==="right"&&"text-right",N.className);return N.sortable&&p?a(Qr,{className:P,style:{width:N.width},direction:b?.key===N.key?b.direction:null,onSort:s($=>p({key:N.key,direction:$}),"onSort"),children:N.title},N.key):a(ze,{className:P,style:{width:N.width},children:N.title},N.key)})]})}),a(Xr,{children:e.length===0?a($e,{children:a(Ue,{colSpan:r.length+(w?1:0),className:"py-8 text-center",children:u("div",{className:"flex flex-col items-center justify-center gap-4",children:[y,u("div",{children:[a("h3",{className:"text-lg font-medium",children:D||I.noData}),k]})]})})}):e.map((N,P)=>u($e,{className:M(N,P),onClick:A?O(N,P):void 0,children:[w&&a(Ue,{onClick:s($=>$.stopPropagation(),"onClick"),children:a(De,{"aria-label":w.label??"Select record",checked:w.selectedKeys.includes(z(N,P)),onCheckedChange:s($=>w.onChange($?[...w.selectedKeys,z(N,P)]:w.selectedKeys.filter(ne=>ne!==z(N,P))),"onCheckedChange")})}),r.map($=>a(Ue,{className:m($.align==="center"&&"text-center",$.align==="right"&&"text-right",$.className),children:B($,N,P)},$.key))]},z(N,P)))})]})}),n&&o&&i&&a(xt,{pagination:n,onPageChange:o,onPageSizeChange:i,texts:{showing:I.showing,itemsPerPage:I.itemsPerPage,firstPage:I.firstPage,previous:I.previous,next:I.next,lastPage:I.lastPage}})]})}s(tc,"DataTable");function He(e){if(!Number.isFinite(e)||e==null||e<0)return"0:00";const r=Math.max(0,Math.floor(e)),t=Math.floor(r/60),n=r%60;if(t>=60){const o=Math.floor(t/60),i=t%60;return`${o}:${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`}return`${t}:${String(n).padStart(2,"0")}`}s(He,"formatMediaDuration");var ac={audio:"\u97F3\u9891",video:"\u89C6\u9891"};function Jn({kind:e,url:r,filename:t,className:n}){const o=ac[e];return u("div",{role:"alert",className:m("flex items-center gap-2 rounded-xl border border-destructive/30","bg-destructive/5 px-3 py-2 text-sm text-destructive",n),children:[a(Ar,{className:"h-4 w-4 shrink-0"}),a("span",{className:"min-w-0 flex-1 truncate",title:t??r,children:t?`${o}\u52A0\u8F7D\u5931\u8D25 \xB7 ${t}`:`${o}\u52A0\u8F7D\u5931\u8D25`}),u("a",{href:r,target:"_blank",rel:"noopener noreferrer",download:t??!0,className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-destructive/30 px-2 py-0.5 text-[11px] font-medium text-destructive hover:bg-destructive/10",children:[a(Ie,{className:"h-3 w-3"}),"\u4E0B\u8F7D"]})]})}s(Jn,"MediaErrorBanner");var nc=1;function sc({src:e,title:r,size:t,mimeType:n,durationSeconds:o,className:i,compact:l=!1,downloadable:d,onDownload:h,seekTo:f}){const c=Z(null),b=Z(null),[p,v]=j(!1),[x,w]=j(!1),[E,C]=j(0),[D,y]=j(o),[k,S]=j(!1),[A,_]=j(!1);X(()=>{S(!1),C(0),v(!1),y(o),b.current=null},[e]),X(()=>{o!=null&&Number.isFinite(o)&&y($=>$??o)},[o]);const L=f?.requestId,R=f?.seconds;X(()=>{if(L==null||R==null)return;const $=c.current;if(!$||$.readyState<nc){b.current=R;return}$.currentTime=R,C(R)},[L,R]);const I=V(()=>{const $=c.current;$&&Number.isFinite($.duration)&&y($.duration);const ne=b.current;$&&ne!=null&&(b.current=null,$.currentTime=ne,C(ne))},[]),z=V(()=>{const $=c.current;$&&C($.currentTime)},[]),M=V(()=>{const $=c.current;$&&($.paused?$.play().then(()=>v(!0)).catch(()=>S(!0)):($.pause(),v(!1)))},[]),B=V(()=>w($=>!$),[]),O=V($=>{const ne=c.current;if(!ne||!D)return;const Ye=Number($.target.value);ne.currentTime=Ye,C(Ye)},[D]),N=Y(()=>!D||D<=0?0:Math.min(1,E/D),[E,D]),P=d??!l;return k?a(Jn,{kind:"audio",url:e,filename:r,className:i}):l?u("div",{className:m("inline-flex max-w-[320px] items-center gap-2 rounded-full border border-border/60","bg-background/70 px-2 py-1 text-sm shadow-sm backdrop-blur",i),children:[a(es,{isPlaying:p,onClick:M,size:"sm"}),a(rs,{progress:N,duration:D,currentTime:E,onChange:O,onHover:_,accent:"primary"}),a("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:He(p||A?E:D)}),a(ts,{ref:c,src:e,muted:x,onLoaded:I,onTimeUpdate:z,onEnded:s(()=>{v(!1),C(0)},"onEnded"),onError:s(()=>S(!0),"onError")})]}):u("div",{className:m("group/audio flex w-full items-center gap-2.5 rounded-xl border border-border/60","bg-card/60 px-2.5 py-1.5 transition-colors","focus-within:border-primary/40 hover:border-border",i),children:[a(es,{isPlaying:p,onClick:M,size:"md"}),a("div",{className:"flex min-w-0 flex-1 items-center",children:a(rs,{progress:N,duration:D,currentTime:E,onChange:O,onHover:_,accent:"primary"})}),u("span",{className:"shrink-0 text-[11px] tabular-nums leading-none text-muted-foreground",children:[He(E),a("span",{className:"mx-0.5 text-muted-foreground/40",children:"/"}),He(D)]}),u("div",{className:"flex shrink-0 items-center gap-0.5",children:[a("button",{type:"button",onClick:B,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground","aria-label":x?"Unmute":"Mute",children:x?a(js,{className:"h-3.5 w-3.5"}):a(Ks,{className:"h-3.5 w-3.5"})}),P&&(h?a("button",{type:"button",onClick:h,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground","aria-label":r?`Download ${r}`:"Download audio",title:r?`Download ${r}`:"Download audio",children:a(Ie,{className:"h-3.5 w-3.5"})}):a("a",{href:e,download:r??!0,target:"_blank",rel:"noopener noreferrer",className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground","aria-label":r?`Download ${r}`:"Download audio",title:r?`Download ${r}`:"Download audio",children:a(Ie,{className:"h-3.5 w-3.5"})}))]}),a(ts,{ref:c,src:e,muted:x,onLoaded:I,onTimeUpdate:z,onEnded:s(()=>{v(!1),C(0)},"onEnded"),onError:s(()=>S(!0),"onError")})]})}s(sc,"AudioPlayer");function es({isPlaying:e,onClick:r,size:t}){return a("button",{type:"button",onClick:r,className:m("flex shrink-0 items-center justify-center rounded-full","bg-primary text-primary-foreground","transition-all duration-150 ease-out","hover:bg-primary/90 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",t==="sm"?"h-7 w-7":"h-8 w-8"),"aria-label":e?"Pause":"Play",children:e?a(It,{className:t==="sm"?"h-3 w-3":"h-3.5 w-3.5",fill:"currentColor"}):a(Mt,{className:m(t==="sm"?"h-3 w-3":"h-3.5 w-3.5","translate-x-[1px]"),fill:"currentColor"})})}s(es,"PlayPauseButton");function rs({progress:e,duration:r,currentTime:t,onChange:n,onHover:o}){const i=Math.round(e*1e3)/10;return u("div",{className:"relative flex-1",onMouseEnter:s(()=>o?.(!0),"onMouseEnter"),onMouseLeave:s(()=>o?.(!1),"onMouseLeave"),children:[a("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-1/2 left-0 right-0 h-1 -translate-y-1/2 overflow-hidden rounded-full bg-muted",children:a("div",{className:"h-full rounded-full bg-primary transition-[width] duration-75",style:{width:`${i}%`}})}),a("input",{type:"range",min:0,max:r??0,step:.05,value:t,onChange:n,disabled:!r,className:m("relative h-3 w-full cursor-pointer appearance-none bg-transparent","[&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:w-3","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full","[&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow","[&::-webkit-slider-thumb]:opacity-0","hover:[&::-webkit-slider-thumb]:opacity-100","focus:[&::-webkit-slider-thumb]:opacity-100","[&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:w-3","[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0","[&::-moz-range-thumb]:bg-primary","[&::-moz-range-thumb]:opacity-0","hover:[&::-moz-range-thumb]:opacity-100","focus:[&::-moz-range-thumb]:opacity-100"),"aria-label":"Seek"})]})}s(rs,"SeekBar");var ts=Q.forwardRef(s(function({src:r,muted:t,onLoaded:n,onTimeUpdate:o,onEnded:i,onError:l},d){return a("audio",{ref:d,src:r,muted:t,preload:"metadata",onLoadedMetadata:n,onTimeUpdate:o,onEnded:i,onError:l,className:"hidden"})},"NativeAudio2"));function oc(e){if(!e||e<=0)return;const r=["B","KB","MB","GB"],t=Math.min(r.length-1,Math.floor(Math.log(e)/Math.log(1024)));return`${(e/Math.pow(1024,t)).toFixed(t===0?0:1)} ${r[t]}`}s(oc,"formatBytes");function ic(e,r){if(e){const t=e.lastIndexOf(".");if(t>0&&t<e.length-1)return e.slice(t+1).toUpperCase()}if(r){const t=r.indexOf("/");if(t>0)return r.slice(t+1).toUpperCase()}return"VIDEO"}s(ic,"inferTypeLabel");function lc({src:e,poster:r,title:t,size:n,mimeType:o,className:i,maxHeight:l=420,loop:d=!1,muted:h=!1,autoPlay:f=!1,controls:c=!0,showMeta:b,downloadable:p,onDownload:v}){const[x,w]=j(!1);if(X(()=>{w(!1)},[e]),x)return a(Jn,{kind:"video",url:e,filename:t,className:i});const E=f&&d&&!c,C=b??(c&&!E),D=p??C,y=oc(n),k=ic(t,o);return E?a("video",{src:e,poster:r,controls:!1,loop:!0,muted:!0,autoPlay:!0,playsInline:!0,onError:s(()=>w(!0),"onError"),className:m("rounded-xl bg-black object-contain",i),style:{maxHeight:l,maxWidth:"100%"}}):u("div",{className:m("flex w-full flex-col overflow-hidden rounded-xl border border-border/70","bg-gradient-to-b from-background to-muted/30 shadow-sm","transition-colors hover:border-border",i),children:[a("div",{className:"flex items-center justify-center bg-black",children:a("video",{src:e,poster:r,controls:c,loop:d,muted:h||f,autoPlay:f,playsInline:!0,preload:"metadata",onError:s(()=>w(!0),"onError"),className:"block w-full",style:{maxHeight:l,maxWidth:"100%"}})}),C&&u("div",{className:"flex items-center gap-1.5 border-t border-border/50 px-3 py-1.5 text-[11px] leading-none text-muted-foreground",children:[t&&a("span",{className:"truncate font-medium text-foreground/80",title:t,children:t}),t&&a("span",{className:"shrink-0 text-muted-foreground/60",children:"\xB7"}),a("span",{className:"shrink-0 font-medium uppercase tracking-wide",children:k}),y&&u(J,{children:[a("span",{"aria-hidden":!0,className:"inline-block h-[3px] w-[3px] shrink-0 rounded-full bg-muted-foreground/40"}),a("span",{className:"shrink-0 tabular-nums",children:y})]}),a("span",{className:"flex-1"}),D&&(v?a("button",{type:"button",onClick:v,className:"inline-flex shrink-0 items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":t?`Download ${t}`:"Download video",title:t?`Download ${t}`:"Download video",children:a(Ie,{className:"h-3.5 w-3.5"})}):a("a",{href:e,download:t??!0,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":t?`Download ${t}`:"Download video",title:t?`Download ${t}`:"Download video",children:a(Ie,{className:"h-3.5 w-3.5"})}))]})]})}s(lc,"VideoPlayer");var as=24;function cc({src:e,durationSeconds:r,className:t,isOwn:n=!1}){const o=Z(null),[i,l]=j(!1),[d,h]=j(0),[f,c]=j(r),[b,p]=j(!1);X(()=>{h(0),l(!1),p(!1),c(r)},[e]),X(()=>{r!=null&&Number.isFinite(r)&&c(y=>y??r)},[r]);const v=V(()=>{const y=o.current;y&&Number.isFinite(y.duration)&&c(y.duration)},[]),x=V(()=>{const y=o.current;y&&h(y.currentTime)},[]),w=V(()=>{const y=o.current;y&&(y.paused?y.play().then(()=>l(!0)).catch(()=>p(!0)):(y.pause(),l(!1)))},[]),E=Y(()=>!f||f<=0?0:Math.min(1,d/f),[d,f]),C=Y(()=>{const y=[];let k=0;for(let S=0;S<e.length;S++)k=k*31+e.charCodeAt(S)&4294967295;for(let S=0;S<as;S++){k=k*1664525+1013904223&4294967295;const A=(k>>>0)%70+20;y.push(A)}return y},[e]),D=Math.floor(E*as);return u("div",{className:m("inline-flex max-w-[280px] items-center gap-2.5 rounded-full px-2.5 py-1.5",n?"bg-primary text-primary-foreground":"bg-muted text-foreground",t),children:[a("button",{type:"button",onClick:w,disabled:b,className:m("flex h-8 w-8 shrink-0 items-center justify-center rounded-full",n?"bg-primary-foreground/20 hover:bg-primary-foreground/30":"bg-background text-foreground hover:bg-background/80","disabled:opacity-50"),"aria-label":i?"Pause voice message":"Play voice message",children:b?a(Vs,{className:"h-3.5 w-3.5"}):i?a(It,{className:"h-3.5 w-3.5"}):a(Mt,{className:"h-3.5 w-3.5"})}),a("div",{className:"flex h-6 flex-1 items-center gap-[2px]",children:C.map((y,k)=>{const S=k<D;return a("span",{className:m("w-[2px] rounded-full transition-colors",S?n?"bg-primary-foreground":"bg-primary":n?"bg-primary-foreground/40":"bg-foreground/30"),style:{height:`${y/100*24}px`}},k)})}),a("span",{className:"shrink-0 text-[11px] tabular-nums opacity-80",children:He(i?d:f)}),a("audio",{ref:o,src:e,preload:"metadata",onLoadedMetadata:v,onTimeUpdate:x,onEnded:s(()=>{l(!1),h(0)},"onEnded"),onError:s(()=>p(!0),"onError"),className:"hidden"})]})}s(cc,"VoiceBubble");function dc({src:e,alt:r,className:t,maxHeight:n=320}){const[o,i]=j(!1);return X(()=>{i(!1)},[e]),o?u("div",{className:m("flex items-center gap-2 rounded-md border bg-muted/40 px-3 py-2 text-sm text-muted-foreground",t),children:[a(Ws,{className:"h-4 w-4"}),a("span",{children:"\u52A8\u56FE\u52A0\u8F7D\u5931\u8D25"})]}):a("img",{src:e,alt:r??"Animated image",loading:"lazy",decoding:"async",onError:s(()=>i(!0),"onError"),className:m("rounded-md object-contain",t),style:{maxHeight:n,maxWidth:"100%"}})}s(dc,"AnimatedImagePreview");function uc({data:e,label:r,onSelect:t,className:n,shape:o="funnel",resultLabel:i}){const[l,d]=g.useState(null),h=Math.max(1,...e.map(c=>Math.max(0,c.value))),f=s(c=>Math.max(0,c)/h,"share");return o==="stages"?a(mc,{data:e,label:r,resultLabel:i,active:l,setActive:d,onSelect:t,className:n}):a(Xe,{delayDuration:80,children:u("figure",{"aria-label":r,className:m("w-full overflow-x-auto",n),children:[a("figcaption",{className:"sr-only",children:r}),a("div",{className:m("mx-auto grid min-w-[42rem] max-w-5xl items-stretch","grid-cols-[minmax(8rem,1fr)_minmax(20rem,3fr)_minmax(10rem,1fr)]",o==="bars"&&"gap-y-1"),children:e.map((c,b)=>{const p=l===c.id,v={onMouseEnter:s(()=>d(c.id),"onMouseEnter"),onMouseLeave:s(()=>d(E=>E===c.id?null:E),"onMouseLeave")},x=u(J,{children:[a("span",{className:"block font-medium tabular-nums",children:c.value.toLocaleString()}),c.detail&&a("span",{className:"block text-xs text-muted-foreground",children:c.detail})]}),w=o==="bars"?a(fc,{share:f(c.value),empty:c.value<=0,fade:b/Math.max(1,e.length),hot:p}):a(hc,{top:f(c.value),bottom:f(b+1<e.length?e[b+1].value:c.value),fade:b/Math.max(1,e.length),hot:p});return u("div",{className:"contents text-sm",children:[a("div",{...v,className:m("flex items-center justify-end rounded-l py-1 pr-3 text-right transition-colors",p?"bg-muted/50 text-foreground":"text-muted-foreground"),children:a("span",{className:"truncate",children:c.label})}),u(be,{open:p,children:[a(xe,{asChild:!0,children:t?a("button",{...v,type:"button","aria-label":`${c.label} ${c.value.toLocaleString()}${c.detail?` ${c.detail}`:""}`,className:m("flex w-full items-center rounded-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",p&&"bg-muted/50"),onFocus:s(()=>d(c.id),"onFocus"),onBlur:s(()=>d(null),"onBlur"),onClick:s(()=>t(c.id),"onClick"),children:w}):a("div",{...v,className:m("flex w-full items-center transition-colors",p&&"bg-muted/50"),children:w})}),u(ye,{side:"top",className:"text-xs",children:[a("span",{className:"block font-medium",children:c.label}),x]})]}),a("div",{...v,className:m("flex flex-col justify-center rounded-r py-1 pl-3 transition-colors",p&&"bg-muted/50"),children:x})]},c.id)})})]})})}s(uc,"FunnelChart");var ns={default:{fill:"from-primary/80 via-primary to-primary/80 text-primary-foreground",result:"border-primary/20 bg-primary/5 text-primary"},success:{fill:"from-success/80 via-success to-success/80 text-success-foreground",result:"border-success/20 bg-success/5 text-success"},warning:{fill:"from-warning/80 via-warning to-warning/80 text-warning-foreground",result:"border-warning/25 bg-warning/5 text-warning"},destructive:{fill:"from-destructive/80 via-destructive to-destructive/80 text-destructive-foreground",result:"border-destructive/20 bg-destructive/5 text-destructive"}};function mc({data:e,label:r,resultLabel:t,active:n,setActive:o,onSelect:i,className:l}){const d=e.filter(c=>c.tone!=="warning"&&c.tone!=="destructive"),h=e.filter(c=>c.tone==="warning"||c.tone==="destructive"),f=s(c=>({onMouseEnter:s(()=>o(c),"onMouseEnter"),onMouseLeave:s(()=>o(b=>b===c?null:b),"onMouseLeave"),onFocus:s(()=>o(c),"onFocus"),onBlur:s(()=>o(null),"onBlur")}),"interaction");return a(Xe,{delayDuration:80,children:u("figure",{"aria-label":r,className:m("w-full",l),children:[a("figcaption",{className:"sr-only",children:r}),u("div",{className:"mx-auto max-w-5xl",children:[a("div",{className:"flex flex-col items-center gap-1.5",children:d.map((c,b)=>{const p=n===c.id,v=c.value<=0,x=ns[c.tone??"default"],w=d.length<=1?1:1-b/(d.length-1)*.5,E=`${c.label} ${c.value.toLocaleString()}${c.detail?` ${c.detail}`:""}`,C=u("span",{className:"relative z-10 flex w-full min-w-0 items-center justify-between gap-3 px-[9%]",children:[a("span",{className:"truncate text-sm font-medium sm:text-base",children:c.label}),u("span",{className:"flex shrink-0 items-baseline gap-2",children:[a("span",{className:"text-lg font-semibold tabular-nums sm:text-xl",children:c.value.toLocaleString()}),c.detail&&a("span",{className:"hidden max-w-48 truncate text-xs opacity-80 sm:block",children:c.detail})]})]});return u(be,{open:p,children:[a(xe,{asChild:!0,children:i?a("button",{...f(c.id),type:"button","aria-label":E,className:m("relative flex min-h-14 items-center overflow-hidden bg-gradient-to-r text-left shadow-sm transition-[filter,box-shadow] duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",x.fill,v&&"bg-muted bg-none text-muted-foreground shadow-none",p&&"shadow-md brightness-105"),style:{width:`${w*100}%`,clipPath:"polygon(3% 0, 97% 0, 93% 100%, 7% 100%)"},onClick:s(()=>i(c.id),"onClick"),children:C}):a("div",{...f(c.id),tabIndex:0,role:"img","aria-label":E,className:m("relative flex min-h-14 items-center overflow-hidden bg-gradient-to-r shadow-sm transition-[filter,box-shadow] duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",x.fill,v&&"bg-muted bg-none text-muted-foreground shadow-none",p&&"shadow-md brightness-105"),style:{width:`${w*100}%`,clipPath:"polygon(3% 0, 97% 0, 93% 100%, 7% 100%)"},children:C})}),u(ye,{side:"top",className:"text-xs",children:[a("span",{className:"block font-medium",children:c.label}),a("span",{className:"block tabular-nums",children:c.value.toLocaleString()}),c.detail&&a("span",{className:"block",children:c.detail})]})]},c.id)})}),h.length>0&&u("div",{className:"mt-6 border-t pt-4",children:[t&&a("p",{className:"mb-3 text-sm font-medium text-muted-foreground",children:t}),a("div",{className:"grid gap-3 sm:grid-cols-2",children:h.map(c=>{const b=n===c.id,p=ns[c.tone??"default"],v=`${c.label} ${c.value.toLocaleString()}${c.detail?` ${c.detail}`:""}`,x=u("span",{className:"min-w-0 flex-1",children:[u("span",{className:"flex items-baseline justify-between gap-3",children:[a("span",{className:"truncate font-medium",children:c.label}),a("span",{className:"shrink-0 text-lg font-semibold tabular-nums",children:c.value.toLocaleString()})]}),c.detail&&a("span",{className:"mt-1 block truncate text-sm text-muted-foreground",children:c.detail})]}),w=m("flex min-h-20 w-full items-center rounded-xl border px-4 py-3 text-left transition-[box-shadow,filter]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",p.result,b&&"brightness-105 shadow-md");return u(be,{open:b,children:[a(xe,{asChild:!0,children:i?a("button",{...f(c.id),type:"button","aria-label":v,className:w,onClick:s(()=>i(c.id),"onClick"),children:x}):a("div",{...f(c.id),tabIndex:0,role:"img","aria-label":v,className:w,children:x})}),u(ye,{side:"top",className:"text-xs",children:[a("span",{className:"block font-medium",children:c.label}),a("span",{className:"block tabular-nums",children:c.value.toLocaleString()}),c.detail&&a("span",{className:"block",children:c.detail})]})]},c.id)})})]})]})]})})}s(mc,"StageFunnel");function fc({share:e,empty:r,fade:t,hot:n}){return a("div",{className:"h-7 w-full rounded bg-muted/40",children:!r&&a("div",{className:"h-full min-w-[0.375rem] rounded bg-primary transition-[opacity]",style:{width:`${Math.max(e,0)*100}%`,opacity:n?1:.85-t*.35}})})}s(fc,"StageBar");function hc({top:e,bottom:r,fade:t,hot:n}){const[l,d]=[e*560,r*560],h=l<1&&d<1,f=.85-t*.35;return a("svg",{viewBox:"0 0 600 56","aria-hidden":"true",className:"h-14 w-full text-primary",children:h?a("line",{x1:300-560/2,x2:300+560/2,y1:56/2,y2:56/2,stroke:"currentColor",strokeWidth:1,strokeDasharray:"4 6",opacity:n?.5:.25}):a("path",{d:`M ${300-l/2} 1 H ${300+l/2} L ${300+d/2} 55 H ${300-d/2} Z`,fill:"currentColor",className:"transition-[opacity]",opacity:n?1:f})})}s(hc,"StageTaper");var pc=[1,2,2.5,5,10];function gc(e,r){const t=e/Math.max(1,r),n=10**Math.floor(Math.log10(t));return(pc.find(i=>i*n>=t)??10)*n}s(gc,"niceStep");function qe(e,r=4){const t=e.filter(d=>typeof d=="number"&&Number.isFinite(d));let n=Math.min(0,...t),o=Math.max(0,...t);n===o&&(o=n+1);const i=gc(o-n,r);n=Math.floor(n/i)*i,o=Math.ceil(o/i)*i;const l=[];for(let d=n;d<=o+i/2;d+=i)l.push(Number(d.toPrecision(12)));return{min:n,max:o,ticks:l}}s(qe,"chartScale");function xr(e,r){return(r-e.min)/(e.max-e.min)}s(xr,"scaleFraction");function ss(e){let r=0;return e.map(t=>{if(t.kind==="total")return r=t.value,{...t,from:0,to:t.value};const n=r;return r+=t.kind==="increase"?t.value:-t.value,{...t,from:n,to:r}})}s(ss,"waterfallBars");var vc={primary:"fill-primary",success:"fill-success",warning:"fill-warning",destructive:"fill-destructive",accent:"fill-chart-6",muted:"fill-muted-foreground/40"},bc={primary:"stroke-primary",success:"stroke-success",warning:"stroke-warning",destructive:"stroke-destructive",accent:"stroke-chart-6",muted:"stroke-muted-foreground/60"},xc={primary:"bg-primary",success:"bg-success",warning:"bg-warning",destructive:"bg-destructive",accent:"bg-chart-6",muted:"bg-muted-foreground/40"},yr=64,os=640,yc=12,is=210;function wc({data:e,series:r,label:t,missingLabel:n,formatValue:o=s(h=>h.toLocaleString(),"formatValue"),formatAxis:i=s(h=>h.toLocaleString(),"formatAxis"),onSelect:l,className:d}){const h=r.some(y=>y.axis==="right"),f=h?os-56:os-8,c=s(y=>r.flatMap((k,S)=>(k.axis??"left")===y?e.map(A=>A.values[S]??null):[]),"valuesOn"),b={left:qe(c("left")),right:qe(c("right"))},p=s((y,k)=>is-xr(b[k],y)*(is-yc),"y"),v=(f-yr)/Math.max(1,e.length),x=s(y=>yr+v*(y+.5),"center"),w=r.map((y,k)=>({s:y,column:k})).filter(({s:y})=>y.kind==="bar"),E=Math.min(36,v*.7/Math.max(1,w.length)),C=Math.ceil(e.length/12),D=s((y,k,S)=>`${y.detail??y.label} \xB7 ${k.label}: ${o(S,k)}`,"tip");return u("figure",{"aria-label":t,className:m("space-y-3",d),children:[a("figcaption",{className:"sr-only",children:t}),a("ul",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:r.map(y=>u("li",{className:"flex items-center gap-1.5",children:[a("span",{"aria-hidden":!0,className:m(y.kind==="bar"?"size-2.5 rounded-sm":"h-0.5 w-3",xc[y.tone])}),y.label]},y.key))}),u("svg",{viewBox:"0 0 640 240",role:"img","aria-label":t,className:"h-auto w-full",children:[b.left.ticks.map(y=>u("g",{children:[a("line",{x1:yr,x2:f,y1:p(y,"left"),y2:p(y,"left"),className:y===0?"stroke-muted-foreground/50":"stroke-border"}),a("text",{x:yr-8,y:p(y,"left")+4,textAnchor:"end",fontSize:"12",className:"fill-muted-foreground",children:i(y,"left")})]},`l${y}`)),h&&b.right.ticks.map(y=>a("text",{x:f+8,y:p(y,"right")+4,fontSize:"12",className:"fill-muted-foreground",children:i(y,"right")},`r${y}`)),e.map((y,k)=>w.map(({s:S,column:A},_)=>{const L=y.values[A]??null;if(L===null)return null;const R=S.axis??"left",I=p(Math.max(0,L),R),z=Math.abs(p(L,R)-p(0,R)),M=x(k)-E*w.length/2+_*E;return a("rect",{x:M+1,y:I,width:Math.max(1,E-2),height:Math.max(z,L===0?0:1),rx:"2",className:m(vc[S.tone],S.dashed&&"opacity-50",l&&"cursor-pointer hover:opacity-80"),onClick:l?()=>l(y,S):void 0,children:a("title",{children:D(y,S,L)})},`${y.key}-${S.key}`)})),r.map((y,k)=>{if(y.kind!=="line")return null;const S=y.axis??"left";let A="",_=!1;return e.forEach((L,R)=>{const I=L.values[k]??null;if(I===null){_=!1;return}A+=`${_?"L":"M"}${x(R)},${p(I,S)}`,_=!0}),u("g",{className:bc[y.tone],children:[a("path",{d:A,fill:"none",strokeWidth:"2.5",strokeLinejoin:"round",strokeDasharray:y.dashed?"6 4":void 0}),e.map((L,R)=>{const I=L.values[k]??null;return I===null?null:a("circle",{cx:x(R),cy:p(I,S),r:"3.5",strokeWidth:"2",className:m("fill-background",l&&"cursor-pointer"),onClick:l?()=>l(L,y):void 0,children:a("title",{children:D(L,y,I)})},L.key)})]},y.key)}),e.map((y,k)=>k%C===0?a("text",{x:x(k),y:"230",textAnchor:"middle",fontSize:"12",className:"fill-muted-foreground",children:y.label},y.key):null)]}),u("table",{className:"sr-only",children:[a("thead",{children:u("tr",{children:[a("th",{children:t}),r.map(y=>a("th",{children:y.label},y.key))]})}),a("tbody",{children:e.map(y=>u("tr",{children:[a("th",{children:y.detail??y.label}),r.map((k,S)=>{const A=y.values[S]??null;return a("td",{children:A===null?n:o(A,k)},k.key)})]},y.key))})]})]})}s(wc,"ComboChart");var Nc={total:"fill-primary",increase:"fill-success",decrease:"fill-destructive"},wr=64,ls=632,Ec=24,cs=200;function Cc({steps:e,label:r,formatValue:t=s(i=>i.toLocaleString(),"formatValue"),onSelect:n,className:o}){const i=ss(e),l=qe(i.flatMap(c=>[c.from,c.to])),d=s(c=>cs-xr(l,c)*(cs-Ec),"y"),h=(ls-wr)/Math.max(1,i.length),f=Math.min(56,h*.6);return u("figure",{"aria-label":r,className:m("space-y-2",o),children:[a("figcaption",{className:"sr-only",children:r}),u("svg",{viewBox:"0 0 640 240",role:"img","aria-label":r,className:"h-auto w-full",children:[l.ticks.map(c=>u("g",{children:[a("line",{x1:wr,x2:ls,y1:d(c),y2:d(c),className:c===0?"stroke-muted-foreground/50":"stroke-border"}),a("text",{x:wr-8,y:d(c)+4,textAnchor:"end",fontSize:"12",className:"fill-muted-foreground",children:t(c)})]},c)),i.map((c,b)=>{const p=wr+h*(b+.5),v=d(Math.max(c.from,c.to)),x=Math.abs(d(c.from)-d(c.to)),w=i[b+1],E=c.kind==="decrease"?-c.value:c.value;return u("g",{children:[a("rect",{x:p-f/2,y:v,width:f,height:Math.max(x,c.value===0?0:1),rx:"2",className:m(Nc[c.kind],n&&"cursor-pointer hover:opacity-80"),onClick:n?()=>n(c):void 0,children:a("title",{children:`${c.label}: ${t(E)}`})}),w&&w.kind!=="total"&&a("line",{x1:p+f/2,x2:p+h-f/2,y1:d(c.to),y2:d(c.to),strokeDasharray:"3 3",className:"stroke-muted-foreground/60"}),u("text",{x:p,y:v-6,textAnchor:"middle",fontSize:"12",className:"fill-foreground",children:[c.kind==="total"?"":E>0?"+":"",t(E)]}),a("text",{x:p,y:"222",textAnchor:"middle",fontSize:"12",className:"fill-muted-foreground",children:c.label})]},c.key)})]}),a("ul",{className:"sr-only",children:i.map(c=>u("li",{children:[c.label,":"," ",t(c.kind==="decrease"?-c.value:c.value)]},c.key))})]})}s(Cc,"WaterfallChart");var yt=120,wt=32;function ds(e,r,t){const n=s(d=>t<=1?yt/2:d*yt/(t-1),"x"),o=s(d=>wt-2-xr(r,d)*(wt-4),"y");let i="",l=!1;return e.forEach((d,h)=>{if(d===null){l=!1;return}i+=`${l?"L":"M"}${n(h).toFixed(1)},${o(d).toFixed(1)}`,l=!0}),i}s(ds,"path");function kc({values:e,previous:r,label:t,className:n}){const o=Math.max(e.length,r?.length??0),i=qe([...e,...r??[]],2);return u("svg",{viewBox:`0 0 ${yt} ${wt}`,preserveAspectRatio:"none",role:"img","aria-label":t,className:m("h-8 w-full overflow-visible",n),children:[r&&a("path",{d:ds(r,i,o),className:"fill-none stroke-muted-foreground/40",strokeWidth:"1.5",strokeDasharray:"3 2",vectorEffect:"non-scaling-stroke"}),a("path",{d:ds(e,i,o),className:"fill-none stroke-primary",strokeWidth:"2",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})}s(kc,"Sparkline");var us=s(e=>String(e).padStart(2,"0"),"pad"),ms=s(e=>`${e.getFullYear()}-${us(e.getMonth()+1)}-${us(e.getDate())}`,"toValue");function fs(e){const r=e?.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(r)return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]))}s(fs,"toDate");var Dc=s(({start:e,end:r})=>`${e.replaceAll("-","/")} \u2013 ${r.replaceAll("-","/")}`,"defaultDisplay");function Rc({value:e,onChange:r,placeholder:t="\u5F00\u59CB\u65E5\u671F \u2013 \u7ED3\u675F\u65E5\u671F",locale:n=rr,labels:o,weekStartsOn:i,formatDisplay:l=Dc,disabled:d,className:h,...f}){const[c,b]=g.useState(!1),[p,v]=g.useState(),x=p??(e?{from:fs(e.start),to:fs(e.end)}:void 0),w=s(E=>{b(E),E||v(void 0)},"change");return u(Re,{open:c,onOpenChange:w,children:[a(Se,{asChild:!0,children:u(K,{type:"button",variant:"outline",disabled:d,...f,className:m("h-9 justify-between gap-2 px-3 text-left text-sm font-normal",!e&&"text-muted-foreground",h),children:[a("span",{className:"truncate",children:e?l(e):t}),a(Gs,{className:"h-4 w-4 shrink-0 opacity-70"})]})}),a(pe,{align:"end",className:"w-auto p-0",children:a(sr,{locale:n,mode:"range",numberOfMonths:2,selected:x,...x?.from?{defaultMonth:x.from}:{},onSelect:s((E,C)=>{const D=p===void 0&&e?{from:C,to:void 0}:E;v(D),D?.from&&D.to&&p!==void 0&&(r({start:ms(D.from),end:ms(D.to)}),w(!1))},"onSelect"),...o?{labels:o}:{},...i!==void 0?{weekStartsOn:i}:{}})})]})}s(Rc,"DateRangePicker");function Sc({items:e,currentId:r,outcome:t="open",onSelect:n,disabled:o=!1,className:i,...l}){const d=e.findIndex(h=>h.id===r);return a(Xe,{delayDuration:200,children:a("div",{role:"list",className:m("flex w-full items-stretch gap-1 overflow-x-auto",i),...l,children:e.map((h,f)=>{const c=d>=0&&f<d,b=f===d,p=!!(n&&h.reachable&&!o),x=u("button",{type:"button",role:"listitem","aria-current":b?"step":void 0,disabled:!p,onClick:s(()=>p&&n?.(h.id),"onClick"),className:m("relative flex min-w-0 flex-1 items-center justify-center gap-1.5 truncate px-3 py-1.5 text-xs font-medium transition-colors","first:rounded-l-md last:rounded-r-md",b?t==="won"?"bg-success text-success-foreground":t==="lost"?"bg-destructive text-destructive-foreground":"bg-primary text-primary-foreground":c?"bg-primary/15 text-primary":"bg-muted text-muted-foreground",p&&"cursor-pointer hover:bg-primary/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!p&&!b&&"cursor-default",h.reachable&&!b&&"ring-1 ring-inset ring-primary/40"),children:[c&&a(le,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),a("span",{className:"truncate",children:h.label})]});return h.hint?u(be,{children:[a(xe,{asChild:!0,children:x}),a(ye,{className:"max-w-xs whitespace-pre-wrap text-xs",children:h.hint})]},h.id):a(g.Fragment,{children:x},h.id)})})})}s(Sc,"StageStepper");function Tc({items:e,size:r="sm",className:t,...n}){const o=r==="lg",i=m("min-w-0 border-b border-r border-border bg-background",o?"px-4 py-3":"px-3 py-2");return a("div",{className:m("grid grid-cols-2 overflow-hidden rounded-lg border-l border-t border-border bg-background sm:grid-cols-3",o?"xl:grid-cols-5":"md:grid-cols-5",t),...n,children:e.map(l=>{const d=l.value===null||l.value===void 0||l.value===""?a("span",{className:"text-muted-foreground",children:"\u2014"}):l.value,h=u(J,{children:[a("div",{className:"truncate text-xs text-muted-foreground",children:l.label}),a("div",{className:m("truncate font-medium",o?"py-1 text-2xl font-semibold":"text-sm"),children:d}),l.hint&&a("div",{className:"truncate text-xs text-muted-foreground",children:l.hint}),l.footer]});return l.onClick?a("button",{type:"button",onClick:l.onClick,className:m("text-left hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",i),children:h},l.label):a("div",{className:i,children:h},l.label)})})}s(Tc,"KeyMetricBar");function Fc({children:e,className:r,onReset:t,resetLabel:n,...o}){return u("div",{className:m("flex min-w-0 flex-col gap-3 rounded-xl border bg-card p-3 sm:flex-row sm:flex-wrap sm:items-center",r),...o,children:[e,t&&n&&u(K,{type:"button",variant:"ghost",size:"sm",className:"self-start sm:ml-auto",onClick:t,children:[a(oe,{className:"mr-1.5 size-4","aria-hidden":!0}),n]})]})}s(Fc,"FilterToolbar");var hs="application/x-tego-kanban",Nt=hs;function Ac({children:e,label:r,navigation:t,fillHeight:n=!1}){const o=Z(null),i=Z(null),[l,d]=j({previous:!1,next:!1}),h=s(()=>{const c=o.current;if(!c)return;const b=c.scrollLeft>1,p=c.scrollLeft+c.clientWidth<c.scrollWidth-1;d(v=>v.previous===b&&v.next===p?v:{previous:b,next:p})},"measure");X(()=>{if(!t||!o.current||!i.current)return;const c=new ResizeObserver(h);return c.observe(o.current),c.observe(i.current),h(),()=>c.disconnect()},[e,t]);const f=s(c=>{const b=o.current;b&&b.scrollBy({left:c*Math.max(1,b.clientWidth-64),behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})},"move");return t?u("div",{className:m("group relative min-w-0",n&&"min-h-40 flex-1"),children:[a("div",{ref:o,role:"region",tabIndex:0,"aria-label":r,onScroll:h,className:m("min-w-0 overflow-x-auto overflow-y-hidden rounded-xl [scrollbar-width:none] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-scrollbar]:hidden",n&&"absolute inset-0"),onKeyDown:s(c=>{c.target===c.currentTarget&&(c.key==="ArrowLeft"||c.key==="ArrowRight")&&(c.preventDefault(),f(c.key==="ArrowLeft"?-1:1))},"onKeyDown"),children:a("div",{ref:i,className:m("flex items-stretch gap-4 [&>*]:w-72 [&>*]:min-w-0 [&>*]:max-w-full [&>*]:shrink-0",n?"h-full [&>*]:h-full":"[&>*]:min-h-56"),children:e})}),a(K,{type:"button",size:"icon",variant:"outline",className:"absolute left-2 top-1/2 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/95 shadow-md disabled:invisible md:opacity-0 md:group-focus-within:opacity-100 md:group-hover:opacity-100",disabled:!l.previous,"aria-label":t.previous,title:t.previous,onClick:s(()=>f(-1),"onClick"),children:a(Ir,{className:"h-4 w-4"})}),a(K,{type:"button",size:"icon",variant:"outline",className:"absolute right-2 top-1/2 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/95 shadow-md disabled:invisible md:opacity-0 md:group-focus-within:opacity-100 md:group-hover:opacity-100",disabled:!l.next,"aria-label":t.next,title:t.next,onClick:s(()=>f(1),"onClick"),children:a(ce,{className:"h-4 w-4"})})]}):a("div",{role:"region","aria-label":r,className:"flex items-start gap-4 overflow-x-auto pb-4",children:e})}s(Ac,"KanbanBoard");function Ic({id:e,title:r,summary:t,children:n,onMove:o,disabled:i}){return u(Pe,{className:"w-72 shrink-0 bg-muted/30",onDragOver:s(l=>{!i&&l.dataTransfer.types.includes(Nt)&&(l.preventDefault(),l.dataTransfer.dropEffect="move")},"onDragOver"),onDrop:s(l=>{if(i)return;const d=l.dataTransfer.getData(Nt);if(d){l.preventDefault();try{const h=JSON.parse(d);typeof h.id=="string"&&typeof h.column=="string"&&h.column!==e&&o(h.id,h.column,e)}catch{}}},"onDrop"),children:[u(Lr,{className:"space-y-2 p-3",children:[a(Or,{className:"text-sm",children:r}),t]}),a(ar,{className:"min-h-32 space-y-3 p-3 pt-0",children:n})]})}s(Ic,"KanbanColumn");function Mc({id:e,column:r,children:t,disabled:n,label:o}){return a(Pe,{draggable:!n,"aria-label":o,className:m("p-3",!n&&"cursor-grab active:cursor-grabbing"),onDragStart:s(i=>{i.dataTransfer.setData(Nt,JSON.stringify({id:e,column:r})),i.dataTransfer.effectAllowed="move"},"onDragStart"),children:t})}s(Mc,"KanbanItem");function Bc({children:e}){const[r,t]=j(null);return ws(()=>{if(r)return r.showPopover(),()=>r.hidePopover()},[r]),a("div",{ref:t,popover:"manual",className:"pointer-events-none fixed inset-0 m-0 h-auto w-auto overflow-visible border-0 bg-transparent p-0 text-foreground",children:r&&e(r)})}s(Bc,"ViewportLayer");function Pc({label:e,icon:r,items:t,utilityItems:n=[],current:o,onNavigate:i}){const[l,d]=j(!1),h=[...t,...n].find(f=>f.id===o);return a("header",{className:"shrink-0 border-b bg-background @container",children:a(Xe,{delayDuration:300,children:u("div",{className:"flex flex-wrap items-center gap-x-4 px-4 @[860px]:px-6",children:[u("div",{className:"flex h-12 shrink-0 items-center gap-2",children:[r&&a("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary/10 text-primary","aria-hidden":"true",children:r}),a("span",{className:"text-sm font-semibold tracking-wide",children:e})]}),a("nav",{"aria-label":e,className:"order-3 hidden w-full min-w-0 items-center gap-1 overflow-x-auto @[640px]:flex @[860px]:order-none @[860px]:w-auto @[860px]:flex-1",children:t.map(({id:f,label:c,href:b,icon:p})=>a(K,{asChild:!0,variant:"ghost",className:m("relative h-10 shrink-0 gap-2 rounded-none px-3 text-[13px] text-muted-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset @[860px]:h-12",o===f&&"bg-primary/5 font-semibold text-primary after:bg-primary hover:bg-primary/10 hover:text-primary"),children:u("a",{href:b,"aria-current":o===f?"page":void 0,onClick:s(v=>i?.(v,f),"onClick"),children:[p,c]})},f))}),a("div",{className:"ml-auto flex shrink-0 items-center gap-1 border-l pl-3",children:n.map(({id:f,label:c,href:b,icon:p})=>u(be,{children:[a(xe,{asChild:!0,children:a(K,{asChild:!0,variant:"ghost",size:"icon",className:m("h-8 w-8 rounded-lg text-muted-foreground",o===f&&"bg-primary/10 text-primary"),children:a("a",{href:b,"aria-label":c,"aria-current":o===f?"page":void 0,onClick:s(v=>i?.(v,f),"onClick"),children:p})})}),a(ye,{side:"bottom",children:c})]},f))}),a("div",{className:"order-3 w-full pb-2 @[640px]:hidden",children:u(qt,{open:l,onOpenChange:d,children:[a(Yt,{asChild:!0,children:u(K,{variant:"outline",className:"h-9 w-full justify-start gap-2 rounded-lg",children:[h?.icon,h?.label??e,a(Qe,{className:"ml-auto h-4 w-4 text-muted-foreground","aria-hidden":"true"})]})}),a($r,{align:"start",className:"w-[var(--radix-dropdown-menu-trigger-width)]",children:t.map(({id:f,label:c,href:b,icon:p})=>a(zr,{asChild:!0,className:m("gap-3 py-2.5",o===f&&"bg-primary/5 text-primary"),children:u("a",{href:b,"aria-current":o===f?"page":void 0,onClick:s(v=>{i?.(v,f),d(!1)},"onClick"),children:[p,c,o===f&&a(le,{className:"ml-auto h-4 w-4","aria-hidden":"true"})]})},f))})]})})]})})})}s(Pc,"ModuleNavigation");export{dc as AnimatedImagePreview,vr as AppError,sc as AudioPlayer,Vr as Avatar,Gr as AvatarFallback,Wr as AvatarImage,$o as BaseAvatarImage,Zo as BoardColumnsSkeleton,Bi as Breadcrumb,da as CHART_SERIES_TOKENS,sr as Calendar,Xo as CandidateCardSkeleton,so as CapabilityTag,Pe as Card,ar as CardContent,Lt as CardDescription,Ot as CardFooter,Lr as CardHeader,qo as CardListSkeleton,Or as CardTitle,$t as Carousel,zt as CarouselContent,Ut as CarouselItem,Kt as CarouselNext,jt as CarouselPrevious,ao as CascadingTreeSelect,De as Checkbox,oo as Collapsible,lo as CollapsibleContent,io as CollapsibleTrigger,wc as ComboChart,mo as Combobox,Gl as ComponentSuspenseErrorBoundary,wn as ConfirmDialog,yi as ContextMenu,Ka as ContextMenuCheckboxItem,Ua as ContextMenuContent,Ni as ContextMenuGroup,ja as ContextMenuItem,Va as ContextMenuLabel,Ei as ContextMenuPortal,Wa as ContextMenuSeparator,Ci as ContextMenuSub,za as ContextMenuSubContent,$a as ContextMenuSubTrigger,wi as ContextMenuTrigger,tc as DataTable,La as DatePicker,Rc as DateRangePicker,Ba as DeltaIndicator,Zr as Dialog,Di as DialogClose,or as DialogContent,dr as DialogDescription,lr as DialogFooter,ir as DialogHeader,Jr as DialogOverlay,Ha as DialogPortal,cr as DialogTitle,ki as DialogTrigger,Ge as DocFileIcon,Ya as Drawer,an as DrawerBody,nn as DrawerClose,Za as DrawerContent,tn as DrawerDescription,en as DrawerFooter,Ja as DrawerHeader,Qa as DrawerOverlay,rt as DrawerPortal,rn as DrawerTitle,Xa as DrawerTrigger,qt as DropdownMenu,Zt as DropdownMenuCheckboxItem,$r as DropdownMenuContent,fo as DropdownMenuGroup,zr as DropdownMenuItem,ea as DropdownMenuLabel,ho as DropdownMenuPortal,go as DropdownMenuRadioGroup,Jt as DropdownMenuRadioItem,ra as DropdownMenuSeparator,ta as DropdownMenuShortcut,po as DropdownMenuSub,Qt as DropdownMenuSubContent,Xt as DropdownMenuSubTrigger,Yt as DropdownMenuTrigger,Wn as ERROR_MESSAGE_KEYS,Yo as EmployeeCardSkeleton,Mi as EmptyState,Ra as EnhancedInput,bt as ErrorBoundary,zn as ErrorCategory,jn as ErrorDisplayMode,Un as ErrorRecoveryStrategy,$n as ErrorSeverity,Gn as FALLBACK_ERROR_MESSAGES,Ga as FileListRow,Oi as FileUpload,vo as FilterChipRail,Fc as FilterToolbar,Ca as FormWizard,Da as FormWizardNavigation,ka as FormWizardStep,uc as FunnelChart,na as HeroSearch,Ti as HoverCard,ln as HoverCardContent,Fi as HoverCardTrigger,Ur as IDENTITY_HUES,ia as IdentityAvatar,Ai as InfoTip,hs as KANBAN_DRAG_MIME,Ac as KanbanBoard,Ic as KanbanColumn,Mc as KanbanItem,Tc as KeyMetricBar,ei as LibraryCardSkeleton,Jo as ListRowsSkeleton,pa as Loading,To as Logo,Ul as MarkdownRenderer,si as MetricValue,Pc as ModuleNavigation,Fo as OptimizedImage,Io as PageHeader,ri as PageHeaderSkeleton,Po as PageShell,Vl as PageSuspenseErrorBoundary,xt as Pagination,Pa as PanelHeader,Yn as PdfFileIcon,Re as Popover,co as PopoverAnchor,pe as PopoverContent,Se as PopoverTrigger,cn as Progress,Nn as PromptDialog,ro as RadioGroup,to as RadioGroupItem,ll as ResizeHandle,Lo as SCROLLBAR_GUTTER,on as ScrollArea,mr as ScrollBar,Wl as SectionSuspenseErrorBoundary,Oo as Segmented,sn as Separator,F as Skeleton,Ko as SkeletonCard,Vo as SkeletonList,Wo as SkeletonTable,Qo as SkillCardSkeleton,ba as Slider,Qr as SortableTableHead,kc as Sparkline,Sc as StageStepper,Sa as StatCardSkeleton,Go as StatsGridSkeleton,ya as StatusBadge,Na as StatusDot,We as SuspenseErrorBoundary,qr as Table,Xr as TableBody,_a as TableCaption,Ue as TableCell,Oa as TableFooter,ze as TableHead,Yr as TableHeader,$e as TableRow,Ho as TableSkeleton,ti as Tabs,Aa as TabsContent,Ta as TabsList,Fa as TabsTrigger,Ea as TaskEntryTile,at as Toast,un as ToastAction,nt as ToastClose,ot as ToastDescription,Vn as ToastErrorNotificationHandler,dn as ToastProvider,st as ToastTitle,tt as ToastViewport,Vi as ToastViewportOverride,al as Toaster,Ia as ToggleGroup,Ma as ToggleGroupItem,Li as TopProgressBar,zo as Tree,pi as UserPicker,lc as VideoPlayer,Bc as ViewportLayer,cc as VoiceBubble,Cc as WaterfallChart,ua as buildChartTheme,qe as chartScale,ci as contentTabsButtonActiveClassName,li as contentTabsButtonClassName,di as contentTabsButtonInactiveClassName,oi as contentTabsListClassName,ii as contentTabsTriggerClassName,No as contrastRatio,Xl as createErrorMessagesHook,Yl as createToastErrorNotificationHandler,xn as createToastHelpers,gi as datePickerLocales,rc as formatFileSize,He as formatMediaDuration,Ht as getCapabilityTagTone,nr as getCascadingSelectionState,Zn as getFileExtension,ec as getFileIconConfig,ca as hslToRgb,jr as hslTripletToRgb,sa as identityHue,oa as identityStyle,Oe as normalizeCascadingSelection,la as parseHslTriplet,Kr as relativeLuminance,gl as sandboxedFrameHtml,ml as sanitizeTrustedHtml,fl as sanitizeTrustedSvg,xr as scaleFraction,pl as setSandboxedFrameSrcDoc,pr as showErrorToast,bn as showInfoToast,gr as showSuccessToast,vn as showWarningToast,te as toast,nl as toasts,Wt as toggleCascadingSelection,Eo as tokenColor,Le as useCarousel,ko as useChartTheme,dl as useConfirm,Kn as useErrorHandler,Hn as useErrorMessages,ul as usePrompt,il as useResizableWidth,ql as useSuspenseErrorHandler,gn as useToast,ss as waterfallBars,Kl as withErrorBoundary,Hl as withSuspenseErrorBoundary};
|