orbcafe-ui 3.1.1 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +48 -9
- package/dist/index.d.ts +48 -9
- package/dist/index.js +17 -17
- package/dist/index.mjs +20 -20
- package/dist/orbis.css +290 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Qt from'react';import Qt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Rr from'@radix-ui/react-dropdown-menu';import*as qr from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as xr from'@radix-ui/react-dialog';import*as bo from'@radix-ui/react-popover';import eo from'dayjs';import Pf from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import zh from'dayjs/plugin/isBetween';import Vh from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import Uv from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import qy from'react-markdown';import Xy from'remark-gfm';import Yy from'remark-math';import Zy from'rehype-katex';import Qy from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import am from'mermaid';import yx from'dayjs/plugin/isoWeek';var Sg={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},wg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Ts={light:Sg,dark:wg},Hx='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',zx=t=>{let r=Ts[t];return [r.primary,r.p300,r.muted,r.p700]},Vx=10,Wx="0.2s ease";var cc=createContext({mode:"light",setting:"light"}),Ig=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Nn=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=useState("light"),[s,l]=useState(false);useEffect(()=>{l(true);let u=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(u.matches?"dark":"light");return f(),u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{Ig(d);},[d]);let p=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(cc.Provider,{value:p,children:o})},br=()=>useContext(cc).mode,Is=()=>Ts[br()];var tt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),n=t.trim(),a=d=>d.split("").map(p=>p+p).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),p=parseInt(s.slice(2,4),16),u=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${u}, ${o})`}let l=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Mr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};var Dg={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},Ng=t=>typeof t=="number"?`${t}px`:t,Ag={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Eg=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?Ag[r[1]]:void 0},Mt=forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??o,u=Ng(r??Eg(n)??"1em"),f$1={fontFamily:"SAP-icons",fontSize:u,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:u,height:u,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:o,className:n,"data-sap-icon":t,style:f$1,...l,children:String.fromCodePoint(Dg[t])})});Mt.displayName="SapIcon";var oe=(t,r)=>{let o=forwardRef((n,a)=>f(Mt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var pc=oe("activity","Activity"),ya=oe("error","AlertCircle"),uc=oe("warning","AlertTriangle"),a0=oe("down","ArrowDown"),i0=oe("navigationRight","ArrowRight"),mc=oe("up","ArrowUp"),Ms=oe("barChart","BarChart"),s0=oe("activate","Bot"),Rs=oe("calendar","Calendar"),l0=Rs,c0=oe("camera","Camera"),d0=oe("lineChart","ChartNoAxesCombined"),Ur=oe("accept","Check"),Ca=oe("accept","CheckCircle"),Lr=oe("slimDown","ChevronDown"),xa=oe("navigationLeft","ChevronLeft"),Or=oe("navigationRight","ChevronRight"),p0=oe("slimUp","ChevronUp"),u0=oe("expandAll","ChevronsDown"),m0=oe("collapseAll","ChevronsUp"),Sa=oe("error","CircleAlert"),An=oe("accept","CircleCheck"),g0=An,gc=oe("stop","CircleStop"),fc=oe("copy","Clipboard"),f0=oe("checklist","ClipboardCheck"),h0=oe("checklist","ClipboardList"),hc=oe("time","Clock"),b0=oe("tableColumn","Columns3"),ho=oe("copy","Copy"),v0=oe("duplicate","CopyPlus"),y0=oe("delete","Delete"),C0=oe("download","Download"),bc=oe("edit","Edit"),vc=oe("fullScreen","Expand"),x0=oe("show","Eye"),S0=oe("hide","EyeOff"),wa=oe("document","File"),yc=oe("document","FileText"),w0=oe("filter","Filter"),En=oe("tree","FolderTree"),Cc=oe("process","GitBranch"),Ln=oe("world","Globe"),xc=oe("grid","Grid"),k0=oe("move","GripVertical"),P0=oe("wrench","Hammer"),Sc=oe("picture","Image"),ka=oe("information","Info"),T0=oe("translate","Languages"),I0=oe("dimension","Layers"),M0=oe("home","LayoutDashboard"),Pa=oe("lightbulb","Lightbulb"),wc=oe("lineChart","LineChart"),kc=oe("synchronize","Loader2"),Ta=oe("locked","Lock"),R0=Ta,Pc=oe("log","LogOut"),Ds=oe("email","Mail"),Tc=oe("map","MapPin"),D0=oe("menu","Menu"),Lg=oe("message","MessageCircle"),Ic=Lg,Ia=oe("microphone","Mic"),N0=oe("microphone","MicOff"),Mc=oe("darkMode","Moon"),A0=oe("overflow","MoreHorizontal"),E0=oe("accept","PackageCheck"),L0=oe("product","PackageSearch"),Ma=oe("splitOne","PanelLeftOpen"),Ra=oe("splitTwo","PanelRight"),O0=oe("overview","PanelsTopLeft"),Rc=oe("pieChart","PieChart"),Qo=oe("pushpin","Pin"),F0=oe("play","Play"),Da=oe("add","Plus"),B0=oe("qrCode","QrCode"),H0=oe("receipt","ReceiptText"),Na=oe("refresh","RefreshCw"),z0=oe("activate","Rocket"),V0=oe("refresh","RotateCcw"),Dc=oe("refresh","RotateCw"),W0=oe("tableRow","Rows3"),$0=oe("save","Save"),G0=oe("qrCode","ScanLine"),Fr=oe("search","Search"),Og=oe("paperPlane","Send"),Nc=Og,jo=oe("wrench","Settings"),_0=oe("accept","ShieldCheck"),U0=oe("sum","Sigma"),K0=oe("sort","SortAsc"),q0=oe("splitTwo","SquareSplitHorizontal"),X0=oe("favorite","Star"),Ac=oe("lightMode","Sun"),Y0=oe("table","Table2"),Z0=oe("ipad","TabletSmartphone"),On=oe("command","Terminal"),Ec=oe("thumbDown","ThumbsDown"),Lc=oe("thumbUp","ThumbsUp"),Oc=oe("delete","Trash2"),Q0=oe("tree","TreePine"),Fc=oe("trendDown","TrendingDown"),Aa=oe("warning","TriangleAlert"),j0=oe("shipping","Truck"),Bc=oe("upload","UploadCloud"),Ns=oe("employee","User"),Hc=oe("sound","Volume2"),J0=oe("factory","Warehouse"),eS=oe("process","Workflow"),Xt=oe("decline","X"),Ea=oe("error","XCircle");var Bg={contained:"primary",outlined:"secondary",text:"ghost"},Hg={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},ye=forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d$1,className:p,children:u,disabled:f$1,type:h="button",...m},v)=>{let y=Bg[t]??t,g$1=["orb-btn",`orb-btn-${y}`,Hg[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=d(d$1,g$1),b=s??(l?"a":"button");return g(b,{ref:v,type:b==="button"?h:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?f$1||n:void 0,"aria-disabled":b!=="button"&&(f$1||n)?true:void 0,...m,children:[n&&f("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,u,!n&&i]})});ye.displayName="CButton";var He=forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d$1,disabled:p,readOnly:u,required:f$1,autoFocus:h,autoComplete:m,name:v,id:y,error:g$1,helperText:x,dense:b=false,size:C,fullWidth:P=true,select:w=false,multiline:k=false,rows:I,children:S,variant:A,margin:R,onClick:T,startAdornment:N,endAdornment:D,InputProps:L,inputProps:B,InputLabelProps:X,SelectProps:H,sx:K,className:W},G)=>{let z=useId(),O=y??`orb-tf-${z}`,Y=N??L?.startAdornment,Q=D??L?.endAdornment,ie=(typeof g$1=="string"?g$1:void 0)??x,fe={id:O,className:`orb-inp ${b||C==="small"?"orb-inp-dense":""}`,style:P?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:p,required:f$1,autoFocus:h,autoComplete:m,name:v,onClick:T,"aria-invalid":!!g$1},Ge=w?f("select",{...fe,ref:G,onChange:n,children:S}):k?f("textarea",{...fe,ref:G,onChange:n,rows:I,readOnly:u||L?.readOnly}):f("input",{...fe,ref:G,onChange:n,type:l,readOnly:u||L?.readOnly,...B}),Re=d(K,`orb-fld ${g$1?"orb-is-error":""} ${W??""}`,{width:P?"100%":void 0});return g("div",{className:Re.className,style:Re.style,children:[t&&f("label",{htmlFor:O,children:t}),Y||Q?g("div",{className:"orb-inp-adornment-wrap",children:[Y&&f("span",{className:"orb-inp-adornment",children:Y}),Q&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Q}),Ge]}):Ge,ie&&f("span",{className:"orb-fld-msg",children:ie})]})});He.displayName="CTextField";var Fn=forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:p,error:u,helperText:f$1,fullWidth:h=true,name:m,id:v,inputProps:y,sx:g$1,className:x},b)=>{let C=useId(),P=v??`orb-ta-${C}`,k=(typeof u=="string"?u:void 0)??f$1,I=d(g$1,`orb-fld ${u?"orb-is-error":""} ${x??""}`,{width:h?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:P,children:t}),f("textarea",{ref:b,id:P,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:m,"aria-invalid":!!u,...y}),k&&f("span",{className:"orb-fld-msg",children:k})]})});Fn.displayName="CTextArea";var Vt=forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:p=true,minWidth:u,placeholder:f$1,displayEmpty:h,renderValue:m,multiple:v,MenuProps:y,variant:g$1,disableUnderline:x,onClick:b,onMouseDown:C,error:P,helperText:w,name:k,id:I,"aria-label":S,sx:A,className:R},T)=>{let N=useId(),D=I??`orb-sel-${N}`,B=(typeof P=="string"?P:void 0)??w,X=useRef(null),H=useRef(null),[K,W]=useState(false),[G,z]=useState(180),[O,Y]=useState(a??"");useImperativeHandle(T,()=>X.current);let Q=useMemo(()=>Children.toArray(o).flatMap(Pe=>{if(!isValidElement(Pe)||Pe.type!=="option")return [];let Ce=Pe;return [{value:Array.isArray(Ce.props.value)?Ce.props.value[0]??"":Ce.props.value??"",label:Ce.props.children,disabled:Ce.props.disabled}]}),[o]),me=r??Q,ie=n??O,se=Array.isArray(ie)?ie[0]??"":ie,fe=String(se??""),Ge=me.find(Pe=>String(Pe.value)===fe),Re=m?m(ie):Ge?.label??(fe||(f$1??"")),ke=d(A,`orb-fld ${P?"orb-is-error":""} ${R??""}`,{width:p?"100%":void 0,minWidth:typeof u=="number"?`${u}px`:u});if(v)return g("div",{className:ke.className,style:ke.style,children:[t&&f("label",{htmlFor:D,children:t}),g("select",{ref:T,id:D,className:`orb-inp ${d$1||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:k,multiple:true,onClick:b,onMouseDown:C,"aria-invalid":!!P,"aria-label":S,children:[f$1!==void 0&&f("option",{value:"",children:f$1}),r?r.map(Pe=>f("option",{value:Pe.value,disabled:Pe.disabled,children:Pe.label},Pe.value)):o]}),B&&f("span",{className:"orb-fld-msg",children:B})]});let ze=Pe=>{n===void 0&&Y(Pe);let Ce=X.current;Ce&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Ce,Pe),i?.({target:Ce,currentTarget:Ce}));};return g("div",{className:ke.className,style:ke.style,children:[t&&f("label",{htmlFor:D,children:t}),f("select",{ref:X,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:k,value:fe,disabled:s,onChange:()=>{},children:me.map(Pe=>f("option",{value:Pe.value,disabled:Pe.disabled,children:Pe.label},String(Pe.value)))}),g(Rr.Root,{open:K,onOpenChange:Pe=>{Pe&&z(H.current?.getBoundingClientRect().width??180),W(Pe);},children:[f(Rr.Trigger,{asChild:true,children:g("button",{ref:H,id:D,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!P,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!Ge&&!fe?"":void 0,onClick:b,onMouseDown:C,children:[f("span",{className:"orb-select-value",children:Re}),f(Mt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Rr.Portal,{children:f(Rr.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:G},children:f(Rr.RadioGroup,{value:fe,onValueChange:ze,children:me.map(Pe=>g(Rr.RadioItem,{className:"orb-select-option",value:String(Pe.value),disabled:Pe.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(Pe.value)===fe?f(Mt,{name:"accept",size:13}):null}),f("span",{children:Pe.label})]},String(Pe.value)))})})})]}),B&&f("span",{className:"orb-fld-msg",children:B})]})});Vt.displayName="CSelect";var Rt=forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d$1,size:p,color:u,onClick:f$1,inputProps:h,sx:m,className:v},y)=>{let g$1=d([{...p==="small"?{fontSize:13}:void 0,...u?{color:u}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=f("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof y=="function"?y(b):y&&(y.current=b);},type:"checkbox",id:d$1,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f$1,...h});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Rt.displayName="CCheckbox";var Qg=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let u=useId(),f$1=i??`orb-rdo-${u}`;return g("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(h=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:f$1,value:h.value,checked:o!==void 0?o===h.value:void 0,defaultChecked:n!==void 0?n===h.value:void 0,onChange:a?m=>a(m,h.value):void 0,disabled:l||h.disabled}),f("span",{children:h.label})]},h.value))})]})};var La=forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:p},u)=>{let f$1=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${p??""}`),h=f("input",{ref:u,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:f$1.className,style:f$1.style,children:h}):g("label",{className:f$1.className,style:f$1.style,children:[h,f("span",{children:t})]})});La.displayName="CSwitch";var ef={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},kt=forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d$1,onDelete:p,onClick:u,sx:f$1,className:h},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":ef[n]??"gray"),y=s??!!u,g$1=d([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],`orb-chip orb-chip-${v} ${h??""}`);return g("span",{ref:m,className:g$1.className,style:g$1.style,onClick:u,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u?.(x));}:void 0,children:[l??d$1,f("span",{className:"orb-chip-label",children:r??t}),p&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),p(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Xt,{size:13,strokeWidth:2})})]})});kt.displayName="CChip";var Oa=forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let l=d(a,i,{display:"inline-flex",position:o?"relative":void 0}),d$1=!n&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?g("span",{ref:s,className:l.className,style:l.style,children:[o,d$1]}):f("span",{ref:s,className:l.className,style:l.style,children:d$1})});Oa.displayName="CBadge";var Jo=forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let l=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:l.className,style:l.style,children:r?f("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});Jo.displayName="CAvatar";var en=forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let l=d(a,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[g("div",{style:{flex:1,minWidth:0},children:[r&&f("b",{children:r}),o&&f("span",{children:o})]}),n&&f("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});en.displayName="CAlert";var Bn=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=d(n,`orb-prog ${a??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},nf=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Kr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>f("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});var st=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:r}):f(qr.Provider,{delayDuration:o,skipDelayDuration:200,children:g(qr.Root,{children:[f(qr.Trigger,{asChild:true,children:r}),f(qr.Portal,{children:f(qr.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ne=forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:l,type:d$1="button",...p},u)=>{let f$1=d([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),h=f("button",{ref:u,type:d$1,className:f$1.className,style:f$1.style,...p,children:l});return t?f(st,{title:t,children:h}):h});ne.displayName="CIconButton";var Hn=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=useRef([]),d$1=r.findIndex(m=>!m.disabled),p=r.findIndex(m=>m.value===t),u=(m,v)=>{let y=r.map((b,C)=>b.disabled?-1:C).filter(b=>b>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),l.current[x]?.focus(),o(r[x].value));},f$1=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f$1.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(p,0)};return g("div",{role:"radiogroup",className:f$1.className,style:h,"data-has-selection":p>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return f(ne,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===d$1?0:-1,onClick:()=>o(m.value),onKeyDown:g=>u(g,v),children:m.icon??f("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};var Yt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:p,anchorPosition:u,sx:f$1})=>{let h=useRef(null);if(useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();h.current&&g.includes(h.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=d$1?.paper?.sx??p?.sx,b=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],"orb-pop orb-menu",d$1?.paper?.style??p?.style),C=Children.map(l,P=>{if(!isValidElement(P)||P.type!=="option")return P;let w=P.props,{children:k,disabled:I,selected:S}=w,A=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:A.className,style:A.style,onClick:I?void 0:w.onClick,onKeyDown:R=>{!I&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),w.onClick?.(R));},children:k})});return createPortal(f("div",{ref:h,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:n==="end"&&!u?void 0:u?.left??y,right:n==="end"&&!u?Math.max(16,v-g):void 0,top:u?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return g(Rr.Root,{children:[f(Rr.Trigger,{asChild:true,children:o??f(ye,{variant:"primary",children:t})}),f(Rr.Portal,{children:f(Rr.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>g(Rr.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};var Ae=forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...l},d$1)=>{let p=o??"div",u=d(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(p,{ref:d$1,className:u.className,style:u.style,...l,children:s})});Ae.displayName="CPaper";var Nt=forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Nt.displayName="CDivider";var hf={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},bf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d$1,children:p,...u},f$1)=>{let h=r??bf[t]??"span",v=[t==="inherit"?void 0:hf[t],d$1].filter(Boolean).join(" "),y=d([{...o?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],v);return f(h,{ref:f$1,className:y.className,style:y.style,...u,children:p})});E.displayName="CTypography";var yf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ae=forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:p,...u},f$1)=>{let h=d([{display:"flex",flexDirection:t,gap:yf(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:f$1,className:h.className,style:h.style,...u,children:p})});ae.displayName="CStack";var Ht=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:p,disableRestoreFocus:u,keepMounted:f$1,hideCloseButton:h=false,sx:m,className:v})=>{let y=d([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??p?.paper?.sx)?d$1?.sx??p?.paper?.sx:d$1?.sx??p?.paper?.sx?[d$1?.sx??p?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return f(xr.Root,{open:t,onOpenChange:g=>{g||r?.();},children:g(xr.Portal,{children:[f(xr.Overlay,{className:"orb-overlay"}),g(xr.Content,{className:y.className,style:y.style,children:[(o||!h)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?f(xr.Title,{className:"orb-dialog-title",children:o}):f(xr.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&f(xr.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(Xt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Es=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,className:u})=>g(bo.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[f(bo.Trigger,{asChild:true,children:n}),f(bo.Portal,{children:f(bo.Content,{className:`orb-pop ${u??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});var Sf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=useState(o??t[0]?.value),p=s?r:l,u=useRef([]),f$1=m=>{s||d(m),n?.(m);},h=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===p),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f$1(x.value);let b=t.findIndex(C=>C.value===x.value);u.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:h,children:t.map((m,v)=>{let y=m.value===p;return g("button",{ref:g=>{u.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f$1(m.value),children:[m.icon,m.label]},m.value)})})};var kf=["su","mo","tu","we","th","fr","sa"],zn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),Vn=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:u})=>{let f$1=a!==void 0,[h,m]=useState(()=>i??t??r??eo()),v=(f$1?a:h).startOf("month"),y=w=>{f$1||m(w),s?.(w);},g$1=useMemo(()=>p?v.locale(p):v,[v,p]),x=useMemo(()=>{let k=v.startOf("month").startOf("week"),I=[],S=k;for(let A=0;A<6;A+=1){let R=[];for(let T=0;T<7;T+=1)R.push(S),S=S.add(1,"day");if(I.push(R),S.isAfter(v.endOf("month"))&&A>=3)break}return I},[v]),b=useMemo(()=>{let w=p?eo().locale(p):eo();return kf.map((k,I)=>w.startOf("week").add(I,"day").format("dd"))},[p]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),P=r!==void 0||o!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:f(xa,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:f(Or,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((w,k)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${k}`)),x.flat().map(w=>{let k=!w.isSame(v,"month"),I=C(w),S=P?zn(w,r)||zn(w,o):zn(w,t),A=w.isSame(eo(),"day"),R=P&&r&&o&&w.isAfter(r.startOf("day"))&&w.isBefore(o.startOf("day")),T=P&&zn(w,r)&&!!o,N=P&&zn(w,o)&&!!r,D=["orb-cal-day",k?"orb-is-outside":void 0,A?"orb-is-today":void 0,S?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,N?"orb-is-range-end":void 0].filter(Boolean).join(" ");return u?f("span",{className:"orb-cal-day-slot",children:u(w,{outsideCurrentMonth:k,selected:S,today:A,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":A?"date":void 0,className:D,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};eo.extend(Pf);var Tf=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:u=false,error:f$1,helperText:h,sx:m,className:v})=>{let y=r!==void 0,[g$1,x]=useState(o??null),b=y?r:g$1,[C,P]=useState(false),[w,k]=useState(null),I=N=>{y||x(N),n?.(N);},S=w??(b?(p?b.locale(p):b).format(l):""),A=()=>{if(w===null)return;let N=w.trim();if(!N)I(null);else {let D=eo(N,l,true);D.isValid()&&!(a&&D.isBefore(a.startOf("day")))&&!(i&&D.isAfter(i.startOf("day")))&&I(D);}k(null);},T=(typeof f$1=="string"?f$1:void 0)??h;return g("div",{className:`orb-fld ${f$1?"orb-is-error":""} ${v??""}`,style:m,children:[t&&f("label",{children:t}),f(Es,{open:C,onOpenChange:P,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Rs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${u?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>P(true),onChange:N=>k(N.target.value),onBlur:A,onKeyDown:N=>{N.key==="Enter"&&(A(),P(false)),N.key==="Escape"&&P(false);}})]}),children:f(Vn,{value:b,onChange:N=>{I(N),k(null),P(false);},minDate:a,maxDate:i,locale:p,defaultMonth:b??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Mf=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=useState(false),[p,u]=useState([]),f$1=useRef(null),h=b=>{b.preventDefault(),d(true);},m=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let C=n?b.filter(w=>w.size<=n):b;C.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let P=r?[...p,...C]:C;r&&(P=P.filter((w,k,I)=>k===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),u(P),t?.(P),f$1.current&&(f$1.current.value="");},x=b=>{let C=p.filter((P,w)=>w!==b);u(C),t?.(C);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>f$1.current?.click(),onDragOver:h,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f$1.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:f$1,style:{display:"none"},multiple:r,accept:o,onChange:y}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(Bc,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),p.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((b,C)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(yc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),g("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),f(ne,{"aria-label":`Remove ${b.name}`,onClick:()=>x(C),children:f(Oc,{size:15,strokeWidth:1.8})})]},`${b.name}-${C}`))})]})};function mr(...t){return twMerge(clsx(t))}var Ba={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},Wn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},$c=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium 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";var Ef=cva($c(),{variants:{variant:{default:`${Ba.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ba.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Ba.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:Wn.none,sm:Wn.sm,md:Wn.md,full:Wn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Fs=Qt.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:mr(Ef({variant:r,size:o,className:t})),ref:i,...a}));Fs.displayName="Button";var Lf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Of={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Ff={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Bf={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Hf={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},zf={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},$n={en:Lf,zh:Of,fr:Ff,de:Bf,ja:Hf,ko:zf};var _c=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,Gf={locale:"en",t:(t,r)=>_c($n.en[t]||t,r)},Uc=createContext(Gf),Ha=({locale:t="en",messages:r,children:o})=>{let n=useMemo(()=>{let a=$n[t]||$n.en,i=r?.[t]||{},s={...$n.en,...a,...i};return {locale:t,t:(l,d)=>_c(s[l]||l,d)}},[t,r]);return f(Uc.Provider,{value:n,children:o})},de=()=>useContext(Uc);function Gn({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:u}=de(),f$1=s==="dark",h=usePathname(),[m,v]=useState(false),[y,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:y;useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let k=new Set(y);k.has(w)?k.delete(w):k.add(w),g$1(k);}},P=w=>{w.children&&w.children.length>0&&C(w.id),r&&r(w);};return !t||!Array.isArray(t)?f("div",{className:mr("tree-menu",o),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:u("navigation.noItems")})}):f("div",{className:mr("tree-menu",o),children:t.map(w=>{let k=b.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,A=56+Math.max(0,n-1)*8,R=n===0?12:I?A-24:A,T=w.appurl||w.href,N=m&&T?h===T:false,D=d?.has(w.id)??false,L=l&&w.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[N&&f("div",{className:mr("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(Fs,{variant:"ghost",className:mr("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&k&&!N?f$1?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",N?f$1?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:L?"34px":"10px"},onClick:()=>P(w),children:[I&&f("div",{className:mr("flex-shrink-0 transition-transform duration-200",k&&"rotate-90",N?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Or,{className:"h-4 w-4"})}),w.icon&&f("div",{className:mr("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",N?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:mr("text-sm truncate transition-colors duration-200",N?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:mr("text-xs truncate transition-colors duration-200",N?f$1?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.description})]})]}),L&&p&&f("button",{type:"button","aria-label":u(D?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":D,title:u(D?"navigation.pin.remove":"navigation.pin.add"),onClick:B=>{B.preventDefault(),B.stopPropagation(),p(w);},className:mr("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",D&&"orb-is-pinned"),children:f(Qo,{className:mr("h-3.5 w-3.5",D&&"fill-current")})}),I&&f("div",{className:mr("grid transition-[grid-template-rows] duration-300 ease-in-out",k?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:mr("overflow-hidden",k&&"pt-1"),children:f(Gn,{items:w.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},w.id)})})}var qf="orbcafe:navigation-island:pinned-items",Bs="orbcafe-navigation-pinned",Xf=t=>t.appurl||t.href,qc=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&Xf(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...qc(o.children));}),r},Xc=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=qf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=i==="dark",x=s==="floating",b=useRouter(),[C,P]=useState(""),[w,k]=useState(new Set),[I,S]=useState(h),[A,R]=useState(false),T=f$1!==void 0,N=useMemo(()=>f$1??I,[f$1,I]),D=useMemo(()=>new Set(N),[N]);useEffect(()=>{t&&k(new Set);},[t]),useEffect(()=>{if(!p||T){R(true);return}try{let O=window.localStorage.getItem(u);if(O){let Y=JSON.parse(O);Array.isArray(Y)&&S(Y.filter(Q=>typeof Q=="string"));}}catch{}finally{R(true);}},[p,T,u]),useEffect(()=>{if(!(!p||T||!A))try{window.localStorage.setItem(u,JSON.stringify(N));}catch{}},[N,p,T,u,A]),useEffect(()=>{!p||t||N.length===0||k(O=>{if(O.has(Bs))return O;let Y=new Set(O);return Y.add(Bs),Y});},[t,N.length,p]);let L=useCallback(O=>{let Y=Array.from(new Set(O));T||S(Y),m?.(Y);},[T,m]),B=useCallback(O=>{let Y=O.id,Q=D.has(Y)?N.filter(me=>me!==Y):[...N,Y];L(Q);},[N,D,L]),X=useMemo(()=>{if(!p||N.length===0)return a;let O=new Map(qc(a).map(Q=>[Q.id,Q])),Y=N.map(Q=>O.get(Q)).filter(Q=>!!Q);return Y.length===0?a:[{id:Bs,title:v||y("navigation.pinned"),icon:f(Qo,{className:"w-4 h-4"}),children:Y,pinnable:false},...a]},[N,p,a,v,y]),H=useCallback(O=>{let Y=[],Q=me=>{me.forEach(ie=>{Y.push(ie.id),ie.children&&Q(ie.children);});};return Q(O),Y},[]),K=useMemo(()=>{if(!C.trim())return X;let O=Y=>Y.reduce((Q,me)=>{let ie=me.title?.toLowerCase().includes(C.toLowerCase())||me.description?.toLowerCase().includes(C.toLowerCase()),se=me.children?O(me.children):[];return (ie||se.length>0)&&Q.push({...me,children:se.length>0?se:me.children}),Q},[]);return O(X)},[C,X]),W=useMemo(()=>C.trim()?new Set(H(X)):w,[C,X,w,H]),G=useCallback(async O=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",O),O.id==="chat"||O.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{b.push("/chat?new=true");}catch(Q){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Q),b.push("/chat");}return}let Y=O.appurl||O.href;Y&&(Y.startsWith("http://")||Y.startsWith("https://")?window.open(Y,"_blank"):b.push(Y));},[b]),z=useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${g$1?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:f(Fr,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:O=>P(O.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(Fr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:K.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(En,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Gn,{items:K,onItemClick:G,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:p,pinnedIds:D,onTogglePin:B,onToggleExpand:O=>{let Y=new Set(w);K.some(me=>me.id===O)?Y.has(O)?Y.delete(O):(K.forEach(me=>{me.id!==O&&Y.has(me.id)&&Y.delete(me.id);}),Y.add(O)):Y.has(O)?Y.delete(O):Y.add(O),k(Y);}})}),t&&f("div",{className:"space-y-2",children:X.map(O=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{r();let Y=new Set([O.id]);k(Y);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:O.title||""}),children:O.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:O.title?.charAt(0)||"?"})})},O.id))})]})}),!t&&f("button",{onClick:r,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:z,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ma,{className:"h-4 w-4"}):f(Ra,{className:"h-4 w-4"})})]})};var Zf="orbcafe:navigation-island:pinned-items",Hs="orbcafe-navigation-pinned",Yc=t=>t.appurl||t.href,Zc=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&Yc(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...Zc(r.children)]:n}),Qc=t=>t.flatMap(r=>[r.id,...r.children?Qc(r.children):[]]),jc=(t,r)=>t.reduce((o,n)=>{let a=n.children?jc(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),zs=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=Zf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=useRouter(),x=s==="floating",[b,C]=useState(""),[P,w]=useState(new Set),[k,I]=useState(h),[S,A]=useState(false),R=f$1!==void 0,T=f$1??k,N=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!p||R){A(true);return}try{let O=window.localStorage.getItem(u);if(O){let Y=JSON.parse(O);Array.isArray(Y)&&I(Y.filter(Q=>typeof Q=="string"));}}catch{}finally{A(true);}},[p,R,u]),useEffect(()=>{if(!(!p||R||!S))try{window.localStorage.setItem(u,JSON.stringify(T));}catch{}},[T,p,R,u,S]),useEffect(()=>{!p||t||T.length===0||w(O=>{if(O.has(Hs))return O;let Y=new Set(O);return Y.add(Hs),Y});},[t,T.length,p]);let D=useCallback(O=>{let Y=Array.from(new Set(O));R||I(Y),m?.(Y);},[R,m]),L=useCallback(O=>{D(N.has(O.id)?T.filter(Y=>Y!==O.id):[...T,O.id]);},[T,N,D]),B=useMemo(()=>{if(!p||T.length===0)return a;let O=new Map(Zc(a).map(Q=>[Q.id,Q])),Y=T.map(Q=>O.get(Q)).filter(Q=>!!Q);return Y.length===0?a:[{id:Hs,title:v||y("navigation.pinned"),icon:f(Qo,{className:"h-4 w-4"}),children:Y,pinnable:false},...a]},[T,p,a,v,y]),X=b.trim().toLocaleLowerCase(),H=useMemo(()=>X?jc(B,X):B,[B,X]),K=useMemo(()=>X?new Set(Qc(H)):P,[P,H,X]),W=useCallback(O=>{w(Y=>{let Q=new Set(Y),me=H.some(ie=>ie.id===O);return Q.has(O)?Q.delete(O):(me&&H.forEach(ie=>Q.delete(ie.id)),Q.add(O)),Q});},[H]),G=useCallback(O=>{let Y=Yc(O);Y&&(O.id==="chat"||O.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(Y)?window.open(Y,"_blank","noopener,noreferrer"):g$1.push(Y));},[g$1]),z=O=>{r(),w(new Set([O.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${o}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:r,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:f(Fr,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),f(Fr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:b,onChange:O=>C(O.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:H.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(En,{className:"h-5 w-5"}):y(X?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:B.map(O=>f("button",{type:"button",onClick:()=>z(O),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:O.title||O.label||""}),children:O.icon||f(En,{className:"h-5 w-5"})},O.id))}):f(Gn,{items:H,onItemClick:G,className:"space-y-1",expandedIds:K,onToggleExpand:W,colorMode:i,enablePinning:p,pinnedIds:N,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ma,{className:"h-4 w-4"}):f(Ra,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:r,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};zs.displayName="NavigationIsland2";var ed=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[u,f]=useState(r),[h,m]=useState(o),[v,y]=useState(n),g=useCallback(()=>{f(C=>!C);},[]),x=useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:u,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[u,g,v,h,m,a,i,s,l,d,p]);return {collapsed:u,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:b}};var Ws=class{constructor(){a(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},oo=new Ws,xP={success:(t,r)=>oo.show("success",t,r),error:(t,r)=>oo.show("error",t,r),warning:(t,r)=>oo.show("warning",t,r),info:(t,r)=>oo.show("info",t,r),show:(t,r,o)=>oo.show(t,r,o),hide:()=>oo.hide()};var jf={success:{icon:f(An,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Aa,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Sa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(ka,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Kn=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:u}=de(),f$1=i||u("messageBox.confirm"),h=s||u("messageBox.cancel"),m=()=>{a?a():n();},v=jf[p],y=p!=="default";return g(Ht,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&f("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),f("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(ye,{onClick:n,variant:"text",children:h}),f(ye,{onClick:m,variant:"contained",color:y&&p==="error"?"error":"primary",autoFocus:true,children:f$1})]})]})},RP=()=>{let[t,r]=Qt__default.useState(null),[o,n]=Qt__default.useState(false);Qt__default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return oo.register(s),()=>oo.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?f(Kn,{open:o,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var LP=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=f(An,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=f(Sa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=f(Aa,{size:14,strokeWidth:2}),a="Warning"),f(kt,{label:a,tone:o,icon:r&&n?n:void 0})};var BP=({dense:t,sx:r,className:o,children:n,...a})=>f("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),HP=({button:t,divider:r,sx:o,className:n,children:a,...i})=>f("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),zP=({sx:t,className:r,children:o,...n})=>f("button",{...n,type:"button",className:r,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:o}),VP=({children:t,sx:r})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),WP=({primary:t,secondary:r,sx:o})=>g("div",{style:{flex:1,minWidth:0,...o},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&f("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),$P=({sx:t,className:r,children:o,...n})=>f("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),GP=({children:t,sx:r})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});var KP=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let l=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};var Dr=tt,nr=(t,r)=>forwardRef(({component:o,sx:n,className:a,style:i,children:s,...l},d$1)=>{let p=o??t,u=d(n,[r,a].filter(Boolean).join(" "),i);return f(p,{ref:d$1,className:u.className,style:u.style,...l,children:s})}),we=nr("div"),rd=nr("a","orb-link"),Oo=Ae,od=ae,gr=E;var nd=ne;var ad=Nt,Yr=en,Ka=Jo,qa=Oa;var Xa=La,id=Kr,sd=({value:t,variant:r,color:o,sx:n})=>f(Bn,{value:r==="determinate"?t:void 0,color:o,sx:n}),ld=nr("table","orb-tbl"),cd=nr("tbody"),_s=nr("td"),dd=nr("div","orb-table-container"),pd=nr("thead"),Us=nr("tr");nr("tfoot");nr("div","orb-dialog-title");nr("div","orb-dialog-content");nr("div","orb-dialog-actions");nr("p","orb-body-dense");var no=nr("span","orb-input-adornment"),ud=forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=d(t,["orb-input-base",o].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var vo=nr("div","orb-form-control"),qn=({control:t,label:r,...o})=>g("label",{className:"orb-form-control-label",...o,children:[t,f("span",{children:r})]}),nh=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??o,r?f("small",{children:r}):null]}),ah=nr("span","orb-list-item-icon"),$t=nh,Br=ah;nr("div","orb-list-subheader");var Ks=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let u={},f$1=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return n!==void 0&&(u.xs=f$1(n)),a!==void 0&&(u.sm=f$1(a)),i!==void 0&&(u.md=f$1(i)),s!==void 0&&(u.lg=f$1(s)),l!==void 0&&(u.xl=f$1(l)),f(we,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?u:void 0,...d??{}}})},tn=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:f("div",{hidden:!t,...n,children:r}),md=({children:t,container:r})=>typeof document>"u"?null:createPortal(t,r??document.body),gd=nr("div","orb-toolbar"),fd=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let l=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return g("button",{type:"button",className:l.className,style:l.style,"data-direction":r,...s,children:[f("span",{className:"orb-table-sort-content",children:o}),f(Mt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},Ya=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:p,style:u,...f$1})=>{let h=useRef(null);if(useEffect(()=>{if(!t)return;let x=C=>{let P=C.composedPath();h.current&&P.includes(h.current)||r&&P.includes(r)||o?.();},b=C=>{C.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",b,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(y,["orb-pop",v?.className,p].filter(Boolean).join(" "),{...v?.style,...u});return createPortal(f("div",{...f$1,ref:h,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},hd=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(a?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},bd=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(o,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),vd=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>f("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var ar=()=>c(),yo=(t,r)=>Mr(t);var yd=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d$1=d(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>r?.(t),...l,children:t.date()})},Cd=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(Vn,{value:t,month:r,onChange:p=>o?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,u)=>l.day?.({day:p,selected:u.selected,outsideCurrentMonth:u.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...d}),xd=({children:t})=>f(e,{children:t}),Ua=class{};var ih=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,be=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d$1})=>{let p=d(a,i,s);return f(Mt,{name:t,size:ih(o,n),className:p.className,style:p.style,"aria-label":d$1["aria-label"]??l,...d$1})},Co=be("tree"),Fo=be("add"),Sd=be("duplicate"),qs=be("down"),wd=be("navigationRight"),kd=be("navigationRight"),Xs=be("up"),Pd=be("delete"),Td=be("camera"),Id=be("accept"),Md=be("accept"),Za=be("navigationRight"),Rd=be("dimension"),Dd=be("decline"),xo=be("decline"),Nd=be("decline"),Ad=be("decline"),Qa=be("delete"),ja=be("delete"),Ed=be("download"),Ld=be("move"),Od=be("edit"),rn=be("slimDown"),Fd=be("filter"),on=be("sum"),Bd=be("wrench"),Hd=be("lineChart"),zd=be("document"),Hr=be("slimDown"),Vd=be("navigationLeft"),So=be("navigationRight"),Ja=be("slimUp"),ei=be("navigationLeft"),ti=be("navigationRight"),Wd=be("dimension"),$d=be("splitOne"),ri=be("menu"),Gd=be("microphone"),_d=be("microphone"),Ud=be("microphone"),Kd=be("qrCode"),wo=be("save"),Bo=be("search"),qd=be("search"),Xd=be("paperPlane"),Yd=be("paperPlane"),Zd=be("wrench"),Qd=be("sort"),oi=be("splitTwo"),jd=be("favorite"),Jd=be("favorite"),ep=be("stop"),tp=be("tableRow"),ni=be("collapseAll"),ai=be("expandAll"),nn=be("tableColumn"),rp=be("overview"),op=be("hide");var lh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],ap=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Sr=t=>String(t),ip=(t,r)=>t[r],sp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},ch=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:sp(t))},dh=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},lp=({value:t=null,items:r=[],columns:o,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:p="Open value help",noResultsText:u="No matching values",loading:f$1=false,clearable:h=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:b=sp,getOptionLabel:C=ch,getOptionDescription:P=dh,onChange:w,onSearch:k,disabled:I,InputProps:S,onFocus:A,onBlur:R,onKeyDown:T,error:N,helperText:D,...L})=>{let B=br(),X=n==="multiple",[H,K]=useState(false),[W,G]=useState(false),[z,O]=useState(""),[Y,Q]=useState(null),[me,ie]=useState(false),[se,fe]=useState(()=>ap(t)),[Ge,Re]=useState(""),[ke,ze]=useState(""),Pe=useMemo(()=>o&&o.length>0?o:lh,[o]),Ce=Y??r,Ve=useMemo(()=>{let J=[...g$1,...r,...Y??[]],Te=new Map;return J.forEach(Ie=>{Te.set(Sr(b(Ie)),Ie);}),Te},[b,r,Y,g$1]),rt=useMemo(()=>ap(t),[t]),at=useMemo(()=>rt.map(String).join(", "),[rt]);useEffect(()=>{H||fe(rt);},[H,rt]),useEffect(()=>{!W&&!ke&&Re(at);},[W,at,ke]);let Ye=useMemo(()=>{let J=z.trim().toLowerCase();if(!J||k)return Ce;let Te=Pe.filter(Ie=>Ie.searchable!==false);return Ce.filter(Ie=>[b(Ie),C(Ie),P(Ie),...Te.map(ut=>ip(Ie,ut.field))].some(ut=>String(ut??"").toLowerCase().includes(J)))},[Ce,P,C,b,k,z,Pe]),_=useMemo(()=>{if(x!==void 0)return x;if(rt.length===0)return "";let J=Te=>{let Ie=Ve.get(Sr(Te));if(!Ie)return String(Te);let Ze=C(Ie);return Ze&&Ze!==String(Te)?`${Te} - ${Ze}`:String(Te)};return X?rt.length>2?`${rt.length} selected`:rt.map(J).join(", "):J(rt[0])},[x,C,X,Ve,rt]),Oe=useCallback(async()=>{if(k){ie(true);try{let J=await k(z);Array.isArray(J)&&Q(J);}finally{ie(false);}}},[k,z]),ve=()=>{I||(fe(rt),K(true));},Ee=()=>{K(false);},it=()=>{w?.(X?[]:null,X?[]:null),fe([]),Re(""),ze("");},je=J=>{let Te=b(J);if(X){fe(Ie=>Ie.some(ut=>Sr(ut)===Sr(Te))?Ie.filter(ut=>Sr(ut)!==Sr(Te)):[...Ie,Te]);return}fe([Te]);},ht=()=>{let J=se.map(Te=>Ve.get(Sr(Te))).filter(Te=>!!Te);X?w?.(se,J):w?.(se[0]??null,J[0]??null),ze(""),K(false);},xt=J=>{if(J.key==="F4"){J.preventDefault(),ve();return}if(J.key==="Enter"&&m&&!Et(Ge,true)){J.preventDefault();return}T?.(J);},At=J=>v?J.every(Te=>Ve.has(Sr(Te))):true,Et=(J,Te)=>{if(X){let Ze=J.split(/[,;\n]/).map(dt=>dt.trim()).filter(Boolean);if(Ze.length===0)return ze(""),w?.([],[]),true;if(!At(Ze))return Te&&ze(y),false;ze("");let ut=Ze.map(dt=>Ve.get(Sr(dt))).filter(dt=>!!dt);return w?.(Ze,ut),true}let Ie=J.trim();return Ie?At([Ie])?(ze(""),w?.(Ie,Ve.get(Sr(Ie))??null),true):(Te&&ze(y),false):(ze(""),w?.(null,null),true)},te=J=>{if(!m)return;let Te=J.target.value;Re(Te),ze(""),Et(Te,false);},ot=f$1||me,Fe=rt.length>0,ge=m&&(W||!!ke)?Ge:_;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",h&&Fe&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:ge,error:!!ke||N,helperText:ke||D,onChange:te,onFocus:J=>{G(true),Re(at),A?.(J);},onBlur:J=>{m&&Et(Ge,true),G(false),R?.(J);},onKeyDown:xt,InputProps:{...S,readOnly:!m,endAdornment:g("span",{className:"orb-value-help-actions",children:[ot?f(Kr,{size:18}):null,h&&Fe&&!I?f(ne,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:J=>J.preventDefault(),onClick:J=>{J.stopPropagation(),it();},children:f(Mt,{name:"decline",size:14})}):null,f(ne,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:J=>J.preventDefault(),onClick:J=>{J.stopPropagation(),ve();},disabled:I,children:f(Mt,{name:"search",size:16})})]})}}),g(Ht,{open:H,onClose:Ee,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:J=>({borderRadius:2,overflow:"hidden",border:`1px solid ${J.palette.divider}`,boxShadow:B==="dark"?`0 24px 80px ${tt(J.palette.common.black,.72)}`:`0 24px 80px ${tt(J.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:J=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${J.palette.divider}`,bgcolor:J.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),X?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${se.length} selected`}):null]}),f(ne,{"aria-label":"Close",onClick:Ee,size:"small",children:f(xo,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ae,{direction:{xs:"column",sm:"row"},spacing:1,sx:J=>({px:2.5,py:1.5,borderBottom:`1px solid ${J.palette.divider}`,bgcolor:B==="dark"?tt(J.palette.common.white,.025):tt(J.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:z,placeholder:i,onChange:J=>O(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(J.preventDefault(),Oe());},InputProps:{startAdornment:f(no,{position:"start",children:f(Mt,{name:"search",size:16})}),sx:J=>({borderRadius:1,bgcolor:J.palette.background.paper,"& fieldset":{borderColor:tt(J.palette.text.primary,B==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(J.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:J.palette.primary.main}})}}),k?f(ye,{variant:"outlined",onClick:()=>{Oe();},disabled:ot,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:ot?f(Kr,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:J=>({bgcolor:B==="dark"?"var(--orb-canvas)":J.palette.background.paper,borderBottom:`1px solid ${J.palette.divider}`})}),Pe.map(J=>f("td",{align:J.align==="inherit"?void 0:J.align,sx:Te=>({minWidth:J.minWidth,width:J.width,fontSize:"0.78rem",fontWeight:800,bgcolor:B==="dark"?"var(--orb-canvas)":Te.palette.background.paper,borderBottom:`1px solid ${Te.palette.divider}`}),children:J.label},String(J.field)))]})}),g("tbody",{children:[Ye.map(J=>{let Te=b(J),Ie=se.some(Ze=>Sr(Ze)===Sr(Te));return g("tr",{hover:true,selected:Ie,onClick:()=>je(J),onDoubleClick:()=>{X||(fe([Te]),w?.(Te,J),K(false));},sx:Ze=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(Ze.palette.primary.main,B==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(Ze.palette.primary.main,B==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Rt,{size:"small",checked:Ie})}),Pe.map(Ze=>{let ut=ip(J,Ze.field);return f("td",{align:Ze.align==="inherit"?void 0:Ze.align,sx:{fontSize:"0.82rem",py:1},children:Ze.render?Ze.render(ut,J):String(ut??"")},String(Ze.field))})]},Sr(Te))}),Ye.length===0?f("tr",{children:f("td",{colSpan:Pe.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:u})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:J=>({px:2.5,py:1.5,borderTop:`1px solid ${J.palette.divider}`,bgcolor:J.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[h&&(Fe||se.length>0)?f(ye,{onClick:it,children:l}):null,f("div",{sx:{flex:1}}),f(ye,{onClick:Ee,children:d}),f(ye,{variant:"contained",onClick:ht,disabled:!X&&se.length===0,children:s})]})]})]})};var ii=({title:t,hideHeader:r,children:o})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var Ys={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Zs={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Xn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Yn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},cp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},lr={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var ph={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},si=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),l=r.length>0?r:[20,50,100,-1],d=Math.max(0,o),p=t===-1?1:Math.max(1,Math.ceil(n/t)),u=Math.min(d+1,p),f$1=d>0,h=d<p-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(st,{title:s("table.toolbar.itemsPerPage"),children:f(Vt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:ph,children:l.map(m=>f("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ne,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f$1,sx:lr,children:f(Vd,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:u,total:p}),children:[u," / ",p]}),f(ne,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!h,sx:lr,children:f(So,{})})]})};var li=({value:t="",onChange:r})=>{let{t:o}=de();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:f(no,{position:"start",children:f(Bo,{size:16})})}})})};var ci=t=>{let{t:r}=de(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(gd,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(li,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(si,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?f("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>f(Qt__default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(st,{title:r("table.toolbar.groupBy"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(qa,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Co,{})})})}),f(st,{title:r("table.toolbar.summary"),children:f(ne,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:lr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(on,{})})}),f(st,{title:r("table.toolbar.columns"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(nn,{})})}),f(st,{title:r("table.toolbar.export"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:t.handleExport,children:f(Ed,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(st,{title:r("table.toolbar.newItem"),children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:lr,children:f(Fo,{})})}),t.showEditButton&&f(st,{title:r("table.toolbar.editItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:lr,children:f(Od,{})})})}),t.showDeleteButton&&f(st,{title:r("table.toolbar.deleteItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...lr,color:"error.main"},children:f(Qa,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(st,{title:r("table.toolbar.graphicReport"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:t.onOpenGraphReport,children:f(Hd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(st,{title:r("table.toolbar.saveLayout"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.onLayoutSave(l),children:f(wo,{})})}),t.layoutManager]})]})]})})};var di=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [di.Translate.toString(t),di.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});var pi=t=>{let{t:r}=de(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:u,visibleColumns:f$1,selectionMode:h,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g$1,columnWidths:x,enableColumnReorder:b=false,disableSorting:C=false}=t,[P,w]=useState(null),k=useRef(null),I=W=>G=>{C||P||d(W);},S=(W,G,z)=>{W.preventDefault(),W.stopPropagation(),w(G),k.current={startX:W.clientX,startWidth:z,colId:G},document.addEventListener("mousemove",A),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},A=W=>{if(!k.current)return;let{startX:G,startWidth:z,colId:O}=k.current,Y=W.clientX-G,Q=Math.max(50,z+Y);g$1&&g$1(O,Q);},R=()=>{w(null),k.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R);},[]);let T=h==="multiple"||h==="single",N=m.length>0&&!!y,D=r(v?"table.group.collapseAll":"table.group.expandAll"),L=u.filter(W=>f$1.includes(W.id)),B=new Map(i.map((W,G)=>[W.field,{...W,priority:G+1}])),X=L.map(W=>{let G=x?.[W.id]||W.minWidth||100,z=B.get(W.id);return f(yh,{headCell:W,width:typeof G=="number"?G:100,order:n,orderBy:a,multiSortInfo:C?void 0:z,onRequestSort:I(W.id),onContextMenu:p,onResizeMouseDown:O=>S(O,W.id,typeof G=="number"?G:100),enableColumnReorder:b,disableSorting:C},W.id)}),H=L.map(W=>W.id),K=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Rt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:h==="single",sx:Xn})}),N&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(st,{title:D,children:f(ne,{size:"small",onClick:W=>{W.stopPropagation(),y?.(!v);},sx:Yn,children:v?f(ni,{}):f(ai,{})})})}),b?f(SortableContext,{items:H,strategy:horizontalListSortingStrategy,children:X}):X]});return f("thead",{children:K})},yh=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:u,attributes:f$1,listeners:h,transform:m,transition:v,isDragging:y}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:di.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?o:"asc"),b=!p&&(!!a||n===t.id);return g("th",{ref:d?u:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":b?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g$1},...d?f$1:{},...d?h:{},children:[p?f("span",{className:"orb-table-head-label",children:t.label}):f(fd,{className:"orb-table-head-sort",active:b,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};var ui=t=>{let{t:r}=de(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:u=[],isGroupFullyExpanded:f$1,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g$1,getGroupRowProps:x}=t,b=k=>a.indexOf(k)!==-1,C=p==="multiple"||p==="single",P=u.length>0,w=n.length+(C?1:0)+(P?1:0);return g("tbody",{children:[o.map((k,I)=>{if(k.type==="group"){let S=d.has(k.id),A=k.childIds||[],R=A.filter(W=>b(W)).length,T=A.length>0&&R===A.length,N=R>0&&R<A.length,D={entry:k,data:k,id:k.id,index:I,selected:T,group:true},L=x?.(D)||{},{className:B,onClick:X,...H}=L,K=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(T){let G=a.filter(z=>!A.includes(z));t.onSelectionChange(G);}else {let G=Array.from(new Set([...a,...A]));t.onSelectionChange(G);}};return g("tr",{...H,"data-ctable-row-key":y?.(D),className:["orb-table-group-row",B].filter(Boolean).join(" "),onClick:X,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[C&&f("td",{padding:"checkbox",sx:Ys,children:f(Rt,{size:"small",checked:T,indeterminate:N,onChange:K,onClick:W=>W.stopPropagation(),sx:Xn})}),P&&f("td",{padding:"checkbox",sx:Zs,children:g("div",{sx:cp,children:[u.length>1&&k.level<u.length-1&&f(st,{title:f$1?.(k.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:f(ne,{size:"small",onClick:()=>{f$1?.(k.id)?m?.(k.id):h?.(k.id);},sx:Yn,children:f$1?.(k.id)?f(ni,{}):f(ai,{})})}),f(ne,{size:"small",onClick:()=>l&&l(k.id),sx:Yn,children:S?f(Hr,{}):f(So,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:k.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[k.field,": ",k.value," (",k.count,")"]})})]},k.id)}else {let S=k.data||k,A=k.id||S.id||I,R=b(A),T=`enhanced-table-checkbox-${I}`,N={entry:k,data:S,id:A,index:I,selected:R,group:false},D=g$1?.(N)||{},{className:L,onClick:B,...X}=D,K=(k.level!==void 0?k.level:0)*4;return g("tr",{...X,"data-ctable-row-key":y?.(N),className:[R?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:W=>{B?.(W),W.defaultPrevented||i?.(W,S);},role:C?"checkbox":X.role,"aria-checked":C?R:X["aria-checked"],tabIndex:X.tabIndex??-1,children:[C&&f("td",{padding:"checkbox",sx:Ys,children:f(Rt,{color:"primary",checked:R,inputProps:{"aria-labelledby":T},sx:Xn})}),P&&f("td",{padding:"checkbox",sx:Zs}),s.filter(W=>n.includes(W.id)).map((W,G)=>{let O=G===0&&K>0?{pl:K+2}:{};return f("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:O,children:W.render?W.render(S[W.id],S):(function(){let Q=S[W.id];if(W.numeric){if(typeof Q=="number")return Q.toLocaleString();if(typeof Q=="string"&&Q.trim()!==""&&!isNaN(Number(Q)))return Number(Q).toLocaleString()}return Q})()},W.id)})]},A)}}),o.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};var dp=t=>{let{columns:r=[],visibleColumns:o,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,p=r.filter(u=>o.includes(u.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[l&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(u=>f("td",{className:`orb-table-footer-cell ${u.numeric?"orb-num":""}`,style:{width:s[u.id]||u.minWidth||100,minWidth:s[u.id]||u.minWidth||100,maxWidth:s[u.id]||u.minWidth||100},children:(function(){let h=n[u.id];return h==null||h===""?"":typeof h=="number"?h.toLocaleString():typeof h=="string"&&h.trim()!==""&&!isNaN(Number(h))?Number(h).toLocaleString():h})()},u.id))]})})};var pp=t=>{let{t:r}=de();return f("div",{sx:{p:2},children:f(E,{children:r("table.mobile.notImplemented")})})};var ln=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,l]=useState(o);useEffect(()=>{t&&l(o);},[t,o]);let d=()=>{l(o),r(null);},p=f=>{l(h=>h.includes(f)?h.filter(m=>m!==f):[...h,f]);},u=()=>{n(s),r(null);};return g(Yt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(ye,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Nt,{className:"orb-table-group-menu-divider"}),a.map(f$1=>{let h=s.includes(f$1.id),m=s.indexOf(f$1.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),p(f$1.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Rt,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),f($t,{className:"orb-table-group-menu-label",primary:f$1.label}),h&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f$1.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(ye,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(ye,{size:"small",variant:"primary",onClick:u,children:i("common.ok")})]})]})},cn=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[f("option",{disabled:true,children:f($t,{primary:i("table.menu.visibleColumns")})}),f(Nt,{}),o.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Rt,{checked:n.includes(s.id),size:"small"}),f($t,{primary:s.label})]},s.id))]})},mi=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=de();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[f("option",{children:f(qn,{control:f(Xa,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),f(Nt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!o,children:[f(Rt,{checked:i.includes(d.id),size:"small"}),f($t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&f("option",{disabled:true,children:f($t,{primary:l("table.menu.noNumericColumns")})})]})},gi=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:r,children:i("common.copy")}),f(Nt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Br,{children:n.includes(s.id)&&f(Id,{fontSize:"small"})}),f($t,{children:s.label})]},s.id))]})},fp=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:u,onSortDesc:f$1,onClearSort:h,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g$1})=>{let{t:x}=de(),b=t?.columnId??"",C=o.find(T=>T.id===b),P=a.includes(b),w=i.includes(b),k=!!C?.numeric,I=l.find(T=>T.field===b),S=I?I.direction==="asc":d===b&&p==="asc",A=I?I.direction==="desc":d===b&&p==="desc",R=S||A;return g(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f($t,{primary:C?.label??b})}),f(Nt,{}),g("option",{onClick:()=>{u(b),r();},selected:S,children:[f(Br,{children:f(Xs,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{f$1(b),r();},selected:A,children:[f(Br,{children:f(qs,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortDesc")})]}),R&&g("option",{onClick:()=>{h(b),r();},children:[f(Br,{children:f(Rd,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),r();},children:[f(Br,{children:f(Fo,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.configureSort")})]}),f(Nt,{}),g("option",{onClick:()=>{v(b),r();},selected:P,children:[f(Br,{children:f(Co,{fontSize:"small"})}),f($t,{primary:x(P?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),k&&s&&g("option",{onClick:()=>{y(b),r();},selected:w,children:[f(Br,{children:f(on,{fontSize:"small"})}),f($t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Nt,{}),g("option",{onClick:()=>{m(b),r();},children:[f(Br,{children:f(op,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.hideColumn")})]})]})},hp=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let p=useMemo(()=>new Set(l.map(y=>y.field)),[l]),u=useMemo(()=>o.filter(y=>!p.has(y.id)),[o,p]),f$1=()=>{let y=u[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((x,b)=>b!==y));},m=(y,g)=>{d(x=>x.map((b,C)=>C===y?{...b,...g}:b));},v=(y,g)=>{d(x=>{let b=y+g;if(b<0||b>=x.length)return x;let C=[...x],[P]=C.splice(y,1);return C.splice(b,0,P),C});};return f(Ht,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(ye,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(ye,{variant:"neutral",onClick:r,children:s("common.cancel")}),f(ye,{variant:"primary",onClick:()=>{a(l),r();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(ae,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g$1)=>{let x=new Set(l.filter((C,P)=>P!==g$1).map(C=>C.field)),b=o.filter(C=>!x.has(C.id));return g("div",{className:"orb-table-sort-rule",children:[f(qa,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(Vt,{size:"small",value:y.field,onChange:C=>m(g$1,{field:C.target.value}),options:b.map(C=>({value:C.id,label:C.label}))}),f(Vt,{size:"small",value:y.direction,onChange:C=>m(g$1,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(Xs,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===l.length-1,children:f(qs,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g$1),children:f(ja,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(ye,{size:"small",onClick:f$1,disabled:u.length===0,startIcon:f(Fo,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var Zn=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),bp=({kpis:t})=>{let{t:r}=de(),o=[{label:r("graph.kpi.totalRecords"),value:Zn(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:Zn(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:Zn(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:Zn(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:Zn(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>g(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(E,{variant:"caption",muted:true,children:n.label}),f(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};var fi=({title:t,subtitle:r,children:o})=>g(Ae,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),r&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});var Qn=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return r==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),f(E,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),g(E,{variant:"caption",muted:true,children:[l.value.toFixed(1),o]})]},l.name))}):f(ae,{spacing:1,children:t.map(l=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:l.name,children:l.name}),f("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:f("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),o]})]},l.name))})};var vp=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(h=>h.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,u=t.map((h,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(h.value-l)/p*(n-i*2);return {x:v,y,...h}}),f$1=u.map(h=>`${h.x},${h.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f$1}),u.map(h=>f("circle",{cx:h.x,cy:h.y,r:4,style:{fill:r}},h.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),g(E,{variant:"caption",muted:true,children:[h.value.toFixed(1),o]})]},h.name))})]})};var yp=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(u=>u.barValue),1),l=Math.max(...t.map(u=>u.lineValue),1),d=t.map((u,f)=>{let h=(a-i*2)/t.length,m=Math.max(h*.5,8),v=i+f*h+(h-m)/2,y=u.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:u}}),p=t.map((u,f)=>{let h=(a-i*2)/t.length,m=i+f*h+h/2,v=n-i-u.lineValue/l*(n-i*2);return {x:m,y:v,item:u}});return g(ae,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(u=>f("rect",{x:u.x,y:u.y,width:u.barWidth,height:Math.max(u.barHeight,4),rx:6,style:{fill:r}},u.item.name)),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:p.map(u=>`${u.x},${u.y}`).join(" ")}),p.map(u=>f("circle",{cx:u.x,cy:u.y,r:3.5,style:{fill:o}},`${u.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(u=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:u.name,sx:{display:"block"},children:u.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",u.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",u.lineValue.toFixed(1)]})]},u.name))})]})};var Ch=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},Cp=({data:t})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[f("div",{}),r.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return f("div",{sx:{height:36,borderRadius:1,background:Ch(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var xh=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],hi=({data:t,variant:r="donut",colors:o=xh,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let u=s;return s+=d.percent,`${o[p%o.length]} ${u}% ${s}%`});return g(ae,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ae,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:o[p%o.length]}}),f(E,{variant:"caption",sx:{flex:1},children:d.name}),g(E,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var xp=({effect:t,branches:r})=>{if(r.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return g(ae,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};var Sp=({data:t,height:r=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let h=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:h,end:m,delta:m-h}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,u=f=>r-d-(f-i)/p*(r-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${l} ${r}`,style:{width:"100%",height:r},children:[f("line",{x1:d,y1:u(0),x2:l-d,y2:u(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f$1,h)=>{let m=(l-d*2)/n.length,v=Math.max(m*.55,8),y=d+h*m+(m-v)/2,g$1=u(Math.max(f$1.start,f$1.end)),x=u(Math.min(f$1.start,f$1.end)),b=f$1.type==="total"?"var(--orb-chart-1)":f$1.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:y,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:b}}),f("text",{x:y+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f$1.end.toFixed(1)})]},f$1.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f$1=>f(E,{variant:"caption",title:f$1.name,children:f$1.name},f$1.name))})]})};var jn=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},CM=(t,r=360)=>{let o=jn(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var wp=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?jn({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var bi=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var kp=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||bi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Pp=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=de();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(fi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(Qn,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(fi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(Qn,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(fi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(hi,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var wh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],kh=["zh","en","de","fr","ja","ko"],Tp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=wh,promptLangOptions:i=kh,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[u,f$1]=useState(o),[h,m]=useState(d||""),[v,y]=useState(p||""),[g$1,x]=useState(false);useEffect(()=>{t&&(f$1(o),m(d||""),y(p||""));},[t,o,d,p]);let b=(P,w)=>{f$1(k=>({...k,[P]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:u,analysisTemplateId:h||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return g(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(ne,{onClick:r,sx:{position:"absolute",right:12,top:12},children:f(xo,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ae,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(He,{size:"small",value:u.baseUrl,onChange:P=>b("baseUrl",P.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:u.apiKey,onChange:P=>b("apiKey",P.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:u.model,onChange:P=>b("model",P.target.value),fullWidth:true,select:true,label:"Model",children:a.map(P=>f("option",{value:P,children:P},P))})}),f("div",{children:f(He,{size:"small",value:u.promptLang,onChange:P=>b("promptLang",P.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(P=>f("option",{value:P,children:P},P))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(He,{size:"small",value:h,onChange:P=>m(P.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(P=>f("option",{value:P.id,children:P.label},P.id))]}),f(Fn,{multiline:true,minRows:8,value:u.analysisPrompt,onChange:P=>b("analysisPrompt",P.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(He,{size:"small",value:v,onChange:P=>y(P.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),l.map(P=>f("option",{value:P.id,children:P.label},P.id))]}),f(Fn,{multiline:true,minRows:8,value:u.responsePrompt,onChange:P=>b("responsePrompt",P.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(ye,{variant:"outlined",onClick:r,children:"Cancel"}),f(ye,{variant:"contained",onClick:C,disabled:!n||g$1,children:"Save"})]})]})};var yi=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=de(),[d,p]=useState(s?.defaultPrompt||""),[u,f$1]=useState(false),[h,m]=useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},P=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f$1(!0),await s.onSubmit(w,{filters:g$1,model:o});}finally{f$1(false);}};return f(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ae,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:o.title}),f(kt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(kt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&f(ye,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ae,{direction:"row",spacing:10,alignItems:"center",children:[y&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ne,{size:"small",onClick:s?.onVoiceInput,children:f(Ia,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>p(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),P());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ne,{size:"small",onClick:P,disabled:u||!d.trim(),children:f(Nc,{size:16,strokeWidth:1.8})}),f(ne,{size:"small",onClick:()=>m(true),children:f(jo,{size:16,strokeWidth:1.8})})]}),f(ne,{onClick:r,children:f(Xt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(bp,{kpis:o.kpis}),f(Pp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Tp,{open:h,onClose:()=>m(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var To={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},Th=5,Ip=t=>t.toLowerCase().replace(/[\s_-]/g,""),Io=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Ip(s),s]));for(let s of o){let l=i.get(Ip(s));if(l)return l}return a[0]||n},wr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},pr=(t,r)=>t==null||t===""?r:String(t),Ih=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=pr(s[r],a);i.set(l,(i.get(l)||0)+wr(s[o]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Mh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=wr(l[o]),p.billable+=wr(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},Rh=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=pr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},Mp=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=pr(a[r],"N/A");n.set(i,(n.get(i)||0)+wr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Dh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=wr(l[o]),p.billable+=wr(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},Nh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=pr(s[r],a),d=pr(s[o],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+wr(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},Ah=(t,r,o)=>{let n=Mp(t,r,o),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},Eh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=`${pr(l[o],i)} / ${pr(l[n],i)}`,u=s.get(d)||new Map;u.set(p,(u.get(p)||0)+1),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,u)=>u[1]-p[1]).slice(0,a).map(([p,u])=>`${p} (${u})`)})).slice(0,6)},dn=({rows:t,config:r})=>{let{t:o}=de(),n=o("graph.unassigned"),a=useMemo(()=>{let u=r?.fieldMapping;return {primaryDimension:Io(t,u?.primaryDimension,To.primaryDimension,"Category"),secondaryDimension:Io(t,u?.secondaryDimension,To.secondaryDimension,"Owner"),status:Io(t,u?.status,To.status,"Status"),date:Io(t,u?.date,To.date,"Date"),description:Io(t,u?.description,To.description,"Description"),reportHours:Io(t,u?.reportHours,To.reportHours,"ReportHours"),billableHours:Io(t,u?.billableHours,To.billableHours,"BillableHours"),amount:Io(t,u?.amount,To.amount,"Amount")}},[t,r?.fieldMapping]),i=useMemo(()=>t.map((u,f)=>{let h=wr(u[a.reportHours]),m=wr(u[a.billableHours]),v=wr(u[a.amount]),y=h>0?m/h*100:0;return {id:`graph-row-${f}`,Date:pr(u[a.date],""),Primary:pr(u[a.primaryDimension],n),Secondary:pr(u[a.secondaryDimension],n),Description:pr(u[a.description],""),ReportHours:h,BillableHours:m,Amount:v,Efficiency:y,Status:pr(u[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let u=i.length,f=i.reduce((x,b)=>x+wr(b.ReportHours),0),h=i.reduce((x,b)=>x+wr(b.BillableHours),0),m=i.reduce((x,b)=>x+wr(b.Amount),0),v=f>0?h/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(pr(x.Status,"").toLowerCase())).length;return {totalRecords:u,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||Th,d=useMemo(()=>({billableByPrimary:Ih(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Mh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:Rh(i,"Status",n),lineByDate:Mp(i,"Date","BillableHours"),comboByPrimary:Dh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Nh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Ah(i,"Date","BillableHours"),fishboneStatusCauses:Eh(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=useMemo(()=>({title:r?.title||o("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,r?.title,a,s,i,o]);return {fieldMapping:a,model:p}};var pn=t=>String(t??"").trim(),xi=(t={})=>{let[r,o]=useState(t),n=useCallback((d,p)=>{o(u=>{let f=p?.trim();if(!f){let h={...u};return delete h[d],h}if(u[d]===f){let h={...u};return delete h[d],h}return {...u,[d]:f}});},[]),a=useCallback(d=>{o(p=>{if(!p[d])return p;let u={...p};return delete u[d],u});},[]),i=useCallback(()=>{o({});},[]),s=useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=useCallback((d,p)=>d.filter(u=>!(r.primaryDimension&&pn(u[p.primaryDimension])!==pn(r.primaryDimension)||r.secondaryDimension&&pn(u[p.secondaryDimension])!==pn(r.secondaryDimension)||r.status&&pn(u[p.status])!==pn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var wi=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(false),[p,u]=useState(""),[f$1,h]=useState(false),[m,v]=useState(false),y=t.find(b=>b.id===r),g$1=()=>{u(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:f$1,isPublic:m,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(Vt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(b=>({value:b.id,label:b.name+(b.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:b=>{let C=t.find(P=>P.id===b.target.value);C&&o(C);}}),f(st,{title:s("variant.saveView"),children:f(ne,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(wo,{fontSize:"small"})})}),g(Ht,{open:l,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(He,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:b=>u(b.target.value)}),f(qn,{control:f(Rt,{checked:f$1,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),f(qn,{control:f(Rt,{checked:m,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(ye,{onClick:()=>d(false),children:s("common.cancel")}),f(ye,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Dp=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:u,onVariantChange:f$1})=>{let{t:h}=de(),[m,v]=useState([]),[y,g]=useState(""),x=`orbcafe.variants.${t}.${r}`,b=u!==void 0?u:y,C=N=>{u===void 0&&g(N),f$1&&f$1(N);},P=useCallback(()=>{try{let N=localStorage.getItem(x);if(!N)return [];let D=JSON.parse(N);return Array.isArray(D)?D:[]}catch{return []}},[x]),w=useCallback(N=>{try{localStorage.setItem(x,JSON.stringify(N));}catch{}},[x]),k=useCallback(N=>{v(N);let D=N.find(L=>L.isDefault);D&&!b&&(C(D.id),i(D));},[b,i,C]),I=useCallback(async()=>{if(!t)return [];try{let N=[];if(s)N=await s.getVariants(t,r);else if(l){let D=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!D.ok)throw new Error(h("variant.toast.fetchFailed"));N=await D.json();}else N=P();return k(N),N}catch(N){console.error("Error fetching variants",N);let D=P();return k(D),d&&d(h("variant.toast.fetchFailed")),D}},[t,r,s,l,P,k,d,h]);return useEffect(()=>{I();},[t,r]),f(wi,{variants:m,currentVariantId:b,onLoad:N=>{C(N.id),i(N);},onSave:async N=>{let D=Date.now().toString(),L;try{let B=N.scope||"Both",X=m.find(G=>G.name===N.name);D=X?X.id:Date.now().toString();let H=[];if(X&&(Array.isArray(X.filters)?H=[...X.filters]:X.filters&&(H=[{scope:"default",filters:X.filters}])),B==="Search"||B==="Both"){let G=(Array.isArray(o),o);if(G)if(Array.isArray(G)&&G.length>0&&G[0].scope)G.forEach(z=>{let O=H.findIndex(Y=>Y.scope===z.scope);O>=0?H[O]=z:H.push(z);});else {let z={scope:r,filters:G},O=H.findIndex(Y=>Y.scope===r);O>=0?H[O]=z:H.push(z);}}let K=X?.layout||{},W=[];if(X&&Array.isArray(X.layoutRefs)&&(W=[...X.layoutRefs]),B==="Layout"||B==="Both")if(a&&a.length>0)a.forEach(G=>{let z=W.findIndex(O=>O.tableKey===G.tableKey);z>=0?W[z]=G:W.push(G);});else {let G={tableKey:r,layoutId:n||null},z=W.findIndex(O=>O.tableKey===r);z>=0?W[z]=G:W.push(G);}if(L={appId:t,tableKey:r,...N,scope:B,id:D,createdAt:new Date().toISOString(),filters:H,layout:K,layoutRefs:W},s)await s.saveVariant(L,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let z=m.some(O=>O.id===D)?m.map(O=>O.id===D?L:O):[...m,L];v(z),w(z);}p&&p(h("variant.toast.saveSuccess")),(s||l)&&await I(),C(D),i(L);}catch(B){console.error("Error saving variant",B);let H=m.some(K=>K.id===D)?m.map(K=>K.id===D?L:K):[...m,L];v(H),w(H),C(D),i(L),d&&d(h("variant.toast.saveFailed"));}},onDelete:async N=>{try{if(s)await s.deleteVariant(N);else if(l){if(!(await fetch(`${l}/api/variants/${N}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let D=m.filter(L=>L.id!==N);v(D),w(D);}b===N&&C(""),(s||l)&&I(),p&&p(h("variant.toast.deleteSuccess"));}catch(D){console.error("Error deleting variant",D);let L=m.filter(B=>B.id!==N);v(L),w(L),b===N&&C(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async N=>{try{let D=m.find(B=>B.id===N);if(!D)return;let L={appId:t,tableKey:r,...D,isDefault:!0};if(s)await s.setDefaultVariant(N,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let B=m.map(X=>({...X,isDefault:X.id===N}));v(B),w(B);}(s||l)&&await I(),p&&p(h("variant.toast.defaultSuccess"));}catch(D){console.error("Error setting default variant",D);let L=m.map(B=>({...B,isDefault:B.id===N}));v(L),w(L),d&&d(h("variant.toast.defaultFailed"));}}})};eo.extend(zh);eo.extend(Vh);eo.extend(Pf);var ea="YYYY-MM-DD",$h=[null,null],Ho="0.85rem",Gh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},_h=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=ar();return f(yd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},Ap=({label:t,value:r=$h,onChange:o})=>{let{t:n,locale:a}=de(),i=Gh[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[p,u]=useState(r),[f$1,h]=useState("start"),[m,v]=useState(null),[y,g$1]=useState((r[0]||eo()).locale(i)),[x,b]=useState(""),[C,P]=useState(""),[w,k]=useState(false),[I,S]=useState(false),A=Qt__default.useRef(r);useEffect(()=>{let[G,z]=r,[O,Y]=A.current,Q=se=>se&&typeof se.isSame=="function",me=!(G===null&&O===null||Q(G)&&Q(O)&&G.isSame(O,"day")),ie=!(z===null&&Y===null||Q(z)&&Q(Y)&&z.isSame(Y,"day"));(me||ie)&&(u(r),r[0]&&Q(r[0])&&g$1(r[0].locale(i))),A.current=r;},[r,i]),useEffect(()=>{b(p[0]?p[0].locale(i).format(ea):""),P(p[1]?p[1].locale(i).format(ea):""),k(false),S(false);},[p,i]);let R=(G,z)=>{let O=z.trim(),Y=G==="start"?k:S;if(!O){let ie=G==="start"?[null,p[1]]:[p[0],null];Y(false),u(ie);return}let Q=eo(O,ea,true).locale(i);if(!Q.isValid()){Y(true);return}Y(false);let me=[...p];if(G==="start")me[0]=Q,me[1]&&Q.isAfter(me[1],"day")&&(me[1]=null),h(me[1]?"start":"end");else {let ie=me[0];ie&&Q.isBefore(ie,"day")?(me=[Q,null],h("end")):(me[1]=Q,h("start"));}u(me),g$1(Q);},T=G=>{d(G.currentTarget);},N=()=>{d(null),h("start"),v(null);},D=!!l,L=G=>{if(!G)return;let z=[...p];if(f$1==="start")z=[G,null],h("end");else {let O=z[0];O&&G.isBefore(O)?(z=[G,null],h("end")):(z=[O,G],h("start"));}u(z);},B=G=>{let z=eo().locale(i),O=[null,null];switch(G){case "today":O=[z,z];break;case "week":O=[z.startOf("week"),z.endOf("week")];break;case "month":O=[z.startOf("month"),z.endOf("month")];break}u(O),h("start"),g$1(z);},X=()=>{o&&o(p),N();},H=()=>{u(r),h("start"),N();},K=useCallback(G=>{let{day:z,...O}=G,[Y,Q]=p,me=Y?z.isSame(Y,"day"):false,ie=Q?z.isSame(Q,"day"):false,se=Y&&Q?z.isBetween(Y,Q,"day","()"):false,fe=false;return f$1==="end"&&Y&&!Q&&m&&z.isAfter(Y,"day")&&z.isBefore(m.add(1,"day"),"day")&&(fe=true),f(_h,{...O,day:z,disableMargin:true,isStart:me,isEnd:ie,isInRange:se||fe,onMouseEnter:()=>v(z)})},[p,f$1,m]),W=G=>G?G.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(He,{className:"orb-date-range-field",label:s,value:p[0]?`${W(p[0])} - ${W(p[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ho}},InputProps:{readOnly:true,sx:{fontSize:Ho,"& .orb-inp":{fontSize:Ho},paddingRight:"4px"},endAdornment:f(ne,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Mt,{name:"calendar",size:16})})}}),g(Ya,{open:D,anchorEl:l,onClose:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ae,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(He,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:ea,value:x,error:w,size:"small",onFocus:()=>h("start"),onChange:G=>{b(G.target.value),w&&k(false);},onBlur:()=>R("start",x),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),R("start",x));},sx:{"& .orb-inp":{fontSize:Ho,py:.75},"& label":{fontSize:Ho}}}),f(wd,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:ea,value:C,error:I,size:"small",onFocus:()=>{p[0]&&h("end");},onChange:G=>{P(G.target.value),I&&S(false);},onBlur:()=>R("end",C),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),R("end",C));},sx:{"& .orb-inp":{fontSize:Ho,py:.75},"& label":{fontSize:Ho}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ae,{direction:"row",spacing:1,justifyContent:"center",children:[f(kt,{label:n("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:n("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:n("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(xd,{dateAdapter:Ua,adapterLocale:i,children:f(Cd,{value:null,referenceDate:y,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:K},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Nt,{}),g(ae,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(ye,{size:"small",onClick:H,color:"inherit",children:n("common.cancel")}),f(ye,{size:"small",variant:"contained",onClick:X,children:n("common.done")})]})]})]})};var Pi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},qh={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},Xh=["contains","notContains",">",">=","<","<=","equals"],Lp=["=","!=",">","<",">=","<=","between"],tr="0.85rem",Yh=({field:t,value:r,onChange:o})=>{let{t:n}=de(),[a,i]=useState(null),[s,l]=useState(null),[d,p]=useState(null),[u,f$1]=useState(""),[h,m]=useState(""),[v,y]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(T)},[v]);let b=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,P=T=>{let N=qh[T];return N?n(N):T},w=T=>{i(a?null:T.currentTarget);},k=T=>{o({...r,operator:T,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let N=(D=>{if(!D)return [null,null];if(Array.isArray(D)&&D.length===2){let L=D[0]?eo.isDayjs(D[0])?D[0]:eo(D[0]):null,B=D[1]?eo.isDayjs(D[1])?D[1]:eo(D[1]):null;return [L,B]}return eo.isDayjs(D)||typeof D=="string"?[eo.isDayjs(D)?D:eo(D),null]:[null,null]})(C);return f(Ap,{label:t.label,value:N,onChange:D=>o({value:D,operator:"between"})})}if(S==="number"&&b==="between"){let T=()=>{o({value:[u,h],operator:"between"}),l(null);},N=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:N,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(no,{position:"start",children:f(st,{title:P("between"),children:f(ne,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:tr},children:Pi.between})})}),readOnly:true},onClick:D=>l(s?null:D.currentTarget)}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:"auto",py:.5}}},children:Lp.map(D=>g("option",{selected:D===b,onClick:()=>k(D),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[D]}),f($t,{primary:P(D),primaryTypographyProps:{fontSize:tr}})]},D))}),f(Ya,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(He,{size:"small",label:n("smartFilter.min"),type:"number",value:u,onChange:D=>f$1(D.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}}}),f(kd,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:h,onChange:D=>m(D.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}}}),f(ye,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let T=t.valueHelp?.mode||"single";return f(lp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(T==="multiple"?[]:null),mode:T,onChange:N=>o({value:N,operator:T==="multiple"?"anyOf":"equals"})})}if(S==="select")return g(Vt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:T=>o({...r,value:T.target.value,operator:"equals"}),children:[f("option",{value:"",children:n("common.none")}),t.options?.map(T=>f("option",{value:T.value,children:T.label},T.value))]});if(S==="multi-select"){let T=Array.isArray(C)?C:[],N=t.options?.filter(K=>K.label.toLowerCase().includes(g$1.toLowerCase()))||[],D=K=>t.options?.find(W=>W.value===K)?.label||K,L=T.map(D),B=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),X=()=>{p(null),y(""),x("");},H=K=>{let W=T.includes(K)?T.filter(G=>G!==K):[...T,K];o({...r,value:W,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(ye,{variant:"outlined",size:"small",onClick:K=>p(d?null:K.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:tr,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),f(Hr,{fontSize:"small"})]}),f(Yt,{anchorEl:d,open:!!d,onClose:X,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:K=>K.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(no,{position:"start",children:f(Bo,{fontSize:"small"})}),sx:{fontSize:tr}},value:v,onChange:K=>y(K.target.value),onKeyDown:K=>K.stopPropagation()}),N.length>0?N.map(K=>{let W=T.includes(K.value);return g("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>H(K.value),onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),H(K.value));},children:[f(Rt,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f($t,{primary:K.label})]},String(K.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let A=S==="number"?Lp:Xh;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:T=>o({...r,value:T.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:f(no,{position:"start",children:f(st,{title:P(b),children:f(ne,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:tr,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Pi[b]})})}),endAdornment:t.hasSearchIcon?f(no,{position:"end",children:f(Bo,{color:"action"})}):void 0}}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:"auto",py:.5}}},children:A.map(T=>g("option",{selected:T===b,onClick:()=>k(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Pi[T]}),f($t,{primary:P(T),primaryTypographyProps:{fontSize:tr}})]},T))})]})},zr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:u=false,appId:f$1,tableKey:h,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g$1,serviceUrl:x})=>{let{t:b}=de(),[C,P]=useState(true),[w,k]=useState(null),[I,S]=useState(t.filter(N=>!N.hidden).map(N=>N.id)),A=(N,D)=>{o({...r,[N]:D});},R=N=>{I.includes(N)?S(I.filter(D=>D!==N)):S([...I,N]);};return g(Ae,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[f$1?f(Dp,{appId:f$1,tableKey:h,currentFilters:{values:r,visibleFields:I},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:N=>{if(!N.filters)return;let D=null;if(Array.isArray(N.filters)){let L=h||"default",B=N.filters.find(X=>X.scope===L);D=B?B.filters:null;}else D=N.filters;D&&(D.values||D.visibleFields?(D.visibleFields&&Array.isArray(D.visibleFields)&&S(D.visibleFields),D.values&&o(D.values)):o(D)),i&&i(N);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(wi,{variants:n,currentVariantId:a,onLoad:i,onSave:N=>{s&&s({...N,filters:{values:r,visibleFields:I}});},onDelete:l,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(st,{title:b("smartFilter.addFilters"),children:f(ye,{className:"orb-smart-filter-adapt",onClick:N=>k(w?null:N.currentTarget),size:"small",color:"primary",startIcon:f(Zd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:tr,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),f(ne,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:p,disabled:u,children:u?f(Kr,{size:16}):f(Mt,{name:"play",size:16})}),g(Yt,{anchorEl:w,open:!!w,onClose:()=>k(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:32}}}},children:[f("option",{disabled:true,children:f($t,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:tr}})}),f(Nt,{}),t.map(N=>g("option",{onClick:()=>R(N.id),children:[f(Rt,{checked:I.includes(N.id),size:"small"}),f($t,{primary:N.label,primaryTypographyProps:{fontSize:tr}})]},N.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(Ks,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(N=>I.includes(N.id)).map(N=>f(Ks,{size:1,children:f(Yh,{field:N,value:r[N.id]||{value:"",operator:N.type==="number"?"=":"equals"},onChange:D=>A(N.id,D)})},N.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ne,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>P(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?f(Ja,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Hr,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Op=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(null),[p,u]=useState(false),[f$1,h]=useState(""),[m,v]=useState(""),[y,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===r),b=I=>{d(I.currentTarget);},C=()=>{d(null);},P=I=>{o(I),C();},w=()=>{h(""),v(""),g$1({isDefault:false,isPublic:false}),u(true),C();},k=()=>{f$1.trim()&&(n({name:f$1,description:m,...y}),u(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(st,{title:s("layout.layoutOptions"),children:f(ne,{onClick:b,color:x?"primary":"default",size:"small",children:f(rp,{fontSize:"small"})})}),g(Yt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:w,children:[f(Br,{children:f(wo,{fontSize:"small"})}),f($t,{children:s("layout.saveCurrentLayout")})]}),f(Nt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>f("option",{onClick:()=>P(I),selected:I.id===r,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(E,{variant:"body2",fontWeight:I.id===r?"bold":"normal",noWrap:true,children:I.name})}),I.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[f(st,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ne,{size:"small",onClick:A=>{A.stopPropagation(),i(I.id);},children:I.isDefault?f(Jd,{fontSize:"small",color:"warning"}):f(jd,{fontSize:"small"})})}),f(st,{title:s("common.delete"),children:f(ne,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),a(I.id);},children:f(Qa,{fontSize:"small"})})})]})]})},I.id||S))]}),f(Ht,{open:p,onClose:()=>u(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(ye,{variant:"ghost",onClick:()=>u(false),children:s("common.cancel")}),f(ye,{onClick:k,variant:"primary",disabled:!f$1.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:f$1,onChange:I=>h(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f$1)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:m,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Rt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g$1({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Rt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g$1({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var mn=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=de(),[u,f$1]=useState([]),[h,m]=useState(""),v=`orbcafe.layouts.${t}.${r}`,y=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:r,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let A=JSON.parse(S);return Array.isArray(A)?A:[]}catch{return []}},[v]),b=useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);useEffect(()=>{i!==void 0&&m(i);},[i]),useEffect(()=>{if(a&&u.length>0){let S=u.find(A=>A.id===a);S&&(m(S.id),n(S));}},[a,u,n]);let C=useCallback(async()=>{if(t){if(!s){let S=x();f$1(S);let A=S.find(R=>R.isDefault);A&&!h&&!a&&(m(A.id),n(A));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await S.json()).map(y);f$1(R);let T=R.find(N=>N.isDefault);T&&!h&&!a&&(m(T.id),n(T));}catch(S){console.error("Error fetching layouts",S);let A=x();f$1(A);let R=A.find(T=>T.isDefault);R&&!h&&!a&&(m(R.id),n(R)),l&&l(p("layout.toast.loadFallback"));}}},[t,r,s,l,h,n,a,x,p]);return useEffect(()=>{C();},[t,r]),f(Op,{layouts:u,currentLayoutId:h,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let A=u.find(N=>N.name===S.name),R=A?A.id:Date.now().toString(),T={id:R,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let D=u.some(L=>L.id===R)?u.map(L=>L.id===R?T:L):[...u,T];f$1(D),b(D),m(R),n(T),d&&d(p("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await C(),m(R),n(T);}catch(N){console.error("Error saving layout",N);let L=u.some(B=>B.id===R)?u.map(B=>B.id===R?T:B):[...u,T];f$1(L),b(L),m(R),n(T),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let A=u.filter(R=>R.id!==S);f$1(A),b(A),h===S&&m(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===S&&m(""),d&&d(p("layout.toast.deleteSuccess")),await C();}catch(A){console.error("Error deleting layout",A);let R=u.filter(T=>T.id!==S);f$1(R),b(R),h===S&&m(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let A=u.map(R=>({...R,isDefault:R.id===S}));f$1(A),b(A),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let A=u.find(T=>T.id===S);if(!A)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await C();}catch(A){console.error("Error setting default",A);let R=u.map(T=>({...T,isDefault:T.id===S}));f$1(R),b(R),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ti=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ii=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function Bp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Zh(t,r){return t==="desc"?(o,n)=>Bp(o,n,r):(o,n)=>-Bp(o,n,r)}function Qh(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var gn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=useCallback(V=>{let ee=String(V?.label??V?.id??"").length*9+64,De=typeof V?.minWidth=="number"?V.minWidth:0;return Math.max(100,De,ee)},[]),a=useCallback(()=>(t.columns||[]).filter(V=>!!V?.numeric).map(V=>V.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[p,u]=useState(t.orderBy||""),[f,h]=useState([]),[m,v]=useState(t.page||0),[y,g]=useState(t.rowsPerPage||20),[x,b]=useState(t.selected||[]),[C,P]=useState(t.columns?t.columns.map(V=>V.id):[]),[w,k]=useState(t.columns?t.columns.map(V=>V.id):[]),[I,S]=useState(t.showSummary||false),[A,R]=useState(()=>a()),[T,N]=useState([]),[D,L]=useState(new Set),[B,X]=useState(()=>{let V={};return (t.columns||[]).forEach(q=>{V[q.id]=n(q);}),V}),[H,K]=useState(null),[W,G]=useState(null),[z,O]=useState(null),[Y,Q]=useState(null),[me,ie]=useState(false),[se,fe]=useState(""),[Ge,Re]=useState(""),ke=r?[]:T,ze=useCallback(V=>{if(r){N([]),L(new Set),G(null);return}N(V);},[r]);useEffect(()=>{r&&(N([]),L(new Set),G(null));},[r]),useEffect(()=>{o&&(d("asc"),u(""),h([]));},[o]),useEffect(()=>{t.layout&&ft(t.layout);},[t.layout]),useEffect(()=>{if(o){d("asc"),u("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&u(t.orderBy);},[t.order,t.orderBy,o]),useEffect(()=>{t.selected!==void 0&&b(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let V=a();R(q=>q.filter(De=>V.includes(De)));},[a]),useEffect(()=>{X(V=>{let q={...V};return (t.columns||[]).forEach(ee=>{q[ee.id]===void 0&&(q[ee.id]=n(ee));}),q});},[t.columns,n]),useEffect(()=>{k(V=>{let q=(t.columns||[]).map(Je=>Je.id),ee=new Set(q),De=V.filter(Je=>ee.has(Je)),he=new Set(De),Ne=q.filter(Je=>!he.has(Je)),_e=[...De,...Ne];return _e.length===V.length&&_e.every((Je,Ue)=>Je===V[Ue])?V:_e});},[t.columns]);let Pe=useMemo(()=>{let V=t.columns||[];if(w.length===0)return V;let q=new Map(V.map(he=>[he.id,he])),ee=[],De=new Set;return w.forEach(he=>{let Ne=q.get(he);Ne&&(ee.push(Ne),De.add(he));}),V.forEach(he=>{De.has(he.id)||ee.push(he);}),ee},[t.columns,w]),Ce=useMemo(()=>{let V=t.rows||[];return i&&(V=V.filter(q=>Object.keys(q).some(ee=>String(q[ee]).toLowerCase().includes(i.toLowerCase())))),V},[t.rows,i]),Ve=useMemo(()=>{if(o||t.onSortChange)return Ce;if(f.length>0){let V=[...Ce];return V.sort((q,ee)=>{for(let De of f){let he=q?.[De.field],Ne=ee?.[De.field];if(!(he==null&&Ne==null)){if(he==null)return De.direction==="asc"?-1:1;if(Ne==null)return De.direction==="asc"?1:-1;if(he<Ne)return De.direction==="asc"?-1:1;if(he>Ne)return De.direction==="asc"?1:-1}}return 0}),V}return p?Qh(Ce,Zh(l,p)):Ce},[Ce,l,p,f,t.onSortChange,o]),rt=useCallback(V=>{if(ke.length===0)return V.map(Ne=>({type:"row",data:Ne,id:Ne[t.rowKey||"id"]}));let q=[...V].sort((Ne,_e)=>{for(let Je of ke){if(Ne[Je]<_e[Je])return -1;if(Ne[Je]>_e[Je])return 1}return 0}),ee=(Ne,_e=0)=>{if(_e>=ke.length)return Ne;let Je=ke[_e],Ue={},vt=[];return Ne.forEach(Dt=>{let St=Dt[Je],yt=`${Je}:${St}`;Ue[yt]||(Ue[yt]={key:yt,field:Je,value:St,children:[],count:0,level:_e},vt.push(Ue[yt])),Ue[yt].children.push(Dt),Ue[yt].count++;}),vt.forEach(Dt=>{Dt.children&&(Dt.children=ee(Dt.children,_e+1));}),vt},De=ee(q),he=(Ne,_e="")=>{let Je=[];return Ne.forEach(Ue=>{if(Ue.children){let vt=_e?`${_e}>${Ue.key}`:Ue.key,Dt=D.has(vt);Je.push({type:"group",id:vt,field:Ue.field,value:Ue.value,level:Ue.level,count:Ue.count,isExpanded:Dt,childIds:(function St(yt){let F=[];return yt.children.forEach(Z=>{Z.children?F=F.concat(St(Z)):F.push(Z[t.rowKey||"id"]);}),F})(Ue)}),Dt&&(Je=Je.concat(he(Ue.children,vt)));}else Je.push({type:"row",data:Ue,id:Ue[t.rowKey||"id"],level:ke.length});}),Je};return he(De)},[ke,D,t.rowKey]),at=useCallback(V=>{if(ke.length===0)return [];let q=[...V].sort((he,Ne)=>{for(let _e of ke){if(he[_e]<Ne[_e])return -1;if(he[_e]>Ne[_e])return 1}return 0}),ee=[],De=(he,Ne,_e)=>{if(Ne>=ke.length)return;let Je=ke[Ne],Ue=new Map;he.forEach(vt=>{let Dt=vt[Je],St=Ue.get(Dt);St?St.push(vt):Ue.set(Dt,[vt]);}),Ue.forEach((vt,Dt)=>{let St=`${Je}:${Dt}`,yt=_e?`${_e}>${St}`:St;ee.push(yt),De(vt,Ne+1,yt);});};return De(q,0,""),ee},[ke]),Ye=useMemo(()=>rt(Ve),[Ve,rt]),_=useMemo(()=>at(Ve),[Ve,at]),Oe=useMemo(()=>{let V=(t.rows||[]).length;return typeof t.count=="number"&&t.count>V},[t.count,t.rows]),ve=useMemo(()=>Oe?Ye:y>0?Ye.slice(m*y,m*y+y):Ye,[Ye,m,y,Oe]),Ee=useMemo(()=>Oe&&typeof t.count=="number"?t.count:Ye.length,[Ye.length,Oe,t.count]),it=V=>{L(q=>{let ee=new Set(q);return ee.has(V)?ee.delete(V):ee.add(V),ee});},je=V=>{let q=_.filter(ee=>ee===V||ee.startsWith(`${V}>`));L(ee=>{let De=new Set(ee);return q.forEach(he=>De.add(he)),De});},ht=V=>{L(q=>{let ee=new Set(q);return Array.from(ee).forEach(De=>{(De===V||De.startsWith(`${V}>`))&&ee.delete(De);}),ee});},xt=V=>{if(!V){L(new Set);return}L(new Set(_));},At=V=>{let q=_.filter(ee=>ee.startsWith(`${V}>`));return q.length===0?D.has(V):D.has(V)&&q.every(ee=>D.has(ee))},Et=V=>{if(o)return;f.length>0&&h([]);let q=p===V&&l==="asc",ee=p===V&&l==="desc";if(t.onSortChange){q?t.onSortChange(V,"desc"):ee?t.onSortChange("","asc"):t.onSortChange(V,"asc");return}q?(d("desc"),u(V)):ee?(d("asc"),u("")):(d("asc"),u(V));},te=V=>{if(o){d("asc"),u(""),h([]);return}let q=V.filter(ee=>ee&&ee.field);h(q),q.length>0&&u("");},ot=()=>{h([]);},Fe=(V,q)=>{X(ee=>({...ee,[V]:q}));},le=V=>{if(V.target.checked){let q=Ce.map(ee=>ee[t.rowKey||"id"]);b(q),t.onSelectionChange&&t.onSelectionChange(q);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},ge=(V,q)=>{let ee=q[t.rowKey||"id"],De=x.indexOf(ee),he=[];De===-1?he=he.concat(x,ee):De===0?he=he.concat(x.slice(1)):De===x.length-1?he=he.concat(x.slice(0,-1)):De>0&&(he=he.concat(x.slice(0,De),x.slice(De+1))),b(he),t.onSelectionChange&&t.onSelectionChange(he);},J=V=>{v(V),t.onPageChange&&t.onPageChange(V);},Te=V=>{g(V),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(V);},Ie=V=>{let q=C.indexOf(V),ee=[...C];q===-1?ee.push(V):ee.splice(q,1),P(ee);},Ze=V=>{if(r)return;let q=ke.indexOf(V),ee=[...ke];q===-1?ee.push(V):ee.splice(q,1),ze(ee);},ut=V=>{a().includes(V)&&R(ee=>ee.includes(V)?ee.filter(De=>De!==V):[...ee,V]);},dt=(V,q)=>{!V||!q||V===q||k(ee=>{let De=ee.indexOf(V),he=ee.indexOf(q);if(De===-1||he===-1)return ee;let Ne=[...ee];return Ne.splice(De,1),Ne.splice(he,0,V),Ne});},Lt=V=>{let q=V?.active?.id,ee=V?.over?.id;typeof q=="string"&&typeof ee=="string"&&dt(q,ee);},_t=V=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,grouping:ke,columnWidths:B,showSummary:I,summaryColumns:A});},bt=V=>{let{layout:q,layoutId:ee}=Ii(V,t.tableKey||"default");ee?(Re(ee),fe(ee)):(Re(""),fe("")),q&&(q.visibleColumns&&P(q.visibleColumns),Array.isArray(q.columnOrder)&&k(q.columnOrder),o?(d("asc"),u(""),h([])):(q.order&&d(q.order),q.orderBy&&u(q.orderBy),Array.isArray(q.sortBy)&&h(q.sortBy)),q.grouping&&ze(q.grouping),q.columnWidths&&X(q.columnWidths),q.showSummary!==void 0&&S(!!q.showSummary),Array.isArray(q.summaryColumns)&&R(q.summaryColumns));},ft=V=>{let q=V?.layoutData||V?.layout||V||{};q.visibleColumns&&P(q.visibleColumns),Array.isArray(q.columnOrder)&&k(q.columnOrder),o?(d("asc"),u(""),h([])):(q.order&&d(q.order),q.orderBy!==void 0&&u(q.orderBy),Array.isArray(q.sortBy)&&h(q.sortBy)),q.grouping&&ze(q.grouping),q.columnWidths&&X(q.columnWidths),q.showSummary!==void 0&&S(!!q.showSummary),Array.isArray(q.summaryColumns)&&R(q.summaryColumns),L(new Set),v(0),V?.id&&fe(V.id),Re("");};useEffect(()=>{t.layout&&bt({layout:t.layout});},[t.layout]);let yr=V=>{V.preventDefault(),Q(Y===null?{mouseX:V.clientX+2,mouseY:V.clientY-6}:null);},Pt=()=>{Q(null);},Ot=useMemo(()=>{if(!I)return {};let V={};t.columns.forEach(ee=>{if(ee.numeric&&A.includes(ee.id)){let De=Ce.reduce((he,Ne)=>{let _e=parseFloat(Ne[ee.id]);return he+(isNaN(_e)?0:_e)},0);V[ee.id]=De.toFixed(2);}else V[ee.id]="";});let q=t.columns.find(ee=>C.includes(ee.id)&&!ee.numeric);return q&&!q.numeric&&(V[q.id]="Total"),V},[Ce,t.columns,I,A,C]),pt=()=>{if(!t.columns||!Ce)return;let V=t.columns.map(Ne=>Ne.label).join(","),q=Ce.map(Ne=>t.columns.map(_e=>{let Je=Ne[_e.id];return `"${(Je==null?"":String(Je)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
-
`),
|
|
3
|
-
${q}`,De=encodeURI(ee),he=document.createElement("a");he.setAttribute("href",De),he.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(he),he.click(),document.body.removeChild(he);},Ft=()=>{ie(true);},Se=()=>{ie(false);};return {isMobile:false,columns:Pe,order:l,setOrder:d,orderBy:p,setOrderBy:u,sortBy:f,setSortBy:h,applyMultiSort:te,clearMultiSort:ot,columnOrder:w,setColumnOrder:k,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:P,showSummary:I,setShowSummary:S,summaryColumns:A,grouping:ke,setGrouping:ze,expandedGroups:D,setExpandedGroups:L,groupAnchorEl:W,setGroupAnchorEl:G,summaryAnchorEl:z,setSummaryAnchorEl:O,columnWidths:B,setColumnWidths:X,anchorEl:H,setAnchorEl:K,contextMenu:Y,setContextMenu:Q,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ve,summaryRow:Ot,page:m,setPage:J,rowsPerPage:y,setRowsPerPage:Te,totalDisplayCount:Ee,selected:x,setSelected:b,isAllExpanded:_.length>0&&_.every(V=>D.has(V)),handleColumnResize:Fe,handleRequestSort:Et,handleSelectAllClick:le,handleClick:ge,toggleSummaryColumn:ut,handleDragEnd:Lt,handleColumnReorder:dt,handleExport:pt,handleContextMenu:yr,handleCloseContextMenu:Pt,toggleColumnVisibility:Ie,toggleGroupExpand:it,toggleGroupField:Ze,handleToggleAll:xt,handleExpandGroupRecursively:je,handleCollapseGroupRecursively:ht,isGroupFullyExpanded:At,handleLayoutLoad:ft,handleVariantLoad:bt,handleLayoutSave:_t,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,columnOrder:w,grouping:ke,columnWidths:B,showSummary:I,summaryColumns:A},currentLayoutId:se,layoutIdToLoad:Ge,onPageChange:J,onRowsPerPageChange:Te,graphReportOpen:me,handleOpenGraphReport:Ft,handleCloseGraphReport:Se}};var k1=t=>f("tbody",{...t}),P1=({align:t,...r})=>f("td",{align:t==="inherit"?void 0:t,...r}),T1=t=>f("div",{...t}),I1=t=>f("thead",{...t}),M1=t=>f("tr",{...t}),Qr=t=>{let{t:r}=de(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f$1=false,maxHeight:h,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:P,quickEdit:w,quickDelete:k,serviceUrl:I,disableGrouping:S=false,disableSorting:A=false}=t,R=n||r("table.title.default"),{isMobile:T,columns:N,order:D,orderBy:L,filterText:B,setFilterText:X,visibleColumns:H,showSummary:K,setShowSummary:W,summaryColumns:G,grouping:z,setGrouping:O,expandedGroups:Y,groupAnchorEl:Q,setGroupAnchorEl:me,summaryAnchorEl:ie,setSummaryAnchorEl:se,columnWidths:fe,anchorEl:Ge,setAnchorEl:Re,contextMenu:ke,sensors:ze,sortedAndFilteredRows:Pe,summaryRow:Ce,visibleRows:Ve,isAllExpanded:rt,page:at,setPage:Ye,rowsPerPage:_,setRowsPerPage:Oe,totalDisplayCount:ve,setSelected:Ee,handleColumnResize:it,handleRequestSort:je,handleSelectAllClick:ht,handleClick:xt,toggleSummaryColumn:At,handleDragEnd:Et,handleExport:te,handleContextMenu:ot,handleCloseContextMenu:Fe,toggleColumnVisibility:le,toggleGroupExpand:ge,handleToggleAll:J,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:Ie,isGroupFullyExpanded:Ze,handleLayoutLoad:ut,handleVariantLoad:dt,handleLayoutSave:Lt,effectiveAppId:_t,currentLayoutData:bt,currentLayoutId:ft,layoutIdToLoad:yr,graphReportOpen:Pt,handleOpenGraphReport:Ot,handleCloseGraphReport:pt}=gn(t),Ft=C?.enabled??false,Se=Ft&&(C?.interaction?.enabled??true),V=xi(),q=!!P?.enabled,ee=!!w?.enabled,De=!!k?.enabled,he=P?.fields,Ne=P?.excludeFields||[],_e=P?.initialValues||{},[Je,Ue]=Qt__default.useState(false),[vt,Dt]=Qt__default.useState(false),[St,yt]=Qt__default.useState({}),[F,Z]=Qt__default.useState(false),[ue,xe]=Qt__default.useState(false),[et,qe]=Qt__default.useState({}),[Tt,gt]=Qt__default.useState(false),[mt,wt]=Qt__default.useState(false),rr=m||vt||ue||mt,Bt=Qt__default.useMemo(()=>{let re=[...N];if(Array.isArray(he)&&he.length>0){let pe=new Set(he);re=re.filter(j=>pe.has(j.id));}if(Ne.length>0){let pe=new Set(Ne);re=re.filter(j=>!pe.has(j.id));}return re.filter(pe=>!!pe?.id)},[N,Ne,he]),qt=x||"id",zt=Qt__default.useMemo(()=>{let re=new Set(s);return Pe.filter(pe=>re.has(pe?.[qt]))},[s,Pe,qt]),Ut=zt.length===1?zt[0]:null,Wt=w?.fields,er=w?.excludeFields||[],or=w?.editableFields||[],ur=w?.nonEditableFields||[],Pr=w?.primaryKeys?.length?w.primaryKeys:[qt],Tr=Qt__default.useMemo(()=>{let re=[...N];if(Array.isArray(Wt)&&Wt.length>0){let pe=new Set(Wt);re=re.filter(j=>pe.has(j.id));}if(er.length>0){let pe=new Set(er);re=re.filter(j=>!pe.has(j.id));}return re.filter(pe=>!!pe?.id)},[N,er,Wt]),to=Qt__default.useMemo(()=>new Set(Pr),[Pr]),hr=Qt__default.useMemo(()=>new Set(or),[or]),Er=Qt__default.useMemo(()=>new Set(ur),[ur]),Uo=Qt__default.useCallback(re=>hr.size>0?hr.has(re):!(Er.has(re)||to.has(re)),[hr,Er,to]);Qt__default.useEffect(()=>{!Pt&&V.hasActiveFilters&&V.clearAll();},[Pt,V.hasActiveFilters,V.clearAll]);let Ko=()=>{let re={};Bt.forEach(pe=>{re[pe.id]=_e[pe.id]??"";}),yt(re),Ue(true);},Ao=()=>{vt||Ue(false);},qo=(re,pe)=>{yt(j=>({...j,[re]:pe}));},Xo=async()=>{if(!P?.onSubmit){Ue(false);return}try{Dt(!0),await P.onSubmit(St),Ue(!1);}finally{Dt(false);}},Ir=()=>{if(!Ut)return;let re={};Tr.forEach(j=>{re[j.id]=Ut[j.id]??"";});let pe=w?.getInitialValues?{...re,...w.getInitialValues(Ut)}:re;qe(pe),Z(true);},Eo=()=>{ue||Z(false);},Yo=(re,pe)=>{qe(j=>({...j,[re]:pe}));},_r=async()=>{if(Ut){if(!w?.onSubmit){Z(false);return}try{xe(!0),await w.onSubmit(et,Ut),Z(!1);}finally{xe(false);}}},ro=()=>{zt.length!==0&>(true);},Dn=()=>{mt||gt(false);},Lo=async()=>{if(zt.length===0){gt(false);return}if(!k?.onConfirm){gt(false),Ee([]),l?.([]);return}try{wt(!0),await k.onConfirm(zt),gt(!1),Ee([]),l?.([]);}finally{wt(false);}},M=Pe,{fieldMapping:$}=dn({rows:M,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`}}),U=Qt__default.useMemo(()=>Se?V.applyRows(M,$):M,[Se,V.applyRows,M,$]),{model:ce}=dn({rows:U,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`,fieldMapping:$}}),Be=ce.table.columns.map(re=>({id:re.id,label:re.label,align:re.align||"left",minWidth:120,numeric:re.align==="right"})),nt=_t?f(mn,{appId:_t,tableKey:b,currentLayoutData:bt,onLayoutLoad:ut,targetLayoutId:yr,activeLayoutId:ft,serviceUrl:I??g$1?.serviceUrl}):null,We=g(e,{children:[!S&&f(ln,{groupAnchorEl:Q,setGroupAnchorEl:me,grouping:z,setGrouping:O,columns:N}),f(cn,{anchorEl:Ge,setAnchorEl:Re,columns:N,visibleColumns:H,toggleColumnVisibility:le}),f(mi,{anchorEl:ie,setAnchorEl:se,showSummary:K,setShowSummary:W,columns:N,summaryColumns:G,toggleSummaryColumn:At}),f(gi,{contextMenu:ke,handleCloseContextMenu:Fe,columns:N,visibleColumns:H,toggleColumnVisibility:le})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(zr,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(pp,{title:R,loading:m,showSummary:K,setShowSummary:W,setAnchorEl:Re,setSummaryAnchorEl:se,filterText:B,setFilterText:X,sortedAndFilteredRows:Pe,selected:s,columns:N,visibleColumns:H,summaryRow:Ce,handleClick:xt,selectionMode:i}),We]}):g("div",{sx:{width:f$1?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(zr,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:re=>{dt(re),g$1.onVariantLoad&&g$1.onVariantLoad(re);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:m,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],currentLayoutId:ft,layoutRefs:[{tableKey:b,layoutId:ft}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ae,{className:"orb-ctable-surface",sx:{width:f$1?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":rr?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(ci,{filterText:B,setFilterText:X,onRowsPerPageChange:Oe,rowsPerPage:_,rowsPerPageOptions:v,page:at,count:ve,onPageChange:Ye,actions:d,extraTools:p,grouping:z,disableGrouping:S,groupAnchorEl:Q,setGroupAnchorEl:me,showSummary:K,setShowSummary:W,anchorEl:Ge,setAnchorEl:Re,summaryAnchorEl:ie,setSummaryAnchorEl:se,handleExport:te,showCreateButton:q,onOpenCreateDialog:Ko,showEditButton:ee,onOpenEditDialog:Ir,editDisabled:zt.length!==1,showDeleteButton:De,onOpenDeleteConfirm:ro,deleteDisabled:zt.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Lt:void 0,loading:m,layoutManager:nt,onOpenGraphReport:Ft?Ot:void 0}),f("div",{sx:{flex:1,...h?{maxHeight:h,height:h}:u?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:ze,collisionDetection:closestCenter,onDragEnd:Et,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:f$1?750:void 0,width:f$1?"100%":"auto",tableLayout:Object.keys(fe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[f(pi,{columns:N,visibleColumns:H,order:D,orderBy:L,onRequestSort:je,disableSorting:A,onContextMenu:ot,selectionMode:i,grouping:z,isAllExpanded:rt,handleToggleAll:J,rowCount:Pe.length,numSelected:s.length,onSelectAllClick:ht,columnWidths:fe,onColumnResize:it}),f(ui,{visibleRows:Ve,columns:N,visibleColumns:H,selectionMode:i,selected:s,orderBy:L,loading:m,expandedGroups:Y,toggleGroupExpand:ge,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:Ie,isGroupFullyExpanded:Ze,handleClick:xt,onSelectionChange:l,grouping:z,rowKeyProp:x,page:at,rowsPerPage:_}),K&&f(dp,{showSummary:K,columns:N,visibleColumns:H,summaryRow:Ce,selectionMode:i?.toString(),grouping:z,columnWidths:fe,orderBy:L,zIndex:3})]})})})]}),q&&g(Ht,{open:Je,onClose:Ao,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:re=>`1px solid ${re.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:P?.title||r("quickCreate.createWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Bt.map(re=>{let pe=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",j=re.label||re.id;return f(He,{label:j,value:St[re.id]??"",onChange:Le=>qo(re.id,Le.target.value),type:pe,size:"small",fullWidth:true,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${re.id}`)}),P?.description&&f(Yr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:P.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:Ao,sx:{fontSize:"0.85rem"},disabled:vt,children:P?.cancelLabel||r("common.cancel")}),f(ye,{onClick:Xo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:vt,children:P?.submitLabel||r("common.save")})]})]}),ee&&g(Ht,{open:F,onClose:Eo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:re=>`1px solid ${re.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||r("quickEdit.editWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Tr.map(re=>{let pe=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",j=re.label||re.id,Le=Uo(re.id);return f(He,{label:j,value:et[re.id]??"",onChange:Qe=>Yo(re.id,Qe.target.value),type:pe,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${re.id}`)}),w?.description&&f(Yr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:Eo,sx:{fontSize:"0.85rem"},disabled:ue,children:w?.cancelLabel||r("common.cancel")}),f(ye,{onClick:_r,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ue||!Ut,children:w?.submitLabel||r("common.save")})]})]}),De&&f(Kn,{open:Tt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(zt.length>1?r("quickDelete.confirmMessageMultiple",{count:zt.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:Dn,onConfirm:Lo}),We,Ft&&f(yi,{open:Pt,onClose:pt,model:ce,aiAssistant:C?.aiAssistant,interaction:Se?{enabled:true,filters:V.filters,fieldMapping:$,onPrimaryDimensionClick:re=>V.setFilter("primaryDimension",re),onSecondaryDimensionClick:re=>V.setFilter("secondaryDimension",re),onStatusClick:re=>V.setFilter("status",re),onClearFilter:V.clearFilter,onClearAll:V.clearAll}:void 0,tableContent:f(Qr,{appId:_t||"graph-report-internal",title:r("graph.dataBody"),columns:Be,rows:ce.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},R1=Qr;var F1=({id:t,title:r,hideHeader:o=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,p={...a,appId:a.appId||t};return g(ii,{title:r,hideHeader:o,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(zr,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Qr,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var $1=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=de(),[p,u]=useState(false),[f,h]=useState([]),[m,v]=useState({}),[y,g]=useState(t.variants||[]),[x,b]=useState(t.layout||null),[C,P]=useState(""),[w,k]=useState(0),[I,S]=useState(0),[A,R]=useState(o),[T,N]=useState([]),[D,L]=useState("asc"),[B,X]=useState("");useEffect(()=>{let ie={};t.filters.forEach(se=>{se.defaultValue!==void 0&&(ie[se.id]=se.defaultValue);}),v(ie);},[t.filters]);let H=useCallback(async(ie,se,fe,Ge,Re)=>{u(true);try{let ke={...ie,page:se+1,limit:fe,sort:Re,order:Ge},ze;r?ze=await r(ke):typeof t.api=="function"?ze=await t.api(ke):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,ke),ze={rows:[],total:0}):(console.warn("No API configured for report"),ze={rows:[],total:0}),ze&&(h(ze.rows||[]),k(ze.total||0));}catch(ke){console.error("Failed to fetch report data",ke);}finally{u(false);}},[t.api,r]);useEffect(()=>{H(m,I,A,D,B);},[H,I,A,D,B]);let K=()=>{S(0),H(m,0,A,D,B);},W=ie=>{S(0),R(ie);},G=(ie,se)=>{L(se),X(ie);},z=ie=>{v(ie);},O=ie=>{P(ie?.id||"");let se=Ti(ie,a);if(se){let Ge=se.values??se;v(Ge),H(Ge,0,A,D,B),S(0);}let{layout:fe}=Ii(ie,a);fe&&b(fe);},Y=ie=>{let se={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};g(fe=>[...fe,se]);},Q=ie=>{b(ie);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:z,onSearch:K,onVariantLoad:O,onVariantSave:Y,onVariantDelete:ie=>g(se=>se.filter(fe=>fe.id!==ie)),onVariantSetDefault:ie=>{g(se=>se.map(fe=>({...fe,isDefault:fe.id===ie})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:p,rowKey:"id",count:w,page:I,rowsPerPage:A,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:W,selectionMode:"multiple",selected:T,onSelectionChange:N,onLayoutSave:Q,layout:x,title:t.title,showSummary:true,order:D,orderBy:B,serviceUrl:s,onSortChange:G,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:p,refresh:K}};var nb=new Set(["id","title","description","icon","iconNode","meta"]),ab=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),ib=t=>Object.entries(t).filter(([r,o])=>!nb.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:ab(r),value:String(o)})),zp=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=de(),p=br()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Qt__default.useEffect(()=>{if(!r)return;let f=h=>{h.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let u=ib(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Mt,{name:t.icon??"product",size:30,style:{color:p}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ne,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:o,children:f(Mt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):g(e,{children:[t.description?f(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,u.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:u.map(f$1=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f$1.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f$1.value})]},f$1.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(ye,{variant:"contained",sx:{width:"100%"},startIcon:f(Mt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var sb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},lb=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),l=br()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Mt,{name:t.icon??"product",size:26,style:{color:l}});return g(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...sb},children:t.description||"\xA0"})}),g(ae,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ne,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:f(Mt,{name:"show",size:18})}),f(ne,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:f(Mt,{name:"download",size:18})})]})]})},Wp=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:u}=de(),[f$1,h]=Qt__default.useState(null),[m,v]=Qt__default.useState(false),y=x=>{o?.(x),d&&(h(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>h(null),260);};return r?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Kr,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>f(lb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f$1?f(zp,{item:f$1,open:m,onClose:g$1,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:l??u("cardPage.empty")})})};var dD=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return g(ii,{title:r,hideHeader:o,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f(zr,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Wp,{...a})})]}),i]})};var fD=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=useState(false),[u,f]=useState([]),[h,m]=useState(0),[v,y]=useState({}),[g,x]=useState(t.variants||[]),[b,C]=useState("");useEffect(()=>{let R={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(R[T.id]=T.defaultValue);}),y(R);},[t.filters]);let P=useCallback(async R=>{p(true);try{let T=r?await r({...R}):{rows:[],total:0};f(T?.rows||[]),m(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{p(false);}},[r]);useEffect(()=>{P(v);},[P]);let w=()=>{P(v);},k=R=>{y(R);},I=R=>{C(R?.id||"");let T=Ti(R,o);if(T){let N=T.values??T;y(N),P(N);}},S=R=>{let T={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};x(N=>[...N,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:k,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:R=>x(T=>T.filter(N=>N.id!==R)),onVariantSetDefault:R=>{x(T=>T.map(N=>({...N,isDefault:N.id===R})));},variants:g,currentVariantId:b,variantService:n,serviceUrl:a},gridProps:{items:u,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:u,total:h,filters:v,loading:d,refresh:w}};var db=t=>[...t].sort((r,o)=>o.value-r.value),vD=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>db(t),[t]),l=useMemo(()=>[...r],[r]),d=useMemo(()=>[...o],[o]),p=useMemo(()=>[...n],[n]),u=useMemo(()=>{let h=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:h>0?m.value/h*100:m.percent}))},[a]),f=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:u,waterfalls:f}};var wD=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>useMemo(()=>!t||!r?"":jn({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),kD=({keyword:t,location:r})=>useMemo(()=>bi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);var oa=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=useState(false),d=useMemo(()=>t.replace(/\n$/,"").split(`
|
|
4
|
-
`),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:
|
|
5
|
-
`).map(s=>s.trim()).filter(Boolean);if(
|
|
1
|
+
import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as jt from'react';import jt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Do from'@radix-ui/react-dropdown-menu';import*as Xo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as So from'@radix-ui/react-dialog';import*as br from'@radix-ui/react-popover';import tr from'dayjs';import Mf from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import $h from'dayjs/plugin/isBetween';import _h from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import Xv from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Qy from'react-markdown';import jy from'remark-gfm';import Jy from'remark-math';import eC from'rehype-katex';import tC from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import im from'mermaid';import Px from'dayjs/plugin/isoWeek';var Pg={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Tg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Ts={light:Pg,dark:Tg},Gx='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Ux=t=>{let o=Ts[t];return [o.primary,o.p300,o.muted,o.p700]},Kx=10,qx="0.2s ease";var dc=createContext({mode:"light",setting:"light"}),Dg=t=>{if(typeof document>"u")return;let o=document.documentElement;o.classList.toggle("orb-dark",t==="dark"),o.dataset.orbMode=t,o.style.colorScheme=t;},An=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=useState("light"),[s,l]=useState(false);useEffect(()=>{l(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(m.matches?"dark":"light");return f(),m.addEventListener("change",f),()=>m.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{Dg(d);},[d]);let u=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(dc.Provider,{value:u,children:r})},yo=()=>useContext(dc).mode,Is=()=>Ts[yo()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(u=>u+u).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),u=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${u}, ${m}, ${r})`}let l=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Ro=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};var Eg={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},Lg=t=>typeof t=="number"?`${t}px`:t,Og={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Fg=t=>{if(!t)return;let o=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return o?Og[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let u=l["aria-label"]??r,m=Lg(o??Fg(n)??"1em"),f$1={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:r,className:n,"data-sap-icon":t,style:f$1,...l,children:String.fromCodePoint(Eg[t])})});Pt.displayName="SapIcon";var re=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var uc=re("activity","Activity"),Ca=re("error","AlertCircle"),mc=re("warning","AlertTriangle"),p0=re("down","ArrowDown"),u0=re("navigationRight","ArrowRight"),gc=re("up","ArrowUp"),Ms=re("barChart","BarChart"),m0=re("activate","Bot"),Rs=re("calendar","Calendar"),g0=Rs,f0=re("camera","Camera"),h0=re("lineChart","ChartNoAxesCombined"),Ko=re("accept","Check"),xa=re("accept","CheckCircle"),Oo=re("slimDown","ChevronDown"),Sa=re("navigationLeft","ChevronLeft"),Fo=re("navigationRight","ChevronRight"),b0=re("slimUp","ChevronUp"),v0=re("expandAll","ChevronsDown"),y0=re("collapseAll","ChevronsUp"),wa=re("error","CircleAlert"),En=re("accept","CircleCheck"),C0=En,fc=re("stop","CircleStop"),hc=re("copy","Clipboard"),x0=re("checklist","ClipboardCheck"),S0=re("checklist","ClipboardList"),bc=re("time","Clock"),w0=re("tableColumn","Columns3"),hr=re("copy","Copy"),k0=re("duplicate","CopyPlus"),P0=re("delete","Delete"),T0=re("download","Download"),vc=re("edit","Edit"),yc=re("fullScreen","Expand"),I0=re("show","Eye"),M0=re("hide","EyeOff"),ka=re("document","File"),Cc=re("document","FileText"),R0=re("filter","Filter"),Ln=re("tree","FolderTree"),xc=re("process","GitBranch"),On=re("world","Globe"),Sc=re("grid","Grid"),D0=re("move","GripVertical"),N0=re("wrench","Hammer"),wc=re("picture","Image"),Pa=re("information","Info"),A0=re("translate","Languages"),E0=re("dimension","Layers"),L0=re("home","LayoutDashboard"),Ta=re("lightbulb","Lightbulb"),kc=re("lineChart","LineChart"),Pc=re("synchronize","Loader2"),Ia=re("locked","Lock"),O0=Ia,Tc=re("log","LogOut"),Ds=re("email","Mail"),Ic=re("map","MapPin"),Mc=re("menu","Menu"),Bg=re("message","MessageCircle"),Rc=Bg,Ma=re("microphone","Mic"),F0=re("microphone","MicOff"),Dc=re("darkMode","Moon"),B0=re("overflow","MoreHorizontal"),H0=re("accept","PackageCheck"),z0=re("product","PackageSearch"),Ra=re("splitOne","PanelLeftOpen"),Da=re("splitTwo","PanelRight"),V0=re("overview","PanelsTopLeft"),Nc=re("pieChart","PieChart"),Qr=re("pushpin","Pin"),W0=re("play","Play"),jr=re("add","Plus"),$0=re("qrCode","QrCode"),_0=re("receipt","ReceiptText"),Na=re("refresh","RefreshCw"),G0=re("activate","Rocket"),U0=re("refresh","RotateCcw"),Ac=re("refresh","RotateCw"),K0=re("tableRow","Rows3"),q0=re("save","Save"),X0=re("qrCode","ScanLine"),Bo=re("search","Search"),Hg=re("paperPlane","Send"),Ec=Hg,Jr=re("wrench","Settings"),Y0=re("accept","ShieldCheck"),Z0=re("sum","Sigma"),Q0=re("sort","SortAsc"),j0=re("splitTwo","SquareSplitHorizontal"),J0=re("favorite","Star"),Lc=re("lightMode","Sun"),eS=re("table","Table2"),tS=re("ipad","TabletSmartphone"),Fn=re("command","Terminal"),Oc=re("thumbDown","ThumbsDown"),Fc=re("thumbUp","ThumbsUp"),Bc=re("delete","Trash2"),oS=re("tree","TreePine"),Hc=re("trendDown","TrendingDown"),Aa=re("warning","TriangleAlert"),rS=re("shipping","Truck"),zc=re("upload","UploadCloud"),Ns=re("employee","User"),Vc=re("sound","Volume2"),nS=re("factory","Warehouse"),aS=re("process","Workflow"),Yt=re("decline","X"),Ea=re("error","XCircle");var Vg={contained:"primary",outlined:"secondary",text:"ghost"},Wg={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Se=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d$1,className:u,children:m,disabled:f$1,type:h="button",...p},v)=>{let y=Vg[t]??t,g$1=["orb-btn",`orb-btn-${y}`,Wg[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=d(d$1,g$1),b=s??(l?"a":"button");return g(b,{ref:v,type:b==="button"?h:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?f$1||n:void 0,"aria-disabled":b!=="button"&&(f$1||n)?true:void 0,...p,children:[n&&f("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Se.displayName="CButton";var He=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d$1,disabled:u,readOnly:m,required:f$1,autoFocus:h,autoComplete:p,name:v,id:y,error:g$1,helperText:x,dense:b=false,size:C,fullWidth:k=true,select:w=false,multiline:P=false,rows:I,children:S,variant:N,margin:R,onClick:T,startAdornment:D,endAdornment:A,InputProps:L,inputProps:O,InputLabelProps:Y,SelectProps:H,sx:q,className:V},Z)=>{let z=useId(),B=y??`orb-tf-${z}`,G=D??L?.startAdornment,U=A??L?.endAdornment,ie=(typeof g$1=="string"?g$1:void 0)??x,xe={id:B,className:`orb-inp ${b||C==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:u,required:f$1,autoFocus:h,autoComplete:p,name:v,onClick:T,"aria-invalid":!!g$1},We=w?f("select",{...xe,ref:Z,onChange:n,children:S}):P?f("textarea",{...xe,ref:Z,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...xe,ref:Z,onChange:n,type:l,readOnly:m||L?.readOnly,...O}),we=d(q,`orb-fld ${g$1?"orb-is-error":""} ${V??""}`,{width:k?"100%":void 0});return g("div",{className:we.className,style:we.style,children:[t&&f("label",{htmlFor:B,children:t}),G||U?g("div",{className:"orb-inp-adornment-wrap",children:[G&&f("span",{className:"orb-inp-adornment",children:G}),U&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:U}),We]}):We,ie&&f("span",{className:"orb-fld-msg",children:ie})]})});He.displayName="CTextField";var Bn=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:u,error:m,helperText:f$1,fullWidth:h=true,name:p,id:v,inputProps:y,sx:g$1,className:x},b)=>{let C=useId(),k=v??`orb-ta-${C}`,P=(typeof m=="string"?m:void 0)??f$1,I=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:h?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:k,children:t}),f("textarea",{ref:b,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:p,"aria-invalid":!!m,...y}),P&&f("span",{className:"orb-fld-msg",children:P})]})});Bn.displayName="CTextArea";var Ht=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:u=true,minWidth:m,placeholder:f$1,displayEmpty:h,renderValue:p,multiple:v,MenuProps:y,variant:g$1,disableUnderline:x,onClick:b,onMouseDown:C,error:k,helperText:w,name:P,id:I,"aria-label":S,sx:N,className:R},T)=>{let D=useId(),A=I??`orb-sel-${D}`,O=(typeof k=="string"?k:void 0)??w,Y=useRef(null),H=useRef(null),[q,V]=useState(false),[Z,z]=useState(180),[B,G]=useState(a??"");useImperativeHandle(T,()=>Y.current);let U=useMemo(()=>Children.toArray(r).flatMap(Ie=>{if(!isValidElement(Ie)||Ie.type!=="option")return [];let ke=Ie;return [{value:Array.isArray(ke.props.value)?ke.props.value[0]??"":ke.props.value??"",label:ke.props.children,disabled:ke.props.disabled}]}),[r]),ge=o??U,ie=n??B,pe=Array.isArray(ie)?ie[0]??"":ie,xe=String(pe??""),We=ge.find(Ie=>String(Ie.value)===xe),we=p?p(ie):We?.label??(xe||(f$1??"")),se=d(N,`orb-fld ${k?"orb-is-error":""} ${R??""}`,{width:u?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(v)return g("div",{className:se.className,style:se.style,children:[t&&f("label",{htmlFor:A,children:t}),g("select",{ref:T,id:A,className:`orb-inp ${d$1||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:P,multiple:true,onClick:b,onMouseDown:C,"aria-invalid":!!k,"aria-label":S,children:[f$1!==void 0&&f("option",{value:"",children:f$1}),o?o.map(Ie=>f("option",{value:Ie.value,disabled:Ie.disabled,children:Ie.label},Ie.value)):r]}),O&&f("span",{className:"orb-fld-msg",children:O})]});let Ae=Ie=>{n===void 0&&G(Ie);let ke=Y.current;ke&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(ke,Ie),i?.({target:ke,currentTarget:ke}));};return g("div",{className:se.className,style:se.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:Y,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:P,value:xe,disabled:s,onChange:()=>{},children:ge.map(Ie=>f("option",{value:Ie.value,disabled:Ie.disabled,children:Ie.label},String(Ie.value)))}),g(Do.Root,{open:q,onOpenChange:Ie=>{Ie&&z(H.current?.getBoundingClientRect().width??180),V(Ie);},children:[f(Do.Trigger,{asChild:true,children:g("button",{ref:H,id:A,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!We&&!xe?"":void 0,onClick:b,onMouseDown:C,children:[f("span",{className:"orb-select-value",children:we}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Do.Portal,{children:f(Do.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Z},children:f(Do.RadioGroup,{value:xe,onValueChange:Ae,children:ge.map(Ie=>g(Do.RadioItem,{className:"orb-select-option",value:String(Ie.value),disabled:Ie.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(Ie.value)===xe?f(Pt,{name:"accept",size:13}):null}),f("span",{children:Ie.label})]},String(Ie.value)))})})})]}),O&&f("span",{className:"orb-fld-msg",children:O})]})});Ht.displayName="CSelect";var Tt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d$1,size:u,color:m,onClick:f$1,inputProps:h,sx:p,className:v},y)=>{let g$1=d([{...u==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(p)?p:p?[p]:[]],`orb-chk ${v??""}`),x=f("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof y=="function"?y(b):y&&(y.current=b);},type:"checkbox",id:d$1,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f$1,...h});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Tt.displayName="CCheckbox";var ef=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:u})=>{let m=useId(),f$1=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${u??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(h=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:f$1,value:h.value,checked:r!==void 0?r===h.value:void 0,defaultChecked:n!==void 0?n===h.value:void 0,onChange:a?p=>a(p,h.value):void 0,disabled:l||h.disabled}),f("span",{children:h.label})]},h.value))})]})};var La=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:u},m)=>{let f$1=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${u??""}`),h=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?p=>n(p,p.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:f$1.className,style:f$1.style,children:h}):g("label",{className:f$1.className,style:f$1.style,children:[h,f("span",{children:t})]})});La.displayName="CSwitch";var rf={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Ct=forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d$1,onDelete:u,onClick:m,sx:f$1,className:h},p)=>{let v=r??(a==="outlined"&&n==="default"?"outline":rf[n]??"gray"),y=s??!!m,g$1=d([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],`orb-chip orb-chip-${v} ${h??""}`);return g("span",{ref:p,className:g$1.className,style:g$1.style,onClick:m,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[l??d$1,f("span",{className:"orb-chip-label",children:o??t}),u&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),u(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Yt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var Oa=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let l=d(a,i,{display:"inline-flex",position:r?"relative":void 0}),d$1=!n&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${o==="error"?"orb-badge-err":o==="muted"?"orb-badge-muted":""}`,style:r?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return r?g("span",{ref:s,className:l.className,style:l.style,children:[r,d$1]}):f("span",{ref:s,className:l.className,style:l.style,children:d$1})});Oa.displayName="CBadge";var en=forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let l=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:l.className,style:l.style,children:o?f("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});en.displayName="CAvatar";var tn=forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let l=d(a,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[g("div",{style:{flex:1,minWidth:0},children:[o&&f("b",{children:o}),r&&f("span",{children:r})]}),n&&f("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});tn.displayName="CAlert";var Hn=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="indeterminate"||t===void 0,s=d(n,`orb-prog ${a??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},lf=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),qo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var lt=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:o}):f(Xo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Xo.Root,{children:[f(Xo.Trigger,{asChild:true,children:o}),f(Xo.Portal,{children:f(Xo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ne=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:l,type:d$1="button",...u},m)=>{let f$1=d([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),h=f("button",{ref:m,type:d$1,className:f$1.className,style:f$1.style,...u,children:l});return t?f(lt,{title:t,children:h}):h});ne.displayName="CIconButton";var zn=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let l=useRef([]),d$1=o.findIndex(p=>!p.disabled),u=o.findIndex(p=>p.value===t),m=(p,v)=>{let y=o.map((b,C)=>b.disabled?-1:C).filter(b=>b>=0);if(y.length===0)return;let g=y.indexOf(v),x;p.key==="Home"&&(x=y[0]),p.key==="End"&&(x=y[y.length-1]),(p.key==="ArrowRight"||p.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(p.preventDefault(),l.current[x]?.focus(),r(o[x].value));},f$1=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f$1.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(u,0)};return g("div",{role:"radiogroup",className:f$1.className,style:h,"data-has-selection":u>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((p,v)=>{let y=p.value===t;return f(ne,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",p.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:p.label,role:"radio","aria-label":p.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:p.disabled,tabIndex:y||t==null&&v===d$1?0:-1,onClick:()=>r(p.value),onKeyDown:g=>m(g,v),children:p.icon??f("span",{className:"orb-segmented-control-label",children:p.label})},p.value)})]})};var Zt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:u,anchorPosition:m,sx:f$1})=>{let h=useRef(null);if(useEffect(()=>{if(i!==true)return;let p=y=>{let g=y.composedPath();h.current&&g.includes(h.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",p,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",p,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let p=a?.getBoundingClientRect(),v=window.innerWidth,y=p?.left??16,g=p?.right??y,x=d$1?.paper?.sx??u?.sx,b=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],"orb-pop orb-menu",d$1?.paper?.style??u?.style),C=Children.map(l,k=>{if(!isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:P,disabled:I,selected:S}=w,N=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:N.className,style:N.style,onClick:I?void 0:w.onClick,onKeyDown:R=>{!I&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),w.onClick?.(R));},children:P})});return createPortal(f("div",{ref:h,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??y,right:n==="end"&&!m?Math.max(16,v-g):void 0,top:m?.top??(p?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return g(Do.Root,{children:[f(Do.Trigger,{asChild:true,children:r??f(Se,{variant:"primary",children:t})}),f(Do.Portal,{children:f(Do.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((p,v)=>g(Do.Item,{className:"orb-menu-item",disabled:p.disabled,onSelect:()=>p.onClick?.(),children:[p.icon,p.label]},v))})})]})};var Ne=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d$1)=>{let u=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(u,{ref:d$1,className:m.className,style:m.style,...l,children:s})});Ne.displayName="CPaper";var Rt=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...o?{alignSelf:"stretch"}:void 0},...Array.isArray(r)?r:r?[r]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Rt.displayName="CDivider";var yf={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},Cf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d$1,children:u,...m},f$1)=>{let h=o??Cf[t]??"span",v=[t==="inherit"?void 0:yf[t],d$1].filter(Boolean).join(" "),y=d([{...r?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],v);return f(h,{ref:f$1,className:y.className,style:y.style,...m,children:u})});E.displayName="CTypography";var Sf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ae=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:u,...m},f$1)=>{let h=d([{display:"flex",flexDirection:t,gap:Sf(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:f$1,className:h.className,style:h.style,...m,children:u})});ae.displayName="CStack";var Et=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:u,disableRestoreFocus:m,keepMounted:f$1,hideCloseButton:h=false,sx:p,className:v})=>{let y=d([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??u?.paper?.sx)?d$1?.sx??u?.paper?.sx:d$1?.sx??u?.paper?.sx?[d$1?.sx??u?.paper?.sx]:[],...Array.isArray(p)?p:p?[p]:[]],`orb-dialog ${v??""}`);return f(So.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(So.Portal,{children:[f(So.Overlay,{className:"orb-overlay"}),g(So.Content,{className:y.className,style:y.style,children:[(r||!h)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(So.Title,{className:"orb-dialog-title",children:r}):f(So.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&f(So.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(Yt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Es=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:u,className:m})=>g(br.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(br.Trigger,{asChild:true,children:n}),f(br.Portal,{children:f(br.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});var Pf=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=useState(r??t[0]?.value),u=s?o:l,m=useRef([]),f$1=p=>{s||d(p),n?.(p);},h=p=>{if(p.key!=="ArrowRight"&&p.key!=="ArrowLeft")return;p.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===u),g=p.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f$1(x.value);let b=t.findIndex(C=>C.value===x.value);m.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:h,children:t.map((p,v)=>{let y=p.value===u;return g("button",{ref:g=>{m.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:p.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f$1(p.value),children:[p.icon,p.label]},p.value)})})};var If=["su","mo","tu","we","th","fr","sa"],Vn=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Wn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:u,renderDay:m})=>{let f$1=a!==void 0,[h,p]=useState(()=>i??t??o??tr()),v=(f$1?a:h).startOf("month"),y=w=>{f$1||p(w),s?.(w);},g$1=useMemo(()=>u?v.locale(u):v,[v,u]),x=useMemo(()=>{let P=v.startOf("month").startOf("week"),I=[],S=P;for(let N=0;N<6;N+=1){let R=[];for(let T=0;T<7;T+=1)R.push(S),S=S.add(1,"day");if(I.push(R),S.isAfter(v.endOf("month"))&&N>=3)break}return I},[v]),b=useMemo(()=>{let w=u?tr().locale(u):tr();return If.map((P,I)=>w.startOf("week").add(I,"day").format("dd"))},[u]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:f(Sa,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:f(Fo,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((w,P)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${P}`)),x.flat().map(w=>{let P=!w.isSame(v,"month"),I=C(w),S=k?Vn(w,o)||Vn(w,r):Vn(w,t),N=w.isSame(tr(),"day"),R=k&&o&&r&&w.isAfter(o.startOf("day"))&&w.isBefore(r.startOf("day")),T=k&&Vn(w,o)&&!!r,D=k&&Vn(w,r)&&!!o,A=["orb-cal-day",P?"orb-is-outside":void 0,N?"orb-is-today":void 0,S?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,D?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(w,{outsideCurrentMonth:P,selected:S,today:N,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":N?"date":void 0,className:A,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};tr.extend(Mf);var Rf=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:u,dense:m=false,error:f$1,helperText:h,sx:p,className:v})=>{let y=o!==void 0,[g$1,x]=useState(r??null),b=y?o:g$1,[C,k]=useState(false),[w,P]=useState(null),I=D=>{y||x(D),n?.(D);},S=w??(b?(u?b.locale(u):b).format(l):""),N=()=>{if(w===null)return;let D=w.trim();if(!D)I(null);else {let A=tr(D,l,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&I(A);}P(null);},T=(typeof f$1=="string"?f$1:void 0)??h;return g("div",{className:`orb-fld ${f$1?"orb-is-error":""} ${v??""}`,style:p,children:[t&&f("label",{children:t}),f(Es,{open:C,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Rs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:D=>P(D.target.value),onBlur:N,onKeyDown:D=>{D.key==="Enter"&&(N(),k(false)),D.key==="Escape"&&k(false);}})]}),children:f(Wn,{value:b,onChange:D=>{I(D),P(null),k(false);},minDate:a,maxDate:i,locale:u,defaultMonth:b??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Nf=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=useState(false),[u,m]=useState([]),f$1=useRef(null),h=b=>{b.preventDefault(),d(true);},p=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let C=n?b.filter(w=>w.size<=n):b;C.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...u,...C]:C;o&&(k=k.filter((w,P,I)=>P===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),m(k),t?.(k),f$1.current&&(f$1.current.value="");},x=b=>{let C=u.filter((k,w)=>w!==b);m(C),t?.(C);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>f$1.current?.click(),onDragOver:h,onDragLeave:p,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f$1.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:f$1,style:{display:"none"},multiple:o,accept:r,onChange:y}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(zc,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),u.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((b,C)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(Cc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),g("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),f(ne,{"aria-label":`Remove ${b.name}`,onClick:()=>x(C),children:f(Bc,{size:15,strokeWidth:1.8})})]},`${b.name}-${C}`))})]})};function fo(...t){return twMerge(clsx(t))}var Ba={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},$n={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Gc=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium 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";var Ff=cva(Gc(),{variants:{variant:{default:`${Ba.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ba.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Ba.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:$n.none,sm:$n.sm,md:$n.md,full:$n.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Fs=jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:fo(Ff({variant:o,size:r,className:t})),ref:i,...a}));Fs.displayName="Button";var Bf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Hf={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},zf={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Vf={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Wf={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},$f={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},_n={en:Bf,zh:Hf,fr:zf,de:Vf,ja:Wf,ko:$f};var Kc=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,Kf={locale:"en",t:(t,o)=>Kc(_n.en[t]||t,o)},qc=createContext(Kf),Ha=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=_n[t]||_n.en,i=o?.[t]||{},s={..._n.en,...a,...i};return {locale:t,t:(l,d)=>Kc(s[l]||l,d)}},[t,o]);return f(qc.Provider,{value:n,children:r})},de=()=>useContext(qc);function Gn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:u}){let{t:m}=de(),f$1=s==="dark",h=usePathname(),[p,v]=useState(false),[y,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:y;useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let P=new Set(y);P.has(w)?P.delete(w):P.add(w),g$1(P);}},k=w=>{w.children&&w.children.length>0&&C(w.id),o&&o(w);};return !t||!Array.isArray(t)?f("div",{className:fo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:fo("tree-menu",r),children:t.map(w=>{let P=b.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,N=56+Math.max(0,n-1)*8,R=n===0?12:I?N-24:N,T=w.appurl||w.href,D=p&&T?h===T:false,A=d?.has(w.id)??false,L=l&&w.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[D&&f("div",{className:fo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(Fs,{variant:"ghost",className:fo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&P&&!D?f$1?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",D?f$1?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(w),children:[I&&f("div",{className:fo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",D?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Fo,{className:"h-4 w-4"})}),w.icon&&f("div",{className:fo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",D?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:fo("text-sm truncate transition-colors duration-200",D?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:fo("text-xs truncate transition-colors duration-200",D?f$1?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.description})]})]}),L&&u&&f("button",{type:"button","aria-label":m(A?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":A,title:m(A?"navigation.pin.remove":"navigation.pin.add"),onClick:O=>{O.preventDefault(),O.stopPropagation(),u(w);},className:fo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",A&&"orb-is-pinned"),children:f(Qr,{className:fo("h-3.5 w-3.5",A&&"fill-current")})}),I&&f("div",{className:fo("grid transition-[grid-template-rows] duration-300 ease-in-out",P?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:fo("overflow-hidden",P&&"pt-1"),children:f(Gn,{items:w.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:u})})})]},w.id)})})}var Zf="orbcafe:navigation-island:pinned-items",Bs="orbcafe-navigation-pinned",Qf=t=>t.appurl||t.href,Yc=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&Qf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...Yc(r.children));}),o},Zc=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=Zf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=i==="dark",x=s==="floating",b=useRouter(),[C,k]=useState(""),[w,P]=useState(new Set),[I,S]=useState(h),[N,R]=useState(false),T=f$1!==void 0,D=useMemo(()=>f$1??I,[f$1,I]),A=useMemo(()=>new Set(D),[D]);useEffect(()=>{t&&P(new Set);},[t]),useEffect(()=>{if(!u||T){R(true);return}try{let B=window.localStorage.getItem(m);if(B){let G=JSON.parse(B);Array.isArray(G)&&S(G.filter(U=>typeof U=="string"));}}catch{}finally{R(true);}},[u,T,m]),useEffect(()=>{if(!(!u||T||!N))try{window.localStorage.setItem(m,JSON.stringify(D));}catch{}},[D,u,T,m,N]),useEffect(()=>{!u||t||D.length===0||P(B=>{if(B.has(Bs))return B;let G=new Set(B);return G.add(Bs),G});},[t,D.length,u]);let L=useCallback(B=>{let G=Array.from(new Set(B));T||S(G),p?.(G);},[T,p]),O=useCallback(B=>{let G=B.id,U=A.has(G)?D.filter(ge=>ge!==G):[...D,G];L(U);},[D,A,L]),Y=useMemo(()=>{if(!u||D.length===0)return a;let B=new Map(Yc(a).map(U=>[U.id,U])),G=D.map(U=>B.get(U)).filter(U=>!!U);return G.length===0?a:[{id:Bs,title:v||y("navigation.pinned"),icon:f(Qr,{className:"w-4 h-4"}),children:G,pinnable:false},...a]},[D,u,a,v,y]),H=useCallback(B=>{let G=[],U=ge=>{ge.forEach(ie=>{G.push(ie.id),ie.children&&U(ie.children);});};return U(B),G},[]),q=useMemo(()=>{if(!C.trim())return Y;let B=G=>G.reduce((U,ge)=>{let ie=ge.title?.toLowerCase().includes(C.toLowerCase())||ge.description?.toLowerCase().includes(C.toLowerCase()),pe=ge.children?B(ge.children):[];return (ie||pe.length>0)&&U.push({...ge,children:pe.length>0?pe:ge.children}),U},[]);return B(Y)},[C,Y]),V=useMemo(()=>C.trim()?new Set(H(Y)):w,[C,Y,w,H]),Z=useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{b.push("/chat?new=true");}catch(U){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",U),b.push("/chat");}return}let G=B.appurl||B.href;G&&(G.startsWith("http://")||G.startsWith("https://")?window.open(G,"_blank"):b.push(G));},[b]),z=useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${r} ${g$1?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:f(Bo,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:B=>k(B.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(Bo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:q.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(Ln,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Gn,{items:q,onItemClick:Z,className:"space-y-1",expandedIds:V,colorMode:i,enablePinning:u,pinnedIds:A,onTogglePin:O,onToggleExpand:B=>{let G=new Set(w);q.some(ge=>ge.id===B)?G.has(B)?G.delete(B):(q.forEach(ge=>{ge.id!==B&&G.has(ge.id)&&G.delete(ge.id);}),G.add(B)):G.has(B)?G.delete(B):G.add(B),P(G);}})}),t&&f("div",{className:"space-y-2",children:Y.map(B=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let G=new Set([B.id]);P(G);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:B.title||""}),children:B.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:B.title?.charAt(0)||"?"})})},B.id))})]})}),!t&&f("button",{onClick:o,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:z,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ra,{className:"h-4 w-4"}):f(Da,{className:"h-4 w-4"})})]})};var Jf="orbcafe:navigation-island:pinned-items",Hs="orbcafe-navigation-pinned",Qc=t=>t.appurl||t.href,jc=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&Qc(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...jc(o.children)]:n}),Jc=t=>t.flatMap(o=>[o.id,...o.children?Jc(o.children):[]]),ed=(t,o)=>t.reduce((r,n)=>{let a=n.children?ed(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),zs=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:u=true,pinStorageKey:m=Jf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=useRouter(),x=s==="floating",[b,C]=useState(""),[k,w]=useState(new Set),[P,I]=useState(h),[S,N]=useState(false),R=f$1!==void 0,T=f$1??P,D=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!u||R){N(true);return}try{let B=window.localStorage.getItem(m);if(B){let G=JSON.parse(B);Array.isArray(G)&&I(G.filter(U=>typeof U=="string"));}}catch{}finally{N(true);}},[u,R,m]),useEffect(()=>{if(!(!u||R||!S))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,u,R,m,S]),useEffect(()=>{!u||t||T.length===0||w(B=>{if(B.has(Hs))return B;let G=new Set(B);return G.add(Hs),G});},[t,T.length,u]);let A=useCallback(B=>{let G=Array.from(new Set(B));R||I(G),p?.(G);},[R,p]),L=useCallback(B=>{A(D.has(B.id)?T.filter(G=>G!==B.id):[...T,B.id]);},[T,D,A]),O=useMemo(()=>{if(!u||T.length===0)return a;let B=new Map(jc(a).map(U=>[U.id,U])),G=T.map(U=>B.get(U)).filter(U=>!!U);return G.length===0?a:[{id:Hs,title:v||y("navigation.pinned"),icon:f(Qr,{className:"h-4 w-4"}),children:G,pinnable:false},...a]},[T,u,a,v,y]),Y=b.trim().toLocaleLowerCase(),H=useMemo(()=>Y?ed(O,Y):O,[O,Y]),q=useMemo(()=>Y?new Set(Jc(H)):k,[k,H,Y]),V=useCallback(B=>{w(G=>{let U=new Set(G),ge=H.some(ie=>ie.id===B);return U.has(B)?U.delete(B):(ge&&H.forEach(ie=>U.delete(ie.id)),U.add(B)),U});},[H]),Z=useCallback(B=>{let G=Qc(B);G&&(B.id==="chat"||B.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(G)?window.open(G,"_blank","noopener,noreferrer"):g$1.push(G));},[g$1]),z=B=>{o(),w(new Set([B.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${r}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:o,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:f(Bo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),f(Bo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:b,onChange:B=>C(B.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:H.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(Ln,{className:"h-5 w-5"}):y(Y?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:O.map(B=>f("button",{type:"button",onClick:()=>z(B),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||f(Ln,{className:"h-5 w-5"})},B.id))}):f(Gn,{items:H,onItemClick:Z,className:"space-y-1",expandedIds:q,onToggleExpand:V,colorMode:i,enablePinning:u,pinnedIds:D,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ra,{className:"h-4 w-4"}):f(Da,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};zs.displayName="NavigationIsland2";var od=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}=t,[m,f]=useState(o),[h,p]=useState(r),[v,y]=useState(n),g=useCallback(()=>{f(C=>!C);},[]),x=useCallback(()=>{p(C=>C==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:m,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:p,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:u}),[m,g,v,h,p,a,i,s,l,d,u]);return {collapsed:m,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:p,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:b}};var Ws=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},nr=new Ws,TP={success:(t,o)=>nr.show("success",t,o),error:(t,o)=>nr.show("error",t,o),warning:(t,o)=>nr.show("warning",t,o),info:(t,o)=>nr.show("info",t,o),show:(t,o,r)=>nr.show(t,o,r),hide:()=>nr.hide()};var th={success:{icon:f(En,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Aa,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(wa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Pa,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},qn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:u="default"})=>{let{t:m}=de(),f$1=i||m("messageBox.confirm"),h=s||m("messageBox.cancel"),p=()=>{a?a():n();},v=th[u],y=u!=="default";return g(Et,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof r=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(Se,{onClick:n,variant:"text",children:h}),f(Se,{onClick:p,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f$1})]})]})},LP=()=>{let[t,o]=jt__default.useState(null),[r,n]=jt__default.useState(false);jt__default.useEffect(()=>{let s=l=>{l?(o(l),n(true)):(n(false),o(null));};return nr.register(s),()=>nr.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?f(qn,{open:r,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var zP=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(En,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(wa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(Aa,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var $P=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),_P=({button:t,divider:o,sx:r,className:n,children:a,...i})=>f("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:o?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...r},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),GP=({sx:t,className:o,children:r,...n})=>f("button",{...n,type:"button",className:o,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:r}),UP=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),KP=({primary:t,secondary:o,sx:r})=>g("div",{style:{flex:1,minWidth:0,...r},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&f("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),qP=({sx:t,className:o,children:r,...n})=>f("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),XP=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var QP=({xs:t,md:o,lg:r,sx:n,children:a,className:i,...s})=>{let l=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};var No=tt,no=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d$1)=>{let u=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(u,{ref:d$1,className:m.className,style:m.style,...l,children:s})}),Te=no("div"),nd=no("a","orb-link"),Or=Ne,ad=ae,ho=E;var id=ne;var sd=Rt,Zo=tn,Ka=en,qa=Oa;var Xa=La,ld=qo,cd=({value:t,variant:o,color:r,sx:n})=>f(Hn,{value:o==="determinate"?t:void 0,color:r,sx:n}),dd=no("table","orb-tbl"),pd=no("tbody"),Gs=no("td"),ud=no("div","orb-table-container"),md=no("thead"),Us=no("tr");no("tfoot");no("div","orb-dialog-title");no("div","orb-dialog-content");no("div","orb-dialog-actions");no("p","orb-body-dense");var ar=no("span","orb-input-adornment"),gd=forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var vr=no("div","orb-form-control"),Xn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),sh=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),lh=no("span","orb-list-item-icon"),$t=sh,Ho=lh;no("div","orb-list-subheader");var Ks=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...u})=>{let m={},f$1=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return n!==void 0&&(m.xs=f$1(n)),a!==void 0&&(m.sm=f$1(a)),i!==void 0&&(m.md=f$1(i)),s!==void 0&&(m.lg=f$1(s)),l!==void 0&&(m.xl=f$1(l)),f(Te,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},on=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:f("div",{hidden:!t,...n,children:o}),fd=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),hd=no("div","orb-toolbar"),bd=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let l=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return g("button",{type:"button",className:l.className,style:l.style,"data-direction":o,...s,children:[f("span",{className:"orb-table-sort-content",children:r}),f(Pt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},Ya=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:u,style:m,...f$1})=>{let h=useRef(null);if(useEffect(()=>{if(!t)return;let x=C=>{let k=C.composedPath();h.current&&k.includes(h.current)||o&&k.includes(o)||r?.();},b=C=>{C.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",b,true);}},[o,r,t]),!t||typeof document>"u")return null;let p=o?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(y,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...m});return createPortal(f("div",{...f$1,ref:h,className:g.className,style:{position:"fixed",left:p?.left??16,top:(p?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},vd=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=r==="right"?{right:0,top:0,bottom:0}:r==="top"?{left:0,right:0,top:0}:r==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(a?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},yd=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(r,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:l=>o?.(null,l)}):s)}),Cd=({value:t,label:o,children:r,selected:n,onSelect:a,...i})=>f("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:o??r});var ao=()=>c(),yr=(t,o)=>Ro(t);var xd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d$1=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>o?.(t),...l,children:t.date()})},Sd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(Wn,{value:t,month:o,onChange:u=>r?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:l?.day?(u,m)=>l.day?.({day:u,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:f=>r?.(f)}):void 0,...d}),wd=({children:t})=>f(e,{children:t}),Ua=class{};var ch=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,Ce=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:l,...d$1})=>{let u=d(a,i,s);return f(Pt,{name:t,size:ch(r,n),className:u.className,style:u.style,"aria-label":d$1["aria-label"]??l,...d$1})},Cr=Ce("tree"),Fr=Ce("add"),kd=Ce("duplicate"),qs=Ce("down"),Pd=Ce("navigationRight"),Td=Ce("navigationRight"),Xs=Ce("up"),Id=Ce("delete"),Md=Ce("camera"),Rd=Ce("accept"),Dd=Ce("accept"),Za=Ce("navigationRight"),Nd=Ce("dimension"),Ad=Ce("decline"),xr=Ce("decline"),Ed=Ce("decline"),Ld=Ce("decline"),Qa=Ce("delete"),ja=Ce("delete"),Od=Ce("download"),Fd=Ce("move"),Bd=Ce("edit"),rn=Ce("slimDown"),Hd=Ce("filter"),nn=Ce("sum"),zd=Ce("lineChart"),Vd=Ce("document"),zo=Ce("slimDown"),Wd=Ce("navigationLeft"),Sr=Ce("navigationRight"),Ja=Ce("slimUp"),ei=Ce("navigationLeft"),ti=Ce("navigationRight"),$d=Ce("dimension"),_d=Ce("splitOne"),oi=Ce("menu"),Gd=Ce("microphone"),Ud=Ce("microphone"),Kd=Ce("microphone"),qd=Ce("qrCode"),wr=Ce("save"),Br=Ce("search"),Xd=Ce("search"),Yd=Ce("paperPlane"),Zd=Ce("paperPlane"),Qd=Ce("wrench"),jd=Ce("sort"),ri=Ce("splitTwo"),Jd=Ce("favorite"),ep=Ce("favorite"),tp=Ce("stop"),op=Ce("tableRow"),ni=Ce("collapseAll"),ai=Ce("expandAll"),an=Ce("tableColumn"),rp=Ce("overview"),np=Ce("hide");var ph=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],ip=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],wo=t=>String(t),sp=(t,o)=>t[o],lp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},uh=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:lp(t))},mh=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},cp=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:u="Open value help",noResultsText:m="No matching values",loading:f$1=false,clearable:h=true,allowManualInput:p=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:b=lp,getOptionLabel:C=uh,getOptionDescription:k=mh,onChange:w,onSearch:P,disabled:I,InputProps:S,onFocus:N,onBlur:R,onKeyDown:T,error:D,helperText:A,...L})=>{let O=yo(),Y=n==="multiple",[H,q]=useState(false),[V,Z]=useState(false),[z,B]=useState(""),[G,U]=useState(null),[ge,ie]=useState(false),[pe,xe]=useState(()=>ip(t)),[We,we]=useState(""),[se,Ae]=useState(""),Ie=useMemo(()=>r&&r.length>0?r:ph,[r]),ke=G??o,ze=useMemo(()=>{let ee=[...g$1,...o,...G??[]],he=new Map;return ee.forEach(De=>{he.set(wo(b(De)),De);}),he},[b,o,G,g$1]),et=useMemo(()=>ip(t),[t]),rt=useMemo(()=>et.map(String).join(", "),[et]);useEffect(()=>{H||xe(et);},[H,et]),useEffect(()=>{!V&&!se&&we(rt);},[V,rt,se]);let at=useMemo(()=>{let ee=z.trim().toLowerCase();if(!ee||P)return ke;let he=Ie.filter(De=>De.searchable!==false);return ke.filter(De=>[b(De),C(De),k(De),...he.map(it=>sp(De,it.field))].some(it=>String(it??"").toLowerCase().includes(ee)))},[ke,k,C,b,P,z,Ie]),K=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let ee=he=>{let De=ze.get(wo(he));if(!De)return String(he);let je=C(De);return je&&je!==String(he)?`${he} - ${je}`:String(he)};return Y?et.length>2?`${et.length} selected`:et.map(ee).join(", "):ee(et[0])},[x,C,Y,ze,et]),Re=useCallback(async()=>{if(P){ie(true);try{let ee=await P(z);Array.isArray(ee)&&U(ee);}finally{ie(false);}}},[P,z]),ve=()=>{I||(xe(et),q(true));},Fe=()=>{q(false);},nt=()=>{w?.(Y?[]:null,Y?[]:null),xe([]),we(""),Ae("");},Ye=ee=>{let he=b(ee);if(Y){xe(De=>De.some(it=>wo(it)===wo(he))?De.filter(it=>wo(it)!==wo(he)):[...De,he]);return}xe([he]);},xt=()=>{let ee=pe.map(he=>ze.get(wo(he))).filter(he=>!!he);Y?w?.(pe,ee):w?.(pe[0]??null,ee[0]??null),Ae(""),q(false);},It=ee=>{if(ee.key==="F4"){ee.preventDefault(),ve();return}if(ee.key==="Enter"&&p&&!Nt(We,true)){ee.preventDefault();return}T?.(ee);},Lt=ee=>v?ee.every(he=>ze.has(wo(he))):true,Nt=(ee,he)=>{if(Y){let je=ee.split(/[,;\n]/).map(dt=>dt.trim()).filter(Boolean);if(je.length===0)return Ae(""),w?.([],[]),true;if(!Lt(je))return he&&Ae(y),false;Ae("");let it=je.map(dt=>ze.get(wo(dt))).filter(dt=>!!dt);return w?.(je,it),true}let De=ee.trim();return De?Lt([De])?(Ae(""),w?.(De,ze.get(wo(De))??null),true):(he&&Ae(y),false):(Ae(""),w?.(null,null),true)},te=ee=>{if(!p)return;let he=ee.target.value;we(he),Ae(""),Nt(he,false);},Ge=f$1||ge,Oe=et.length>0,be=p&&(V||!!se)?We:K;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",h&&Oe&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:be,error:!!se||D,helperText:se||A,onChange:te,onFocus:ee=>{Z(true),we(rt),N?.(ee);},onBlur:ee=>{p&&Nt(We,true),Z(false),R?.(ee);},onKeyDown:It,InputProps:{...S,readOnly:!p,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(qo,{size:18}):null,h&&Oe&&!I?f(ne,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),nt();},children:f(Pt,{name:"decline",size:14})}):null,f(ne,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),ve();},disabled:I,children:f(Pt,{name:"search",size:16})})]})}}),g(Et,{open:H,onClose:Fe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:ee=>({borderRadius:2,overflow:"hidden",border:`1px solid ${ee.palette.divider}`,boxShadow:O==="dark"?`0 24px 80px ${tt(ee.palette.common.black,.72)}`:`0 24px 80px ${tt(ee.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:ee=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),Y?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${pe.length} selected`}):null]}),f(ne,{"aria-label":"Close",onClick:Fe,size:"small",children:f(xr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ae,{direction:{xs:"column",sm:"row"},spacing:1,sx:ee=>({px:2.5,py:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:O==="dark"?tt(ee.palette.common.white,.025):tt(ee.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:z,placeholder:i,onChange:ee=>B(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Re());},InputProps:{startAdornment:f(ar,{position:"start",children:f(Pt,{name:"search",size:16})}),sx:ee=>({borderRadius:1,bgcolor:ee.palette.background.paper,"& fieldset":{borderColor:tt(ee.palette.text.primary,O==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(ee.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:ee.palette.primary.main}})}}),P?f(Se,{variant:"outlined",onClick:()=>{Re();},disabled:Ge,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ge?f(qo,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:ee=>({bgcolor:O==="dark"?"var(--orb-canvas)":ee.palette.background.paper,borderBottom:`1px solid ${ee.palette.divider}`})}),Ie.map(ee=>f("td",{align:ee.align==="inherit"?void 0:ee.align,sx:he=>({minWidth:ee.minWidth,width:ee.width,fontSize:"0.78rem",fontWeight:800,bgcolor:O==="dark"?"var(--orb-canvas)":he.palette.background.paper,borderBottom:`1px solid ${he.palette.divider}`}),children:ee.label},String(ee.field)))]})}),g("tbody",{children:[at.map(ee=>{let he=b(ee),De=pe.some(je=>wo(je)===wo(he));return g("tr",{hover:true,selected:De,onClick:()=>Ye(ee),onDoubleClick:()=>{Y||(xe([he]),w?.(he,ee),q(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(je.palette.primary.main,O==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(je.palette.primary.main,O==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:De})}),Ie.map(je=>{let it=sp(ee,je.field);return f("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(it,ee):String(it??"")},String(je.field))})]},wo(he))}),at.length===0?f("tr",{children:f("td",{colSpan:Ie.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:ee=>({px:2.5,py:1.5,borderTop:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[h&&(Oe||pe.length>0)?f(Se,{onClick:nt,children:l}):null,f("div",{sx:{flex:1}}),f(Se,{onClick:Fe,children:d}),f(Se,{variant:"contained",onClick:xt,disabled:!Y&&pe.length===0,children:s})]})]})]})};var ii=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var Ys={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Zs={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Yn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Zn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},dp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},co={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var gh={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},si=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),l=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),u=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,u),f$1=d>0,h=d<u-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(lt,{title:s("table.toolbar.itemsPerPage"),children:f(Ht,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:p=>a?.(Number(p.target.value)),sx:gh,children:l.map(p=>f("option",{value:p,children:p===-1?s("common.all"):p},`rows-per-page-${p}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ne,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f$1,sx:co,children:f(Wd,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:u}),children:[m," / ",u]}),f(ne,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,u-1)),disabled:!h,sx:co,children:f(Sr,{})})]})};var li=({value:t="",onChange:o})=>{let{t:r}=de();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:f(ar,{position:"start",children:f(Br,{size:16})})}})})};var ci=t=>{let{t:o}=de(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(hd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(li,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(si,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?f("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>f(jt__default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(lt,{title:o("table.toolbar.groupBy"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(qa,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Cr,{})})})}),f(lt,{title:o("table.toolbar.summary"),children:f(ne,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:co,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(nn,{})})}),f(lt,{title:o("table.toolbar.columns"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(an,{})})}),f(lt,{title:o("table.toolbar.export"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:t.handleExport,children:f(Od,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(lt,{title:o("table.toolbar.newItem"),children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:co,children:f(Fr,{})})}),t.showEditButton&&f(lt,{title:o("table.toolbar.editItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:co,children:f(Bd,{})})})}),t.showDeleteButton&&f(lt,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...co,color:"error.main"},children:f(Qa,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(lt,{title:o("table.toolbar.graphicReport"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:t.onOpenGraphReport,children:f(zd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(lt,{title:o("table.toolbar.saveLayout"),children:f(ne,{className:"orb-table-tool-button",sx:co,onClick:l=>t.onLayoutSave(l),children:f(wr,{})})}),t.layoutManager]})]})]})})};var di=Object.freeze({Translate:{toString(t){if(!t)return;let{x:o,y:r}=t;return "translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:o,scaleY:r}=t;return "scaleX("+o+") scaleY("+r+")"}},Transform:{toString(t){if(t)return [di.Translate.toString(t),di.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var pi=t=>{let{t:o}=de(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:u,columns:m,visibleColumns:f$1,selectionMode:h,grouping:p=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g$1,columnWidths:x,enableColumnReorder:b=false,disableSorting:C=false}=t,[k,w]=useState(null),P=useRef(null),I=V=>Z=>{C||k||d(V);},S=(V,Z,z)=>{V.preventDefault(),V.stopPropagation(),w(Z),P.current={startX:V.clientX,startWidth:z,colId:Z},document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},N=V=>{if(!P.current)return;let{startX:Z,startWidth:z,colId:B}=P.current,G=V.clientX-Z,U=Math.max(50,z+G);g$1&&g$1(B,U);},R=()=>{w(null),P.current=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R);},[]);let T=h==="multiple"||h==="single",D=p.length>0&&!!y,A=o(v?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(V=>f$1.includes(V.id)),O=new Map(i.map((V,Z)=>[V.field,{...V,priority:Z+1}])),Y=L.map(V=>{let Z=x?.[V.id]||V.minWidth||100,z=O.get(V.id);return f(Sh,{headCell:V,width:typeof Z=="number"?Z:100,order:n,orderBy:a,multiSortInfo:C?void 0:z,onRequestSort:I(V.id),onContextMenu:u,onResizeMouseDown:B=>S(B,V.id,typeof Z=="number"?Z:100),enableColumnReorder:b,disableSorting:C},V.id)}),H=L.map(V=>V.id),q=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Tt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:r,disabled:h==="single",sx:Yn})}),D&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(lt,{title:A,children:f(ne,{size:"small",onClick:V=>{V.stopPropagation(),y?.(!v);},sx:Zn,children:v?f(ni,{}):f(ai,{})})})}),b?f(SortableContext,{items:H,strategy:horizontalListSortingStrategy,children:Y}):Y]});return f("thead",{children:q})},Sh=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:u})=>{let{setNodeRef:m,attributes:f$1,listeners:h,transform:p,transition:v,isDragging:y}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:di.Transform.toString(p),transition:v,opacity:y?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?r:"asc"),b=!u&&(!!a||n===t.id);return g("th",{ref:d?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":b?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?f$1:{},...d?h:{},children:[u?f("span",{className:"orb-table-head-label",children:t.label}):f(bd,{className:"orb-table-head-sort",active:b,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};var ui=t=>{let{t:o}=de(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:u,grouping:m=[],isGroupFullyExpanded:f$1,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:p,emptyLabel:v,getRowDataKey:y,getRowProps:g$1,getGroupRowProps:x}=t,b=P=>a.indexOf(P)!==-1,C=u==="multiple"||u==="single",k=m.length>0,w=n.length+(C?1:0)+(k?1:0);return g("tbody",{children:[r.map((P,I)=>{if(P.type==="group"){let S=d.has(P.id),N=P.childIds||[],R=N.filter(V=>b(V)).length,T=N.length>0&&R===N.length,D=R>0&&R<N.length,A={entry:P,data:P,id:P.id,index:I,selected:T,group:true},L=x?.(A)||{},{className:O,onClick:Y,...H}=L,q=V=>{if(V.stopPropagation(),!!t.onSelectionChange)if(T){let Z=a.filter(z=>!N.includes(z));t.onSelectionChange(Z);}else {let Z=Array.from(new Set([...a,...N]));t.onSelectionChange(Z);}};return g("tr",{...H,"data-ctable-row-key":y?.(A),className:["orb-table-group-row",O].filter(Boolean).join(" "),onClick:Y,sx:V=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:V.palette.text.primary,borderBottomColor:V.palette.divider},"& .orb-icon-btn":{color:V.palette.text.primary},"& .orb-chk":{color:V.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:V.palette.primary.main}}),children:[C&&f("td",{padding:"checkbox",sx:Ys,children:f(Tt,{size:"small",checked:T,indeterminate:D,onChange:q,onClick:V=>V.stopPropagation(),sx:Yn})}),k&&f("td",{padding:"checkbox",sx:Zs,children:g("div",{sx:dp,children:[m.length>1&&P.level<m.length-1&&f(lt,{title:f$1?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ne,{size:"small",onClick:()=>{f$1?.(P.id)?p?.(P.id):h?.(P.id);},sx:Zn,children:f$1?.(P.id)?f(ni,{}):f(ai,{})})}),f(ne,{size:"small",onClick:()=>l&&l(P.id),sx:Zn,children:S?f(zo,{}):f(Sr,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:P.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[P.field,": ",P.value," (",P.count,")"]})})]},P.id)}else {let S=P.data||P,N=P.id||S.id||I,R=b(N),T=`enhanced-table-checkbox-${I}`,D={entry:P,data:S,id:N,index:I,selected:R,group:false},A=g$1?.(D)||{},{className:L,onClick:O,...Y}=A,q=(P.level!==void 0?P.level:0)*4;return g("tr",{...Y,"data-ctable-row-key":y?.(D),className:[R?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:V=>{O?.(V),V.defaultPrevented||i?.(V,S);},role:C?"checkbox":Y.role,"aria-checked":C?R:Y["aria-checked"],tabIndex:Y.tabIndex??-1,children:[C&&f("td",{padding:"checkbox",sx:Ys,children:f(Tt,{color:"primary",checked:R,inputProps:{"aria-labelledby":T},sx:Yn})}),k&&f("td",{padding:"checkbox",sx:Zs}),s.filter(V=>n.includes(V.id)).map((V,Z)=>{let B=Z===0&&q>0?{pl:q+2}:{};return f("td",{className:V.numeric?"orb-num":void 0,align:V.numeric?"right":"left",sx:B,children:V.render?V.render(S[V.id],S):(function(){let U=S[V.id];if(V.numeric){if(typeof U=="number")return U.toLocaleString();if(typeof U=="string"&&U.trim()!==""&&!isNaN(Number(U)))return Number(U).toLocaleString()}return U})()},V.id)})]},N)}}),r.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:v??o("common.noData")})})]})};var pp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,u=o.filter(m=>r.includes(m.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[l&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),u.map(m=>f("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let h=n[m.id];return h==null||h===""?"":typeof h=="number"?h.toLocaleString():typeof h=="string"&&h.trim()!==""&&!isNaN(Number(h))?Number(h).toLocaleString():h})()},m.id))]})})};var up=t=>{let{t:o}=de();return f("div",{sx:{p:2},children:f(E,{children:o("table.mobile.notImplemented")})})};var cn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,l]=useState(r);useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},u=f=>{l(h=>h.includes(f)?h.filter(p=>p!==f):[...h,f]);},m=()=>{n(s),o(null);};return g(Zt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Se,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(f$1=>{let h=s.includes(f$1.id),p=s.indexOf(f$1.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),u(f$1.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),f($t,{className:"orb-table-group-menu-label",primary:f$1.label}),h&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${p}`,children:p})]})},f$1.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(Se,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(Se,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},dn=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Zt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f($t,{primary:i("table.menu.visibleColumns")})}),f(Rt,{}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Tt,{checked:n.includes(s.id),size:"small"}),f($t,{primary:s.label})]},s.id))]})},mi=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=de();return g(Zt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Xn,{control:f(Xa,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),f(Rt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!r,children:[f(Tt,{checked:i.includes(d.id),size:"small"}),f($t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&f("option",{disabled:true,children:f($t,{primary:l("table.menu.noNumericColumns")})})]})},gi=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Zt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:o,children:i("common.copy")}),f(Rt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Ho,{children:n.includes(s.id)&&f(Rd,{fontSize:"small"})}),f($t,{children:s.label})]},s.id))]})},hp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:u,onSortAsc:m,onSortDesc:f$1,onClearSort:h,onHideColumn:p,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g$1})=>{let{t:x}=de(),b=t?.columnId??"",C=r.find(T=>T.id===b),k=a.includes(b),w=i.includes(b),P=!!C?.numeric,I=l.find(T=>T.field===b),S=I?I.direction==="asc":d===b&&u==="asc",N=I?I.direction==="desc":d===b&&u==="desc",R=S||N;return g(Zt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f($t,{primary:C?.label??b})}),f(Rt,{}),g("option",{onClick:()=>{m(b),o();},selected:S,children:[f(Ho,{children:f(Xs,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{f$1(b),o();},selected:N,children:[f(Ho,{children:f(qs,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortDesc")})]}),R&&g("option",{onClick:()=>{h(b),o();},children:[f(Ho,{children:f(Nd,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Ho,{children:f(Fr,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{v(b),o();},selected:k,children:[f(Ho,{children:f(Cr,{fontSize:"small"})}),f($t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&g("option",{onClick:()=>{y(b),o();},selected:w,children:[f(Ho,{children:f(nn,{fontSize:"small"})}),f($t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{p(b),o();},children:[f(Ho,{children:f(np,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.hideColumn")})]})]})},bp=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=useMemo(()=>new Set(l.map(y=>y.field)),[l]),m=useMemo(()=>r.filter(y=>!u.has(y.id)),[r,u]),f$1=()=>{let y=m[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((x,b)=>b!==y));},p=(y,g)=>{d(x=>x.map((b,C)=>C===y?{...b,...g}:b));},v=(y,g)=>{d(x=>{let b=y+g;if(b<0||b>=x.length)return x;let C=[...x],[k]=C.splice(y,1);return C.splice(b,0,k),C});};return f(Et,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(Se,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(Se,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(Se,{variant:"primary",onClick:()=>{a(l),o();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(ae,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g$1)=>{let x=new Set(l.filter((C,k)=>k!==g$1).map(C=>C.field)),b=r.filter(C=>!x.has(C.id));return g("div",{className:"orb-table-sort-rule",children:[f(qa,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(Ht,{size:"small",value:y.field,onChange:C=>p(g$1,{field:C.target.value}),options:b.map(C=>({value:C.id,label:C.label}))}),f(Ht,{size:"small",value:y.direction,onChange:C=>p(g$1,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(Xs,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===l.length-1,children:f(qs,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g$1),children:f(ja,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Se,{size:"small",onClick:f$1,disabled:m.length===0,startIcon:f(Fr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var Qn=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),vp=({kpis:t})=>{let{t:o}=de(),r=[{label:o("graph.kpi.totalRecords"),value:Qn(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:Qn(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:Qn(t.totalBillableHours),color:"var(--orb-primary)"},{label:o("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:o("graph.kpi.amount"),value:Qn(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:Qn(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(n=>g(Ne,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(E,{variant:"caption",muted:true,children:n.label}),f(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};var fi=({title:t,subtitle:o,children:r})=>g(Ne,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var jn=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return o==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),f(E,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),g(E,{variant:"caption",muted:true,children:[l.value.toFixed(1),r]})]},l.name))}):f(ae,{spacing:1,children:t.map(l=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:l.name,children:l.name}),f("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:f("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),r]})]},l.name))})};var yp=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(h=>h.value),l=Math.min(...s,0),u=Math.max(...s,1)-l||1,m=t.map((h,p)=>{let v=i+p*(a-i*2)/Math.max(t.length-1,1),y=n-i-(h.value-l)/u*(n-i*2);return {x:v,y,...h}}),f$1=m.map(h=>`${h.x},${h.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:f$1}),m.map(h=>f("circle",{cx:h.x,cy:h.y,r:4,style:{fill:o}},h.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),g(E,{variant:"caption",muted:true,children:[h.value.toFixed(1),r]})]},h.name))})]})};var Cp=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(m=>m.barValue),1),l=Math.max(...t.map(m=>m.lineValue),1),d=t.map((m,f)=>{let h=(a-i*2)/t.length,p=Math.max(h*.5,8),v=i+f*h+(h-p)/2,y=m.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:p,item:m}}),u=t.map((m,f)=>{let h=(a-i*2)/t.length,p=i+f*h+h/2,v=n-i-m.lineValue/l*(n-i*2);return {x:p,y:v,item:m}});return g(ae,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(m=>f("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:u.map(m=>`${m.x},${m.y}`).join(" ")}),u.map(m=>f("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};var wh=t=>{let r=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(r*100)}%, transparent)`},xp=({data:t})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=Array.from(new Set(t.map(i=>i.x))),r=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return f("div",{sx:{height:36,borderRadius:1,background:wh(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var kh=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],hi=({data:t,variant:o="donut",colors:r=kh,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,u)=>{let m=s;return s+=d.percent,`${r[u%r.length]} ${m}% ${s}%`});return g(ae,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ae,{spacing:1,sx:{minWidth:180},children:t.map((d,u)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:r[u%r.length]}}),f(E,{variant:"caption",sx:{flex:1},children:d.name}),g(E,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var Sp=({effect:t,branches:o})=>{if(o.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return g(ae,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};var wp=({data:t,height:o=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(f=>{let h=f.type==="total"?0:r,p=f.type==="total"?f.value:r+f.value;return f.type!=="total"&&(r=p),{...f,start:h,end:p,delta:p-h}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,u=s-i||1,m=f=>o-d-(f-i)/u*(o-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${l} ${o}`,style:{width:"100%",height:o},children:[f("line",{x1:d,y1:m(0),x2:l-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f$1,h)=>{let p=(l-d*2)/n.length,v=Math.max(p*.55,8),y=d+h*p+(p-v)/2,g$1=m(Math.max(f$1.start,f$1.end)),x=m(Math.min(f$1.start,f$1.end)),b=f$1.type==="total"?"var(--orb-chart-1)":f$1.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:y,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:b}}),f("text",{x:y+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f$1.end.toFixed(1)})]},f$1.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f$1=>f(E,{variant:"caption",title:f$1.name,children:f$1.name},f$1.name))})]})};var Jn=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},TM=(t,o=360)=>{let r=Jn(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var kp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?Jn({apiKey:t,query:o,zoom:n,mapType:a}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var bi=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Pp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||bi({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Tp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=de();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(fi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(jn,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(fi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(jn,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(fi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(hi,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Th=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Ih=["zh","en","de","fr","ja","ko"],Ip=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Th,promptLangOptions:i=Ih,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:u})=>{let[m,f$1]=useState(r),[h,p]=useState(d||""),[v,y]=useState(u||""),[g$1,x]=useState(false);useEffect(()=>{t&&(f$1(r),p(d||""),y(u||""));},[t,r,d,u]);let b=(k,w)=>{f$1(P=>({...P,[k]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:h||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return g(Et,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(ne,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(xr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ae,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(He,{size:"small",value:m.baseUrl,onChange:k=>b("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:m.apiKey,onChange:k=>b("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:m.model,onChange:k=>b("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>f("option",{value:k,children:k},k))})}),f("div",{children:f(He,{size:"small",value:m.promptLang,onChange:k=>b("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>f("option",{value:k,children:k},k))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(He,{size:"small",value:h,onChange:k=>p(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Bn,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:k=>b("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(He,{size:"small",value:v,onChange:k=>y(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),l.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Bn,{multiline:true,minRows:8,value:m.responsePrompt,onChange:k=>b("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(Se,{variant:"outlined",onClick:o,children:"Cancel"}),f(Se,{variant:"contained",onClick:C,disabled:!n||g$1,children:"Save"})]})]})};var yi=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=de(),[d,u]=useState(s?.defaultPrompt||""),[m,f$1]=useState(false),[h,p]=useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f$1(!0),await s.onSubmit(w,{filters:g$1,model:r});}finally{f$1(false);}};return f(Et,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ae,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(Ct,{label:l("graph.records",{count:r.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&f(Se,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ae,{direction:"row",spacing:10,alignItems:"center",children:[y&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ne,{size:"small",onClick:s?.onVoiceInput,children:f(Ma,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ne,{size:"small",onClick:k,disabled:m||!d.trim(),children:f(Ec,{size:16,strokeWidth:1.8})}),f(ne,{size:"small",onClick:()=>p(true),children:f(Jr,{size:16,strokeWidth:1.8})})]}),f(ne,{onClick:o,children:f(Yt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(vp,{kpis:r.kpis}),f(Tp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Ip,{open:h,onClose:()=>p(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Tr={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},Rh=5,Mp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ir=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Mp(s),s]));for(let s of r){let l=i.get(Mp(s));if(l)return l}return a[0]||n},ko=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},mo=(t,o)=>t==null||t===""?o:String(t),Dh=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mo(s[o],a);i.set(l,(i.get(l)||0)+ko(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Nh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(l[o],i),u=s.get(d)||{report:0,billable:0};u.report+=ko(l[r]),u.billable+=ko(l[n]),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},Ah=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=mo(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},Rp=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=mo(a[o],"N/A");n.set(i,(n.get(i)||0)+ko(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Eh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(l[o],i),u=s.get(d)||{report:0,billable:0};u.report+=ko(l[r]),u.billable+=ko(l[n]),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},Lh=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mo(s[o],a),d=mo(s[r],a),u=`${l}__${d}`;i.set(u,(i.get(u)||0)+ko(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,u]=s.split("__");return {x:d,y:u,value:l}})},Oh=(t,o,r)=>{let n=Rp(t,o,r),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},Fh=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mo(l[o],i),u=`${mo(l[r],i)} / ${mo(l[n],i)}`,m=s.get(d)||new Map;m.set(u,(m.get(u)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((u,m)=>m[1]-u[1]).slice(0,a).map(([u,m])=>`${u} (${m})`)})).slice(0,6)},pn=({rows:t,config:o})=>{let{t:r}=de(),n=r("graph.unassigned"),a=useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Ir(t,m?.primaryDimension,Tr.primaryDimension,"Category"),secondaryDimension:Ir(t,m?.secondaryDimension,Tr.secondaryDimension,"Owner"),status:Ir(t,m?.status,Tr.status,"Status"),date:Ir(t,m?.date,Tr.date,"Date"),description:Ir(t,m?.description,Tr.description,"Description"),reportHours:Ir(t,m?.reportHours,Tr.reportHours,"ReportHours"),billableHours:Ir(t,m?.billableHours,Tr.billableHours,"BillableHours"),amount:Ir(t,m?.amount,Tr.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((m,f)=>{let h=ko(m[a.reportHours]),p=ko(m[a.billableHours]),v=ko(m[a.amount]),y=h>0?p/h*100:0;return {id:`graph-row-${f}`,Date:mo(m[a.date],""),Primary:mo(m[a.primaryDimension],n),Secondary:mo(m[a.secondaryDimension],n),Description:mo(m[a.description],""),ReportHours:h,BillableHours:p,Amount:v,Efficiency:y,Status:mo(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,f=i.reduce((x,b)=>x+ko(b.ReportHours),0),h=i.reduce((x,b)=>x+ko(b.BillableHours),0),p=i.reduce((x,b)=>x+ko(b.Amount),0),v=f>0?h/f*100:0,y=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(mo(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:p,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||Rh,d=useMemo(()=>({billableByPrimary:Dh(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Nh(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:Ah(i,"Status",n),lineByDate:Rp(i,"Date","BillableHours"),comboByPrimary:Eh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Lh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Oh(i,"Date","BillableHours"),fishboneStatusCauses:Fh(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),u=useMemo(()=>({title:o?.title||r("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:r("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:r("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,o?.title,a,s,i,r]);return {fieldMapping:a,model:u}};var un=t=>String(t??"").trim(),xi=(t={})=>{let[o,r]=useState(t),n=useCallback((d,u)=>{r(m=>{let f=u?.trim();if(!f){let h={...m};return delete h[d],h}if(m[d]===f){let h={...m};return delete h[d],h}return {...m,[d]:f}});},[]),a=useCallback(d=>{r(u=>{if(!u[d])return u;let m={...u};return delete m[d],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=useCallback((d,u)=>d.filter(m=>!(o.primaryDimension&&un(m[u.primaryDimension])!==un(o.primaryDimension)||o.secondaryDimension&&un(m[u.secondaryDimension])!==un(o.secondaryDimension)||o.status&&un(m[u.status])!==un(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var wi=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(false),[u,m]=useState(""),[f$1,h]=useState(false),[p,v]=useState(false),y=t.find(b=>b.id===o),g$1=()=>{m(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:u,isDefault:f$1,isPublic:p,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(Ht,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:o||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(b=>({value:b.id,label:b.name+(b.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:b=>{let C=t.find(k=>k.id===b.target.value);C&&r(C);}}),f(lt,{title:s("variant.saveView"),children:f(ne,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(wr,{fontSize:"small"})})}),g(Et,{open:l,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(He,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:b=>m(b.target.value)}),f(Xn,{control:f(Tt,{checked:f$1,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),f(Xn,{control:f(Tt,{checked:p,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(Se,{onClick:()=>d(false),children:s("common.cancel")}),f(Se,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Np=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:u,currentVariantId:m,onVariantChange:f$1})=>{let{t:h}=de(),[p,v]=useState([]),[y,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,b=m!==void 0?m:y,C=D=>{m===void 0&&g(D),f$1&&f$1(D);},k=useCallback(()=>{try{let D=localStorage.getItem(x);if(!D)return [];let A=JSON.parse(D);return Array.isArray(A)?A:[]}catch{return []}},[x]),w=useCallback(D=>{try{localStorage.setItem(x,JSON.stringify(D));}catch{}},[x]),P=useCallback(D=>{v(D);let A=D.find(L=>L.isDefault);A&&!b&&(C(A.id),i(A));},[b,i,C]),I=useCallback(async()=>{if(!t)return [];try{let D=[];if(s)D=await s.getVariants(t,o);else if(l){let A=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!A.ok)throw new Error(h("variant.toast.fetchFailed"));D=await A.json();}else D=k();return P(D),D}catch(D){console.error("Error fetching variants",D);let A=k();return P(A),d&&d(h("variant.toast.fetchFailed")),A}},[t,o,s,l,k,P,d,h]);return useEffect(()=>{I();},[t,o]),f(wi,{variants:p,currentVariantId:b,onLoad:D=>{C(D.id),i(D);},onSave:async D=>{let A=Date.now().toString(),L;try{let O=D.scope||"Both",Y=p.find(Z=>Z.name===D.name);A=Y?Y.id:Date.now().toString();let H=[];if(Y&&(Array.isArray(Y.filters)?H=[...Y.filters]:Y.filters&&(H=[{scope:"default",filters:Y.filters}])),O==="Search"||O==="Both"){let Z=(Array.isArray(r),r);if(Z)if(Array.isArray(Z)&&Z.length>0&&Z[0].scope)Z.forEach(z=>{let B=H.findIndex(G=>G.scope===z.scope);B>=0?H[B]=z:H.push(z);});else {let z={scope:o,filters:Z},B=H.findIndex(G=>G.scope===o);B>=0?H[B]=z:H.push(z);}}let q=Y?.layout||{},V=[];if(Y&&Array.isArray(Y.layoutRefs)&&(V=[...Y.layoutRefs]),O==="Layout"||O==="Both")if(a&&a.length>0)a.forEach(Z=>{let z=V.findIndex(B=>B.tableKey===Z.tableKey);z>=0?V[z]=Z:V.push(Z);});else {let Z={tableKey:o,layoutId:n||null},z=V.findIndex(B=>B.tableKey===o);z>=0?V[z]=Z:V.push(Z);}if(L={appId:t,tableKey:o,...D,scope:O,id:A,createdAt:new Date().toISOString(),filters:H,layout:q,layoutRefs:V},s)await s.saveVariant(L,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let z=p.some(B=>B.id===A)?p.map(B=>B.id===A?L:B):[...p,L];v(z),w(z);}u&&u(h("variant.toast.saveSuccess")),(s||l)&&await I(),C(A),i(L);}catch(O){console.error("Error saving variant",O);let H=p.some(q=>q.id===A)?p.map(q=>q.id===A?L:q):[...p,L];v(H),w(H),C(A),i(L),d&&d(h("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(s)await s.deleteVariant(D);else if(l){if(!(await fetch(`${l}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let A=p.filter(L=>L.id!==D);v(A),w(A);}b===D&&C(""),(s||l)&&I(),u&&u(h("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=p.filter(O=>O.id!==D);v(L),w(L),b===D&&C(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let A=p.find(O=>O.id===D);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(D,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let O=p.map(Y=>({...Y,isDefault:Y.id===D}));v(O),w(O);}(s||l)&&await I(),u&&u(h("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=p.map(O=>({...O,isDefault:O.id===D}));v(L),w(L),d&&d(h("variant.toast.defaultFailed"));}}})};tr.extend($h);tr.extend(_h);tr.extend(Mf);var ta="YYYY-MM-DD",Uh=[null,null],Hr="0.85rem",Kh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},qh=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=ao();return f(xd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!o&&!r?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},Ep=({label:t,value:o=Uh,onChange:r})=>{let{t:n,locale:a}=de(),i=Kh[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[u,m]=useState(o),[f$1,h]=useState("start"),[p,v]=useState(null),[y,g$1]=useState((o[0]||tr()).locale(i)),[x,b]=useState(""),[C,k]=useState(""),[w,P]=useState(false),[I,S]=useState(false),N=jt__default.useRef(o);useEffect(()=>{let[Z,z]=o,[B,G]=N.current,U=pe=>pe&&typeof pe.isSame=="function",ge=!(Z===null&&B===null||U(Z)&&U(B)&&Z.isSame(B,"day")),ie=!(z===null&&G===null||U(z)&&U(G)&&z.isSame(G,"day"));(ge||ie)&&(m(o),o[0]&&U(o[0])&&g$1(o[0].locale(i))),N.current=o;},[o,i]),useEffect(()=>{b(u[0]?u[0].locale(i).format(ta):""),k(u[1]?u[1].locale(i).format(ta):""),P(false),S(false);},[u,i]);let R=(Z,z)=>{let B=z.trim(),G=Z==="start"?P:S;if(!B){let ie=Z==="start"?[null,u[1]]:[u[0],null];G(false),m(ie);return}let U=tr(B,ta,true).locale(i);if(!U.isValid()){G(true);return}G(false);let ge=[...u];if(Z==="start")ge[0]=U,ge[1]&&U.isAfter(ge[1],"day")&&(ge[1]=null),h(ge[1]?"start":"end");else {let ie=ge[0];ie&&U.isBefore(ie,"day")?(ge=[U,null],h("end")):(ge[1]=U,h("start"));}m(ge),g$1(U);},T=Z=>{d(Z.currentTarget);},D=()=>{d(null),h("start"),v(null);},A=!!l,L=Z=>{if(!Z)return;let z=[...u];if(f$1==="start")z=[Z,null],h("end");else {let B=z[0];B&&Z.isBefore(B)?(z=[Z,null],h("end")):(z=[B,Z],h("start"));}m(z);},O=Z=>{let z=tr().locale(i),B=[null,null];switch(Z){case "today":B=[z,z];break;case "week":B=[z.startOf("week"),z.endOf("week")];break;case "month":B=[z.startOf("month"),z.endOf("month")];break}m(B),h("start"),g$1(z);},Y=()=>{r&&r(u),D();},H=()=>{m(o),h("start"),D();},q=useCallback(Z=>{let{day:z,...B}=Z,[G,U]=u,ge=G?z.isSame(G,"day"):false,ie=U?z.isSame(U,"day"):false,pe=G&&U?z.isBetween(G,U,"day","()"):false,xe=false;return f$1==="end"&&G&&!U&&p&&z.isAfter(G,"day")&&z.isBefore(p.add(1,"day"),"day")&&(xe=true),f(qh,{...B,day:z,disableMargin:true,isStart:ge,isEnd:ie,isInRange:pe||xe,onMouseEnter:()=>v(z)})},[u,f$1,p]),V=Z=>Z?Z.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(He,{className:"orb-date-range-field",label:s,value:u[0]?`${V(u[0])} - ${V(u[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Hr}},InputProps:{readOnly:true,sx:{fontSize:Hr,"& .orb-inp":{fontSize:Hr},paddingRight:"4px"},endAdornment:f(ne,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(Ya,{open:A,anchorEl:l,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ae,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(He,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:ta,value:x,error:w,size:"small",onFocus:()=>h("start"),onChange:Z=>{b(Z.target.value),w&&P(false);},onBlur:()=>R("start",x),onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),R("start",x));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}}),f(Pd,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:ta,value:C,error:I,size:"small",onFocus:()=>{u[0]&&h("end");},onChange:Z=>{k(Z.target.value),I&&S(false);},onBlur:()=>R("end",C),onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),R("end",C));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ae,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>O("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>O("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>O("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(wd,{dateAdapter:Ua,adapterLocale:i,children:f(Sd,{value:null,referenceDate:y,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:q},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(ae,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Se,{size:"small",onClick:H,color:"inherit",children:n("common.cancel")}),f(Se,{size:"small",variant:"contained",onClick:Y,children:n("common.done")})]})]})]})};var Pi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Zh={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},Qh=["contains","notContains",">",">=","<","<=","equals"],Op=["=","!=",">","<",">=","<=","between"],to="0.85rem",jh=({field:t,value:o,onChange:r})=>{let{t:n}=de(),[a,i]=useState(null),[s,l]=useState(null),[d,u]=useState(null),[m,f$1]=useState(""),[h,p]=useState(""),[v,y]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(T)},[v]);let b=o?.operator||(t.type==="number"?"=":"equals"),C=o?.value,k=T=>{let D=Zh[T];return D?n(D):T},w=T=>{i(a?null:T.currentTarget);},P=T=>{r({...o,operator:T,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let D=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?tr.isDayjs(A[0])?A[0]:tr(A[0]):null,O=A[1]?tr.isDayjs(A[1])?A[1]:tr(A[1]):null;return [L,O]}return tr.isDayjs(A)||typeof A=="string"?[tr.isDayjs(A)?A:tr(A),null]:[null,null]})(C);return f(Ep,{label:t.label,value:D,onChange:A=>r({value:A,operator:"between"})})}if(S==="number"&&b==="between"){let T=()=>{r({value:[m,h],operator:"between"}),l(null);},D=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:D,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(ar,{position:"start",children:f(lt,{title:k("between"),children:f(ne,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:to},children:Pi.between})})}),readOnly:true},onClick:A=>l(s?null:A.currentTarget)}),f(Zt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:Op.map(A=>g("option",{selected:A===b,onClick:()=>P(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[A]}),f($t,{primary:k(A),primaryTypographyProps:{fontSize:to}})]},A))}),f(Ya,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(He,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:A=>f$1(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}}}),f(Td,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:h,onChange:A=>p(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:to}},InputProps:{sx:{fontSize:to}}}),f(Se,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let T=t.valueHelp?.mode||"single";return f(cp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(T==="multiple"?[]:null),mode:T,onChange:D=>r({value:D,operator:T==="multiple"?"anyOf":"equals"})})}if(S==="select")return g(Ht,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:T=>r({...o,value:T.target.value,operator:"equals"}),children:[f("option",{value:"",children:n("common.none")}),t.options?.map(T=>f("option",{value:T.value,children:T.label},T.value))]});if(S==="multi-select"){let T=Array.isArray(C)?C:[],D=t.options?.filter(q=>q.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=q=>t.options?.find(V=>V.value===q)?.label||q,L=T.map(A),O=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),Y=()=>{u(null),y(""),x("");},H=q=>{let V=T.includes(q)?T.filter(Z=>Z!==q):[...T,q];r({...o,value:V,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Se,{variant:"outlined",size:"small",onClick:q=>u(d?null:q.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:to,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O}),f(zo,{fontSize:"small"})]}),f(Zt,{anchorEl:d,open:!!d,onClose:Y,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:q=>q.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(ar,{position:"start",children:f(Br,{fontSize:"small"})}),sx:{fontSize:to}},value:v,onChange:q=>y(q.target.value),onKeyDown:q=>q.stopPropagation()}),D.length>0?D.map(q=>{let V=T.includes(q.value);return g("div",{role:"option","aria-selected":V,tabIndex:0,className:`orb-menu-item ${V?"orb-selected":""}`,onClick:()=>H(q.value),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),H(q.value));},children:[f(Tt,{checked:V,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f($t,{primary:q.label})]},String(q.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let N=S==="number"?Op:Qh;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:f(ar,{position:"start",children:f(lt,{title:k(b),children:f(ne,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:to,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Pi[b]})})}),endAdornment:t.hasSearchIcon?f(ar,{position:"end",children:f(Br,{color:"action"})}):void 0}}),f(Zt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:"auto",py:.5}}},children:N.map(T=>g("option",{selected:T===b,onClick:()=>P(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Pi[T]}),f($t,{primary:k(T),primaryTypographyProps:{fontSize:to}})]},T))})]})},Vo=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:u,loading:m=false,appId:f$1,tableKey:h,currentLayout:p,currentLayoutId:v,layoutRefs:y,variantService:g$1,serviceUrl:x})=>{let{t:b}=de(),[C,k]=useState(true),[w,P]=useState(null),[I,S]=useState(t.filter(D=>!D.hidden).map(D=>D.id)),N=(D,A)=>{r({...o,[D]:A});},R=D=>{I.includes(D)?S(I.filter(A=>A!==D)):S([...I,D]);};return g(Ne,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[f$1?f(Np,{appId:f$1,tableKey:h,currentFilters:{values:o,visibleFields:I},currentLayout:p,currentLayoutId:v,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let A=null;if(Array.isArray(D.filters)){let L=h||"default",O=D.filters.find(Y=>Y.scope===L);A=O?O.filters:null;}else A=D.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&S(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(D);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(wi,{variants:n,currentVariantId:a,onLoad:i,onSave:D=>{s&&s({...D,filters:{values:o,visibleFields:I}});},onDelete:l,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(lt,{title:b("smartFilter.addFilters"),children:f(Se,{className:"orb-smart-filter-adapt",onClick:D=>P(w?null:D.currentTarget),size:"small",color:"primary",startIcon:f(Qd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:to,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),f(ne,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:u,disabled:m,children:m?f(qo,{size:16}):f(Pt,{name:"play",size:16})}),g(Zt,{anchorEl:w,open:!!w,onClose:()=>P(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:to,minHeight:32}}}},children:[f("option",{disabled:true,children:f($t,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:to}})}),f(Rt,{}),t.map(D=>g("option",{onClick:()=>R(D.id),children:[f(Tt,{checked:I.includes(D.id),size:"small"}),f($t,{primary:D.label,primaryTypographyProps:{fontSize:to}})]},D.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(Ks,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(D=>I.includes(D.id)).map(D=>f(Ks,{size:1,children:f(jh,{field:D,value:o[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:A=>N(D.id,A)})},D.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ne,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?f(Ja,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(zo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Fp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(null),[u,m]=useState(false),[f$1,h]=useState(""),[p,v]=useState(""),[y,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),b=I=>{d(I.currentTarget);},C=()=>{d(null);},k=I=>{r(I),C();},w=()=>{h(""),v(""),g$1({isDefault:false,isPublic:false}),m(true),C();},P=()=>{f$1.trim()&&(n({name:f$1,description:p,...y}),m(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(lt,{title:s("layout.layoutOptions"),children:f(ne,{onClick:b,color:x?"primary":"default",size:"small",children:f(rp,{fontSize:"small"})})}),g(Zt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:w,children:[f(Ho,{children:f(wr,{fontSize:"small"})}),f($t,{children:s("layout.saveCurrentLayout")})]}),f(Rt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>f("option",{onClick:()=>k(I),selected:I.id===o,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(E,{variant:"body2",fontWeight:I.id===o?"bold":"normal",noWrap:true,children:I.name})}),I.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:N=>N.stopPropagation(),children:[f(lt,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ne,{size:"small",onClick:N=>{N.stopPropagation(),i(I.id);},children:I.isDefault?f(ep,{fontSize:"small",color:"warning"}):f(Jd,{fontSize:"small"})})}),f(lt,{title:s("common.delete"),children:f(ne,{size:"small",color:"error",onClick:N=>{N.stopPropagation(),a(I.id);},children:f(Qa,{fontSize:"small"})})})]})]})},I.id||S))]}),f(Et,{open:u,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(Se,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),f(Se,{onClick:P,variant:"primary",disabled:!f$1.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:f$1,onChange:I=>h(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f$1)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:p,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g$1({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g$1({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var gn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:u}=de(),[m,f$1]=useState([]),[h,p]=useState(""),v=`orbcafe.layouts.${t}.${o}`,y=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:o,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let N=JSON.parse(S);return Array.isArray(N)?N:[]}catch{return []}},[v]),b=useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);useEffect(()=>{i!==void 0&&p(i);},[i]),useEffect(()=>{if(a&&m.length>0){let S=m.find(N=>N.id===a);S&&(p(S.id),n(S));}},[a,m,n]);let C=useCallback(async()=>{if(t){if(!s){let S=x();f$1(S);let N=S.find(R=>R.isDefault);N&&!h&&!a&&(p(N.id),n(N));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await S.json()).map(y);f$1(R);let T=R.find(D=>D.isDefault);T&&!h&&!a&&(p(T.id),n(T));}catch(S){console.error("Error fetching layouts",S);let N=x();f$1(N);let R=N.find(T=>T.isDefault);R&&!h&&!a&&(p(R.id),n(R)),l&&l(u("layout.toast.loadFallback"));}}},[t,o,s,l,h,n,a,x,u]);return useEffect(()=>{C();},[t,o]),f(Fp,{layouts:m,currentLayoutId:h,onLoad:S=>{p(S.id),n(S);},onSave:async S=>{let N=m.find(D=>D.name===S.name),R=N?N.id:Date.now().toString(),T={id:R,...S,createdAt:new Date().toISOString(),layoutData:r,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let A=m.some(L=>L.id===R)?m.map(L=>L.id===R?T:L):[...m,T];f$1(A),b(A),p(R),n(T),d&&d(u("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(u("layout.toast.saveSuccess")),await C(),p(R),n(T);}catch(D){console.error("Error saving layout",D);let L=m.some(O=>O.id===R)?m.map(O=>O.id===R?T:O):[...m,T];f$1(L),b(L),p(R),n(T),d&&d(u("layout.toast.saveLocalSuccess")),l&&l(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let N=m.filter(R=>R.id!==S);f$1(N),b(N),h===S&&p(""),d&&d(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===S&&p(""),d&&d(u("layout.toast.deleteSuccess")),await C();}catch(N){console.error("Error deleting layout",N);let R=m.filter(T=>T.id!==S);f$1(R),b(R),h===S&&p(""),d&&d(u("layout.toast.deleteLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let N=m.map(R=>({...R,isDefault:R.id===S}));f$1(N),b(N),d&&d(u("layout.toast.defaultLocalSuccess"));return}try{let N=m.find(T=>T.id===S);if(!N)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...N,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(u("layout.toast.defaultSuccess")),await C();}catch(N){console.error("Error setting default",N);let R=m.map(T=>({...T,isDefault:T.id===S}));f$1(R),b(R),d&&d(u("layout.toast.defaultLocalSuccess")),l&&l(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ti=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ii=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function Hp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function Jh(t,o){return t==="desc"?(r,n)=>Hp(r,n,o):(r,n)=>-Hp(r,n,o)}function eb(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var fn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=useCallback(X=>{let Q=String(X?.label??X?.id??"").length*9+64,fe=typeof X?.minWidth=="number"?X.minWidth:0;return Math.max(100,fe,Q)},[]),a=useCallback(()=>(t.columns||[]).filter(X=>!!X?.numeric).map(X=>X.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[u,m]=useState(t.orderBy||""),[f,h]=useState([]),[p,v]=useState(t.page||0),[y,g]=useState(t.rowsPerPage||20),[x,b]=useState(t.selected||[]),[C,k]=useState(t.columns?t.columns.map(X=>X.id):[]),[w,P]=useState(t.columns?t.columns.map(X=>X.id):[]),[I,S]=useState(t.showSummary||false),[N,R]=useState(()=>a()),[T,D]=useState([]),[A,L]=useState(new Set),[O,Y]=useState(()=>{let X={};return (t.columns||[]).forEach(W=>{X[W.id]=n(W);}),X}),[H,q]=useState(null),[V,Z]=useState(null),[z,B]=useState(null),[G,U]=useState(null),[ge,ie]=useState(false),[pe,xe]=useState(""),[We,we]=useState(""),se=o?[]:T,Ae=useCallback(X=>{if(o){D([]),L(new Set),Z(null);return}D(X);},[o]);useEffect(()=>{o&&(D([]),L(new Set),Z(null));},[o]),useEffect(()=>{r&&(d("asc"),m(""),h([]));},[r]),useEffect(()=>{t.layout&&St(t.layout);},[t.layout]),useEffect(()=>{if(r){d("asc"),m("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&m(t.orderBy);},[t.order,t.orderBy,r]),useEffect(()=>{t.selected!==void 0&&b(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let X=a();R(W=>W.filter(fe=>X.includes(fe)));},[a]),useEffect(()=>{Y(X=>{let W={...X};return (t.columns||[]).forEach(Q=>{W[Q.id]===void 0&&(W[Q.id]=n(Q));}),W});},[t.columns,n]),useEffect(()=>{P(X=>{let W=(t.columns||[]).map(Ke=>Ke.id),Q=new Set(W),fe=X.filter(Ke=>Q.has(Ke)),ye=new Set(fe),Ee=W.filter(Ke=>!ye.has(Ke)),$e=[...fe,...Ee];return $e.length===X.length&&$e.every((Ke,Ze)=>Ke===X[Ze])?X:$e});},[t.columns]);let Ie=useMemo(()=>{let X=t.columns||[];if(w.length===0)return X;let W=new Map(X.map(ye=>[ye.id,ye])),Q=[],fe=new Set;return w.forEach(ye=>{let Ee=W.get(ye);Ee&&(Q.push(Ee),fe.add(ye));}),X.forEach(ye=>{fe.has(ye.id)||Q.push(ye);}),Q},[t.columns,w]),ke=useMemo(()=>{let X=t.rows||[];return i&&(X=X.filter(W=>Object.keys(W).some(Q=>String(W[Q]).toLowerCase().includes(i.toLowerCase())))),X},[t.rows,i]),ze=useMemo(()=>{if(r||t.onSortChange)return ke;if(f.length>0){let X=[...ke];return X.sort((W,Q)=>{for(let fe of f){let ye=W?.[fe.field],Ee=Q?.[fe.field];if(!(ye==null&&Ee==null)){if(ye==null)return fe.direction==="asc"?-1:1;if(Ee==null)return fe.direction==="asc"?1:-1;if(ye<Ee)return fe.direction==="asc"?-1:1;if(ye>Ee)return fe.direction==="asc"?1:-1}}return 0}),X}return u?eb(ke,Jh(l,u)):ke},[ke,l,u,f,t.onSortChange,r]),et=useCallback(X=>{if(se.length===0)return X.map(Ee=>({type:"row",data:Ee,id:Ee[t.rowKey||"id"]}));let W=[...X].sort((Ee,$e)=>{for(let Ke of se){if(Ee[Ke]<$e[Ke])return -1;if(Ee[Ke]>$e[Ke])return 1}return 0}),Q=(Ee,$e=0)=>{if($e>=se.length)return Ee;let Ke=se[$e],Ze={},ut=[];return Ee.forEach(gt=>{let Mt=gt[Ke],bt=`${Ke}:${Mt}`;Ze[bt]||(Ze[bt]={key:bt,field:Ke,value:Mt,children:[],count:0,level:$e},ut.push(Ze[bt])),Ze[bt].children.push(gt),Ze[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=Q(gt.children,$e+1));}),ut},fe=Q(W),ye=(Ee,$e="")=>{let Ke=[];return Ee.forEach(Ze=>{if(Ze.children){let ut=$e?`${$e}>${Ze.key}`:Ze.key,gt=A.has(ut);Ke.push({type:"group",id:ut,field:Ze.field,value:Ze.value,level:Ze.level,count:Ze.count,isExpanded:gt,childIds:(function Mt(bt){let F=[];return bt.children.forEach(j=>{j.children?F=F.concat(Mt(j)):F.push(j[t.rowKey||"id"]);}),F})(Ze)}),gt&&(Ke=Ke.concat(ye(Ze.children,ut)));}else Ke.push({type:"row",data:Ze,id:Ze[t.rowKey||"id"],level:se.length});}),Ke};return ye(fe)},[se,A,t.rowKey]),rt=useCallback(X=>{if(se.length===0)return [];let W=[...X].sort((ye,Ee)=>{for(let $e of se){if(ye[$e]<Ee[$e])return -1;if(ye[$e]>Ee[$e])return 1}return 0}),Q=[],fe=(ye,Ee,$e)=>{if(Ee>=se.length)return;let Ke=se[Ee],Ze=new Map;ye.forEach(ut=>{let gt=ut[Ke],Mt=Ze.get(gt);Mt?Mt.push(ut):Ze.set(gt,[ut]);}),Ze.forEach((ut,gt)=>{let Mt=`${Ke}:${gt}`,bt=$e?`${$e}>${Mt}`:Mt;Q.push(bt),fe(ut,Ee+1,bt);});};return fe(W,0,""),Q},[se]),at=useMemo(()=>et(ze),[ze,et]),K=useMemo(()=>rt(ze),[ze,rt]),Re=useMemo(()=>{let X=(t.rows||[]).length;return typeof t.count=="number"&&t.count>X},[t.count,t.rows]),ve=useMemo(()=>Re?at:y>0?at.slice(p*y,p*y+y):at,[at,p,y,Re]),Fe=useMemo(()=>Re&&typeof t.count=="number"?t.count:at.length,[at.length,Re,t.count]),nt=X=>{L(W=>{let Q=new Set(W);return Q.has(X)?Q.delete(X):Q.add(X),Q});},Ye=X=>{let W=K.filter(Q=>Q===X||Q.startsWith(`${X}>`));L(Q=>{let fe=new Set(Q);return W.forEach(ye=>fe.add(ye)),fe});},xt=X=>{L(W=>{let Q=new Set(W);return Array.from(Q).forEach(fe=>{(fe===X||fe.startsWith(`${X}>`))&&Q.delete(fe);}),Q});},It=X=>{if(!X){L(new Set);return}L(new Set(K));},Lt=X=>{let W=K.filter(Q=>Q.startsWith(`${X}>`));return W.length===0?A.has(X):A.has(X)&&W.every(Q=>A.has(Q))},Nt=X=>{if(r)return;f.length>0&&h([]);let W=u===X&&l==="asc",Q=u===X&&l==="desc";if(t.onSortChange){W?t.onSortChange(X,"desc"):Q?t.onSortChange("","asc"):t.onSortChange(X,"asc");return}W?(d("desc"),m(X)):Q?(d("asc"),m("")):(d("asc"),m(X));},te=X=>{if(r){d("asc"),m(""),h([]);return}let W=X.filter(Q=>Q&&Q.field);h(W),W.length>0&&m("");},Ge=()=>{h([]);},Oe=(X,W)=>{Y(Q=>({...Q,[X]:W}));},le=X=>{if(X.target.checked){let W=ke.map(Q=>Q[t.rowKey||"id"]);b(W),t.onSelectionChange&&t.onSelectionChange(W);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},be=(X,W)=>{let Q=W[t.rowKey||"id"],fe=x.indexOf(Q),ye=[];fe===-1?ye=ye.concat(x,Q):fe===0?ye=ye.concat(x.slice(1)):fe===x.length-1?ye=ye.concat(x.slice(0,-1)):fe>0&&(ye=ye.concat(x.slice(0,fe),x.slice(fe+1))),b(ye),t.onSelectionChange&&t.onSelectionChange(ye);},ee=X=>{v(X),t.onPageChange&&t.onPageChange(X);},he=X=>{g(X),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(X);},De=X=>{let W=C.indexOf(X),Q=[...C];W===-1?Q.push(X):Q.splice(W,1),k(Q);},je=X=>{if(o)return;let W=se.indexOf(X),Q=[...se];W===-1?Q.push(X):Q.splice(W,1),Ae(Q);},it=X=>{a().includes(X)&&R(Q=>Q.includes(X)?Q.filter(fe=>fe!==X):[...Q,X]);},dt=(X,W)=>{!X||!W||X===W||P(Q=>{let fe=Q.indexOf(X),ye=Q.indexOf(W);if(fe===-1||ye===-1)return Q;let Ee=[...Q];return Ee.splice(fe,1),Ee.splice(ye,0,X),Ee});},Ft=X=>{let W=X?.active?.id,Q=X?.over?.id;typeof W=="string"&&typeof Q=="string"&&dt(W,Q);},Kt=X=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:f,grouping:se,columnWidths:O,showSummary:I,summaryColumns:N});},zt=X=>{let{layout:W,layoutId:Q}=Ii(X,t.tableKey||"default");Q?(we(Q),xe(Q)):(we(""),xe("")),W&&(W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),h([])):(W.order&&d(W.order),W.orderBy&&m(W.orderBy),Array.isArray(W.sortBy)&&h(W.sortBy)),W.grouping&&Ae(W.grouping),W.columnWidths&&Y(W.columnWidths),W.showSummary!==void 0&&S(!!W.showSummary),Array.isArray(W.summaryColumns)&&R(W.summaryColumns));},St=X=>{let W=X?.layoutData||X?.layout||X||{};W.visibleColumns&&k(W.visibleColumns),Array.isArray(W.columnOrder)&&P(W.columnOrder),r?(d("asc"),m(""),h([])):(W.order&&d(W.order),W.orderBy!==void 0&&m(W.orderBy),Array.isArray(W.sortBy)&&h(W.sortBy)),W.grouping&&Ae(W.grouping),W.columnWidths&&Y(W.columnWidths),W.showSummary!==void 0&&S(!!W.showSummary),Array.isArray(W.summaryColumns)&&R(W.summaryColumns),L(new Set),v(0),X?.id&&xe(X.id),we("");};useEffect(()=>{t.layout&&zt({layout:t.layout});},[t.layout]);let Vt=X=>{X.preventDefault(),U(G===null?{mouseX:X.clientX+2,mouseY:X.clientY-6}:null);},ht=()=>{U(null);},Dt=useMemo(()=>{if(!I)return {};let X={};t.columns.forEach(Q=>{if(Q.numeric&&N.includes(Q.id)){let fe=ke.reduce((ye,Ee)=>{let $e=parseFloat(Ee[Q.id]);return ye+(isNaN($e)?0:$e)},0);X[Q.id]=fe.toFixed(2);}else X[Q.id]="";});let W=t.columns.find(Q=>C.includes(Q.id)&&!Q.numeric);return W&&!W.numeric&&(X[W.id]="Total"),X},[ke,t.columns,I,N,C]),st=()=>{if(!t.columns||!ke)return;let X=t.columns.map(Ee=>Ee.label).join(","),W=ke.map(Ee=>t.columns.map($e=>{let Ke=Ee[$e.id];return `"${(Ke==null?"":String(Ke)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
+
`),Q=`data:text/csv;charset=utf-8,${X}
|
|
3
|
+
${W}`,fe=encodeURI(Q),ye=document.createElement("a");ye.setAttribute("href",fe),ye.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye);},Ot=()=>{ie(true);},qt=()=>{ie(false);};return {isMobile:false,columns:Ie,order:l,setOrder:d,orderBy:u,setOrderBy:m,sortBy:f,setSortBy:h,applyMultiSort:te,clearMultiSort:Ge,columnOrder:w,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:N,grouping:se,setGrouping:Ae,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:V,setGroupAnchorEl:Z,summaryAnchorEl:z,setSummaryAnchorEl:B,columnWidths:O,setColumnWidths:Y,anchorEl:H,setAnchorEl:q,contextMenu:G,setContextMenu:U,sensors:void 0,sortedAndFilteredRows:ze,visibleRows:ve,summaryRow:Dt,page:p,setPage:ee,rowsPerPage:y,setRowsPerPage:he,totalDisplayCount:Fe,selected:x,setSelected:b,isAllExpanded:K.length>0&&K.every(X=>A.has(X)),handleColumnResize:Oe,handleRequestSort:Nt,handleSelectAllClick:le,handleClick:be,toggleSummaryColumn:it,handleDragEnd:Ft,handleColumnReorder:dt,handleExport:st,handleContextMenu:Vt,handleCloseContextMenu:ht,toggleColumnVisibility:De,toggleGroupExpand:nt,toggleGroupField:je,handleToggleAll:It,handleExpandGroupRecursively:Ye,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Lt,handleLayoutLoad:St,handleVariantLoad:zt,handleLayoutSave:Kt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:r?"asc":l,orderBy:r?"":u,sortBy:r?[]:f,columnOrder:w,grouping:se,columnWidths:O,showSummary:I,summaryColumns:N},currentLayoutId:pe,layoutIdToLoad:We,onPageChange:ee,onRowsPerPageChange:he,graphReportOpen:ge,handleOpenGraphReport:Ot,handleCloseGraphReport:qt}};var D1=t=>f("tbody",{...t}),N1=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),A1=t=>f("div",{...t}),E1=t=>f("thead",{...t}),L1=t=>f("tr",{...t}),jo=t=>{let{t:o}=de(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:f$1=false,maxHeight:h,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,disableGrouping:S=false,disableSorting:N=false}=t,R=n||o("table.title.default"),{isMobile:T,columns:D,order:A,orderBy:L,filterText:O,setFilterText:Y,visibleColumns:H,showSummary:q,setShowSummary:V,summaryColumns:Z,grouping:z,setGrouping:B,expandedGroups:G,groupAnchorEl:U,setGroupAnchorEl:ge,summaryAnchorEl:ie,setSummaryAnchorEl:pe,columnWidths:xe,anchorEl:We,setAnchorEl:we,contextMenu:se,sensors:Ae,sortedAndFilteredRows:Ie,summaryRow:ke,visibleRows:ze,isAllExpanded:et,page:rt,setPage:at,rowsPerPage:K,setRowsPerPage:Re,totalDisplayCount:ve,setSelected:Fe,handleColumnResize:nt,handleRequestSort:Ye,handleSelectAllClick:xt,handleClick:It,toggleSummaryColumn:Lt,handleDragEnd:Nt,handleExport:te,handleContextMenu:Ge,handleCloseContextMenu:Oe,toggleColumnVisibility:le,toggleGroupExpand:be,handleToggleAll:ee,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleLayoutLoad:it,handleVariantLoad:dt,handleLayoutSave:Ft,effectiveAppId:Kt,currentLayoutData:zt,currentLayoutId:St,layoutIdToLoad:Vt,graphReportOpen:ht,handleOpenGraphReport:Dt,handleCloseGraphReport:st}=fn(t),Ot=C?.enabled??false,qt=Ot&&(C?.interaction?.enabled??true),X=xi(),W=!!k?.enabled,Q=!!w?.enabled,fe=!!P?.enabled,ye=k?.fields,Ee=k?.excludeFields||[],$e=k?.initialValues||{},[Ke,Ze]=jt__default.useState(false),[ut,gt]=jt__default.useState(false),[Mt,bt]=jt__default.useState({}),[F,j]=jt__default.useState(false),[me,Pe]=jt__default.useState(false),[Je,qe]=jt__default.useState({}),[wt,ft]=jt__default.useState(false),[mt,yt]=jt__default.useState(false),oo=p||ut||me||mt,At=jt__default.useMemo(()=>{let oe=[...D];if(Array.isArray(ye)&&ye.length>0){let ue=new Set(ye);oe=oe.filter(J=>ue.has(J.id));}if(Ee.length>0){let ue=new Set(Ee);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[D,Ee,ye]),Xt=x||"id",Bt=jt__default.useMemo(()=>{let oe=new Set(s);return Ie.filter(ue=>oe.has(ue?.[Xt]))},[s,Ie,Xt]),Gt=Bt.length===1?Bt[0]:null,Wt=w?.fields,eo=w?.excludeFields||[],ro=w?.editableFields||[],go=w?.nonEditableFields||[],To=w?.primaryKeys?.length?w.primaryKeys:[Xt],Io=jt__default.useMemo(()=>{let oe=[...D];if(Array.isArray(Wt)&&Wt.length>0){let ue=new Set(Wt);oe=oe.filter(J=>ue.has(J.id));}if(eo.length>0){let ue=new Set(eo);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[D,eo,Wt]),or=jt__default.useMemo(()=>new Set(To),[To]),vo=jt__default.useMemo(()=>new Set(ro),[ro]),Lo=jt__default.useMemo(()=>new Set(go),[go]),Ur=jt__default.useCallback(oe=>vo.size>0?vo.has(oe):!(Lo.has(oe)||or.has(oe)),[vo,Lo,or]);jt__default.useEffect(()=>{!ht&&X.hasActiveFilters&&X.clearAll();},[ht,X.hasActiveFilters,X.clearAll]);let Kr=()=>{let oe={};At.forEach(ue=>{oe[ue.id]=$e[ue.id]??"";}),bt(oe),Ze(true);},Ar=()=>{ut||Ze(false);},qr=(oe,ue)=>{bt(J=>({...J,[oe]:ue}));},Xr=async()=>{if(!k?.onSubmit){Ze(false);return}try{gt(!0),await k.onSubmit(Mt),Ze(!1);}finally{gt(false);}},Mo=()=>{if(!Gt)return;let oe={};Io.forEach(J=>{oe[J.id]=Gt[J.id]??"";});let ue=w?.getInitialValues?{...oe,...w.getInitialValues(Gt)}:oe;qe(ue),j(true);},Er=()=>{me||j(false);},Yr=(oe,ue)=>{qe(J=>({...J,[oe]:ue}));},Uo=async()=>{if(Gt){if(!w?.onSubmit){j(false);return}try{Pe(!0),await w.onSubmit(Je,Gt),j(!1);}finally{Pe(false);}}},rr=()=>{Bt.length!==0&&ft(true);},Nn=()=>{mt||ft(false);},Lr=async()=>{if(Bt.length===0){ft(false);return}if(!P?.onConfirm){ft(false),Fe([]),l?.([]);return}try{yt(!0),await P.onConfirm(Bt),ft(!1),Fe([]),l?.([]);}finally{yt(false);}},M=Ie,{fieldMapping:$}=pn({rows:M,config:{...C,title:C?.title||`${R} ${o("graph.reportTitle")}`}}),_=jt__default.useMemo(()=>qt?X.applyRows(M,$):M,[qt,X.applyRows,M,$]),{model:ce}=pn({rows:_,config:{...C,title:C?.title||`${R} ${o("graph.reportTitle")}`,fieldMapping:$}}),Be=ce.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=Kt?f(gn,{appId:Kt,tableKey:b,currentLayoutData:zt,onLayoutLoad:it,targetLayoutId:Vt,activeLayoutId:St,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!S&&f(cn,{groupAnchorEl:U,setGroupAnchorEl:ge,grouping:z,setGrouping:B,columns:D}),f(dn,{anchorEl:We,setAnchorEl:we,columns:D,visibleColumns:H,toggleColumnVisibility:le}),f(mi,{anchorEl:ie,setAnchorEl:pe,showSummary:q,setShowSummary:V,columns:D,summaryColumns:Z,toggleSummaryColumn:Lt}),f(gi,{contextMenu:se,handleCloseContextMenu:Oe,columns:D,visibleColumns:H,toggleColumnVisibility:le})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(Vo,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:zt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(up,{title:R,loading:p,showSummary:q,setShowSummary:V,setAnchorEl:we,setSummaryAnchorEl:pe,filterText:O,setFilterText:Y,sortedAndFilteredRows:Ie,selected:s,columns:D,visibleColumns:H,summaryRow:ke,handleClick:It,selectionMode:i}),_e]}):g("div",{sx:{width:f$1?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(Vo,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:oe=>{dt(oe),g$1.onVariantLoad&&g$1.onVariantLoad(oe);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:p,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:zt}],currentLayoutId:St,layoutRefs:[{tableKey:b,layoutId:St}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ne,{className:"orb-ctable-surface",sx:{width:f$1?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":oo?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(ci,{filterText:O,setFilterText:Y,onRowsPerPageChange:Re,rowsPerPage:K,rowsPerPageOptions:v,page:rt,count:ve,onPageChange:at,actions:d,extraTools:u,grouping:z,disableGrouping:S,groupAnchorEl:U,setGroupAnchorEl:ge,showSummary:q,setShowSummary:V,anchorEl:We,setAnchorEl:we,summaryAnchorEl:ie,setSummaryAnchorEl:pe,handleExport:te,showCreateButton:W,onOpenCreateDialog:Kr,showEditButton:Q,onOpenEditDialog:Mo,editDisabled:Bt.length!==1,showDeleteButton:fe,onOpenDeleteConfirm:rr,deleteDisabled:Bt.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Ft:void 0,loading:p,layoutManager:ot,onOpenGraphReport:Ot?Dt:void 0}),f("div",{sx:{flex:1,...h?{maxHeight:h,height:h}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:Ae,collisionDetection:closestCenter,onDragEnd:Nt,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:f$1?750:void 0,width:f$1?"100%":"auto",tableLayout:Object.keys(xe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(pi,{columns:D,visibleColumns:H,order:A,orderBy:L,onRequestSort:Ye,disableSorting:N,onContextMenu:Ge,selectionMode:i,grouping:z,isAllExpanded:et,handleToggleAll:ee,rowCount:Ie.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:xe,onColumnResize:nt}),f(ui,{visibleRows:ze,columns:D,visibleColumns:H,selectionMode:i,selected:s,orderBy:L,loading:p,expandedGroups:G,toggleGroupExpand:be,handleExpandGroupRecursively:he,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:l,grouping:z,rowKeyProp:x,page:rt,rowsPerPage:K}),q&&f(pp,{showSummary:q,columns:D,visibleColumns:H,summaryRow:ke,selectionMode:i?.toString(),grouping:z,columnWidths:xe,orderBy:L,zIndex:3})]})})})]}),W&&g(Et,{open:Ke,onClose:Ar,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[At.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id;return f(He,{label:J,value:Mt[oe.id]??"",onChange:Le=>qr(oe.id,Le.target.value),type:ue,size:"small",fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),k?.description&&f(Zo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:Ar,sx:{fontSize:"0.85rem"},disabled:ut,children:k?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:k?.submitLabel||o("common.save")})]})]}),Q&&g(Et,{open:F,onClose:Er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||o("quickEdit.editWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Io.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id,Le=Ur(oe.id);return f(He,{label:J,value:Je[oe.id]??"",onChange:Qe=>Yr(oe.id,Qe.target.value),type:ue,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),w?.description&&f(Zo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:me,children:w?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Uo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:me||!Gt,children:w?.submitLabel||o("common.save")})]})]}),fe&&f(qn,{open:wt,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(Bt.length>1?o("quickDelete.confirmMessageMultiple",{count:Bt.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:Nn,onConfirm:Lr}),_e,Ot&&f(yi,{open:ht,onClose:st,model:ce,aiAssistant:C?.aiAssistant,interaction:qt?{enabled:true,filters:X.filters,fieldMapping:$,onPrimaryDimensionClick:oe=>X.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>X.setFilter("secondaryDimension",oe),onStatusClick:oe=>X.setFilter("status",oe),onClearFilter:X.clearFilter,onClearAll:X.clearAll}:void 0,tableContent:f(jo,{appId:Kt||"graph-report-internal",title:o("graph.dataBody"),columns:Be,rows:ce.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},O1=jo;var $1=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return g(ii,{title:o,hideHeader:r,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(Vo,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(jo,{...u,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var X1=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=de(),[u,m]=useState(false),[f,h]=useState([]),[p,v]=useState({}),[y,g]=useState(t.variants||[]),[x,b]=useState(t.layout||null),[C,k]=useState(""),[w,P]=useState(0),[I,S]=useState(0),[N,R]=useState(r),[T,D]=useState([]),[A,L]=useState("asc"),[O,Y]=useState("");useEffect(()=>{let ie={};t.filters.forEach(pe=>{pe.defaultValue!==void 0&&(ie[pe.id]=pe.defaultValue);}),v(ie);},[t.filters]);let H=useCallback(async(ie,pe,xe,We,we)=>{m(true);try{let se={...ie,page:pe+1,limit:xe,sort:we,order:We},Ae;o?Ae=await o(se):typeof t.api=="function"?Ae=await t.api(se):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,se),Ae={rows:[],total:0}):(console.warn("No API configured for report"),Ae={rows:[],total:0}),Ae&&(h(Ae.rows||[]),P(Ae.total||0));}catch(se){console.error("Failed to fetch report data",se);}finally{m(false);}},[t.api,o]);useEffect(()=>{H(p,I,N,A,O);},[H,I,N,A,O]);let q=()=>{S(0),H(p,0,N,A,O);},V=ie=>{S(0),R(ie);},Z=(ie,pe)=>{L(pe),Y(ie);},z=ie=>{v(ie);},B=ie=>{k(ie?.id||"");let pe=Ti(ie,a);if(pe){let We=pe.values??pe;v(We),H(We,0,N,A,O),S(0);}let{layout:xe}=Ii(ie,a);xe&&b(xe);},G=ie=>{let pe={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};g(xe=>[...xe,pe]);},U=ie=>{b(ie);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:p,onFilterChange:z,onSearch:q,onVariantLoad:B,onVariantSave:G,onVariantDelete:ie=>g(pe=>pe.filter(xe=>xe.id!==ie)),onVariantSetDefault:ie=>{g(pe=>pe.map(xe=>({...xe,isDefault:xe.id===ie})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:u,rowKey:"id",count:w,page:I,rowsPerPage:N,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:V,selectionMode:"multiple",selected:T,onSelectionChange:D,onLayoutSave:U,layout:x,title:t.title,showSummary:true,order:A,orderBy:O,serviceUrl:s,onSortChange:Z,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:p,rows:f,loading:u,refresh:q}};var sb=new Set(["id","title","description","icon","iconNode","meta"]),lb=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),cb=t=>Object.entries(t).filter(([o,r])=>!sb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:lb(o),value:String(r)})),Vp=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=de(),u=yo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";jt__default.useEffect(()=>{if(!o)return;let f=h=>{h.key==="Escape"&&r();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[o,r]);let m=cb(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:r,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:o?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:o?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Pt,{name:t.icon??"product",size:30,style:{color:u}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ne,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:r,children:f(Pt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):g(e,{children:[t.description?f(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,m.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(f$1=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f$1.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f$1.value})]},f$1.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(Se,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var db={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},pb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),l=yo()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Pt,{name:t.icon??"product",size:26,style:{color:l}});return g(Ne,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...db},children:t.description||"\xA0"})}),g(ae,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ne,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(ne,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},$p=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:u})=>{let{t:m}=de(),[f$1,h]=jt__default.useState(null),[p,v]=jt__default.useState(false),y=x=>{r?.(x),d&&(h(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>h(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(qo,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>f(pb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f$1?f(Vp,{item:f$1,open:p,onClose:g$1,onDownloadClick:n,renderContent:u,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:l??m("cardPage.empty")})})};var hD=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return g(ii,{title:o,hideHeader:r,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f(Vo,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f($p,{...a})})]}),i]})};var xD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,u]=useState(false),[m,f]=useState([]),[h,p]=useState(0),[v,y]=useState({}),[g,x]=useState(t.variants||[]),[b,C]=useState("");useEffect(()=>{let R={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(R[T.id]=T.defaultValue);}),y(R);},[t.filters]);let k=useCallback(async R=>{u(true);try{let T=o?await o({...R}):{rows:[],total:0};f(T?.rows||[]),p(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{u(false);}},[o]);useEffect(()=>{k(v);},[k]);let w=()=>{k(v);},P=R=>{y(R);},I=R=>{C(R?.id||"");let T=Ti(R,r);if(T){let D=T.values??T;y(D),k(D);}},S=R=>{let T={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};x(D=>[...D,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:P,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:R=>x(T=>T.filter(D=>D.id!==R)),onVariantSetDefault:R=>{x(T=>T.map(D=>({...D,isDefault:D.id===R})));},variants:g,currentVariantId:b,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:h,filters:v,loading:d,refresh:w}};var mb=t=>[...t].sort((o,r)=>r.value-o.value),kD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>mb(t),[t]),l=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),u=useMemo(()=>[...n],[n]),m=useMemo(()=>{let h=a.reduce((p,v)=>p+v.value,0);return a.map(p=>({...p,percent:h>0?p.value/h*100:p.percent}))},[a]),f=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:u,pies:m,waterfalls:f}};var RD=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":Jn({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),DD=({keyword:t,location:o})=>useMemo(()=>bi({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var na=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=useState(false),d=useMemo(()=>t.replace(/\n$/,"").split(`
|
|
4
|
+
`),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o}),r&&f(ne,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?f(Ko,{size:14,strokeWidth:1.8}):f(hr,{size:14,strokeWidth:1.8})})]}),f("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?d.map((m,f$1)=>g("div",{style:{display:"flex"},children:[f("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f$1+1}),f("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${f$1}-${m}`)):f("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};var yb=t=>{let o=t.trim();return o.startsWith("$$")&&o.endsWith("$$")&&o.length>=4&&(o=o.slice(2,-2).trim()),o.startsWith("$")&&o.endsWith("$")&&o.length>=2&&(o=o.slice(1,-1).trim()),o},Cb=async t=>new Function("m","return import(m)")(t),aa=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=useMemo(()=>yb(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await Cb("katex"),m=(d?.default||d)?.renderToString?.(n,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof m=="string"&&i(m);}catch{s&&i("");}})(),()=>{s=false;}},[r,n,o]),n?a?f(Te,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?f(Te,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n}):f(Te,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(ho,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};var wb=async t=>new Function("m","return import(m)")(t),tl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=useState(""),[s,l]=useState(""),[d,u]=useState(false),m=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let f=true;return (async()=>{if(!n||!m){i(""),l("");return}u(true),l(""),i("");try{let p=await wb("mermaid"),v=p?.default||p;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(p){if(f){let v=p instanceof Error?p.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&u(false);}})(),()=>{f=false;}},[n,m]),g(Or,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(Te,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(ho,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),g(Te,{sx:{p:1},children:[d&&f(Te,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(ld,{size:20})}),!d&&a&&f(Te,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&g(Te,{children:[s&&f(Zo,{severity:"info",sx:{mb:1},children:s}),f(na,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var ol=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),Pb=t=>/^:?-{3,}:?$/.test(t.trim()),Tb=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Mi=t=>{let o=t.split(`
|
|
5
|
+
`).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=ol(o[0]),n=ol(o[1]);if(r.length===0||n.length!==r.length||!n.every(Pb))return null;let a=n.map(Tb),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let l=ol(s);return l.length<r.length?[...l,...Array.from({length:r.length-l.length},()=>"")]:l.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},rl=({markdown:t,table:o,maxHeight:r=360})=>{let n=useMemo(()=>o||(t?Mi(t):null),[o,t]);return !n||n.headers.length===0?f(Or,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(ho,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Or,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(ud,{sx:{maxHeight:r},children:g(dd,{size:"small",stickyHeader:true,children:[f(md,{children:f(Us,{children:n.headers.map((a,i)=>f(Gs,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(pd,{children:n.rows.map((a,i)=>f(Us,{hover:true,children:a.map((s,l)=>f(Gs,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Te,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};var Ri=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=useState(r);return g(Te,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(ad,{direction:"row",alignItems:"center",spacing:.6,children:[f(id,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(rn,{fontSize:"inherit"})}),g(ho,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),f(on,{in:a,children:f(ho,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var nl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Di=t=>t.trim().startsWith("```"),Kp=t=>/^#{1,6}\s+/.test(t.trim()),al=t=>/^[-*+]\s+/.test(t.trim()),il=t=>/^\d+\.\s+/.test(t.trim()),qp=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),sl=t=>t.trim().startsWith(">"),Xp=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],n=t[o+1];return !r.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},Yp=t=>t.trim().startsWith("<think>")||t.trim()===":::think",ia=(t,o,r)=>{let n=[],a=0,i=0;nl.lastIndex=0;let s=nl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${r}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(f("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(f("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(f(Te,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let u=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);u?n.push(f(nd,{href:u[2],target:"_blank",rel:"noreferrer",children:u[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&o.enableMath?n.push(f(aa,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=nl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},sa=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??o??"",u=useMemo(()=>{let m=[],f$1=d.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),h={enableMath:n},
|
|
8
|
-
`).trim()},`think-tag-${
|
|
9
|
-
`).trim()},`think-fence-${
|
|
10
|
-
`);if(a&&x==="mermaid"){
|
|
11
|
-
`).trim(),allowKatex:true},`math-${
|
|
12
|
-
`),C=Mi(b);if(C){u.push(f(ol,{table:C},`table-${m}`)),m=x;continue}}if(sl(v)){let x=[];for(;m<f$1.length&&sl(f$1[m]);)x.push(f$1[m].replace(/^\s*>\s?/,"")),m+=1;u.push(f(Oo,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(gr,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,C)=>g(Fragment,{children:[C>0&&f("br",{}),aa(b,h,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(al(v)){let x=[];for(;m<f$1.length&&al(f$1[m]);)x.push(f$1[m].trim().replace(/^[-*+]\s+/,"")),m+=1;u.push(f(we,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,C)=>f(we,{component:"li",sx:{mb:.45},children:f(gr,{variant:"body2",children:aa(b,h,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(il(v)){let x=[];for(;m<f$1.length&&il(f$1[m]);)x.push(f$1[m].trim().replace(/^\d+\.\s+/,"")),m+=1;u.push(f(we,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,C)=>f(we,{component:"li",sx:{mb:.45},children:f(gr,{variant:"body2",children:aa(b,h,`ol-${m}-${C}`)})},`ol-item-${C}`))},`ol-${m}`));continue}let g$1=[];for(;m<f$1.length;){let x=f$1[m],b=x.trim();if(!b||Di(x)||Up(x)||Kp(x)||al(x)||il(x)||sl(x)||qp(f$1,m)||i&&Xp(x)||n&&b.startsWith("$$"))break;g$1.push(x),m+=1;}g$1.length>0?u.push(f(gr,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,b)=>g(Fragment,{children:[b>0&&f("br",{}),aa(x,h,`p-${m}-${b}`)]},`p-line-${b}`))},`p-${m}`)):m+=1;}return u},[d,n,a,i,s,l]);return f(we,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};var nN=(t,r)=>f(ia,{markdown:t,...r});var Yp=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>g(ae,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Bo,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(ud,{fullWidth:true,value:t,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ne,{size:"small",onClick:a,children:f(xo,{sx:{fontSize:d?16:18}})}),n&&f(ne,{size:"small",onClick:n,children:f(Gd,{sx:{fontSize:d?16:18}})}),f(ne,{size:"small",onClick:o,disabled:l||!t.trim(),children:f(Xd,{sx:{fontSize:d?16:18}})})]}),p&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var Zp=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},Ni=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return g(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return g("div",{sx:{minWidth:0},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Zp(n.label,r)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Zp(a,r):n.value})]},n.id)})})]})};var ll=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ei=t=>t.trim().toLowerCase(),Mb=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||ll(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Ei(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||ll(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Ei(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||ll(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:l,text:Ei(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},Qp=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(o||r[0]?.id),[p,u]=useState("idle"),[f,h]=useState([]),[m,v]=useState(""),[y,g]=useState(""),[x,b]=useState(false),C=useMemo(()=>Mb(t,r),[t,r]);useEffect(()=>{if(r.length===0){d(void 0);return}r.some(A=>A.id===l)||d(o||r[0]?.id);},[r,l,o]);let P=useCallback(()=>{u("idle"),h([]),v(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(u("idle"),h([]),v(""),g(""));},[]),k=useCallback(S=>{let A=Ei(S);return A?C.filter(R=>R.text.includes(A)).map(R=>R.hit):[]},[C]),I=useCallback(async()=>{let S=i.trim();if(!S)return;b(true);let A=k(S);if(h(A),A.length>0){u("search"),g(""),v(a("detail.searchAi.matches",{count:A.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){u("ai"),v(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(S,{query:S,hits:A,activeTabId:l,sections:t,tabs:r});g(typeof T=="string"?T:"");}finally{b(false);}return}u("search"),g(""),v(a("detail.searchAi.noMatch")),b(false);},[i,k,a,n,l,t,r]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:p,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:I,clearResult:P}};var AN=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:u="Close"})=>{let{t:f$1}=de(),{query:h,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g$1,hits:x,statusText:b,aiResponse:C,searching:P,handleSubmit:w,clearResult:k}=Qp({sections:o,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(R=>R.id===v)||n[0],[n,v]),S=useCallback(R=>{let T=N=>{let D=document.getElementById(R);if(D){D.scrollIntoView({behavior:"smooth",block:"center"});return}N<4&&setTimeout(()=>T(N+1),60);};requestAnimationFrame(()=>T(0));},[]),A=useCallback((R,T)=>{if(n.some(N=>N.id===R)){y(R),S(T?`detail-tab-${R}-section-${T}`:`detail-tab-${R}`);return}S(`detail-section-${R}`);},[n,y,S]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ae,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),g(ae,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(Yp,{value:h,onChange:m,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),k();},placeholder:s?.placeholder||f$1("detail.searchAi.placeholder"),statusText:b,loading:P,compact:true,showStatusText:false})}),p&&f(st,{title:u,children:f(ne,{size:"small",onClick:p,children:f(Nd,{fontSize:"small"})})}),l]})]}),b&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g$1==="search"&&x.length>0&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f$1("detail.searchAi.matches",{count:x.length})}),f(ae,{spacing:.35,children:x.slice(0,8).map(R=>f("div",{component:"button",type:"button",onClick:()=>A(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",f("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g$1==="ai"&&C&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f$1("detail.searchAi.aiResultTitle")}),f("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:f(ia,{markdown:C})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(R=>f("div",{id:`detail-section-${R.id}`,children:f(Ni,{section:R,highlightQuery:h})},R.id))}),n.length>0&&g(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(bd,{value:I?.id||false,onChange:(R,T)=>y(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(R=>f(vd,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(ae,{spacing:1.5,children:[(I?.sections||[]).map(R=>f("div",{id:`detail-tab-${I?.id}-section-${R.id}`,children:f(Ni,{section:R,highlightQuery:h})},R.id)),I?.fields&&I.fields.length>0&&f(Ni,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:h})]})]})]}),i&&f(Qr,{title:i.title||f$1("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var eu=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:u}=de(),[f$1,h]=useState(false),[m,v]=useState(t.title),y=()=>{v(t.title),h(false);},g$1=x=>{x.preventDefault();let b=m.trim();b&&(b!==t.title&&l?.(b),v(b),h(false));};return f(Ae,{elevation:0,sx:[x=>{let b=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:o?`1px solid ${tt(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${tt(b,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:b}}},...Array.isArray(p)?p:p?[p]:[]],children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(we,{sx:{minWidth:0,flex:1},children:g(we,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(we,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f$1?g(we,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??u("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),f(ne,{type:"submit",size:"small",tooltip:u("kanban.bucket.saveRename"),"aria-label":u("kanban.bucket.saveRename"),disabled:!m.trim(),children:f(Ur,{size:14})}),f(ne,{size:"small",tooltip:u("kanban.bucket.cancelRename"),"aria-label":u("kanban.bucket.cancelRename"),onClick:y,children:f(Xt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f$1&&g(ae,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(kt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(kt,{size:"small",label:`${u("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),l&&f(ne,{size:"small",tooltip:d??u("kanban.bucket.rename"),"aria-label":d??u("kanban.bucket.rename"),onClick:()=>{v(t.title),h(true);},sx:{width:26,height:26},children:f(bc,{size:14})})]})]}),o&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:u("kanban.bucket.dropHere")}),f(we,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:f(we,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??u("kanban.empty")})})})]})})};var Db={success:"success",warning:"warning",info:"info",error:"error"},Nb={critical:"error",high:"warning",medium:"info",low:"success"},Ab={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Eb=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},Lb=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",cl=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),l=!!(a&&r),d=t.tone??(t.priority?Nb[t.priority]:"default"),p=d==="default"?"primary":Db[d],u=Ab[d],f$1=r?{card:t,bucket:r}:void 0;return f(Ae,{onClick:l?()=>f$1&&a?.(f$1):void 0,onKeyDown:l?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f$1&&a?.(f$1));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(u,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:u},"&:hover":l?{transform:"translateY(-1px)",borderColor:tt(u,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(ae,{spacing:1.25,children:[g(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(we,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(kt,{size:"small",color:p,label:Eb(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(we,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>g(we,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&g(we,{children:[g(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(sd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:u,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&g(ae,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(we,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>f(kt,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),g(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(we,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Ka,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Lb(t.assignee.name)}),g(we,{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var tu=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},ru=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},Ob=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,ou=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Wr=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},Li=(t,r)=>{let o=Wr(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(p=>p.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(u=>({...u}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let l=a[n],d=Ob(r.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((u,f)=>({...u,bucketId:p.id,position:f}))}))}};var ul="kanban-card|",ml="kanban-bucket|",iu=t=>`${ul}${t}`,Kb=t=>`${ml}${t}`,Oi=t=>t?.startsWith(ul)?t.slice(ul.length):void 0,au=t=>t?.startsWith(ml)?t.slice(ml.length):void 0,qb=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:iu(t.id)}),p={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:n,style:p,...a,...i,children:f(cl,{card:t,bucket:r,dragging:d,onClick:o})})},Xb=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:Kb(t.id)});return f(we,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:f(eu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>iu(d.id)),strategy:verticalListSortingStrategy,children:f(ae,{spacing:1,children:t.cards.map(d=>f(qb,{card:d,bucket:t,onCardClick:i},d.id))})})})})},su=t=>String(t??"").toLocaleLowerCase(),Yb=(t,r)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>su(n).includes(r)),iA=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:u=false,searchValue:f$1,defaultSearchValue:h="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g$1})=>{let{t:x}=de(),[b,C]=useState(null),[P,w]=useState(),[k,I]=useState(h),S=f$1??k,A=S.trim().toLocaleLowerCase(),R=d??p??560,T=useMemo(()=>({buckets:t.buckets.map(z=>{let O=n?z.cards.filter(Q=>n(Q,z)):z.cards;if(!A)return {...z,cards:O};let Y=[z.id,z.title,z.description].some(Q=>su(Q).includes(A));return {...z,cards:Y?O:O.filter(Q=>Yb(Q,A))}})}),[n,t,A]),N=useMemo(()=>T.buckets.reduce((z,O)=>z+O.cards.length,0),[T]),D=useCallback(z=>{f$1===void 0&&I(z),m?.(z);},[m,f$1]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),B=useMemo(()=>b?Wr(t,b):void 0,[b,t]),X=useCallback(()=>{C(null),w(void 0);},[]),H=useCallback(z=>{if(!z)return;let O=Oi(z);return O?Wr(t,O)?.bucket.id:au(z)},[t]),K=useCallback(z=>{C(Oi(String(z.active.id))??null);},[]),W=useCallback(z=>{w(H(z.over?String(z.over.id):void 0));},[H]),G=useCallback(z=>{let O=Oi(String(z.active.id)),Y=z.over?String(z.over.id):void 0;if(!O||!Y){X();return}let Q=Wr(t,O);if(!Q){X();return}let me=Q.bucket.id,ie=Q.cardIndex,se=Oi(Y);if(se){let Re=Wr(t,se);if(!Re){X();return}me=Re.bucket.id,ie=Re.cardIndex;}else {let Re=au(Y),ke=t.buckets.find(ze=>ze.id===Re);if(!Re||!ke){X();return}me=Re,ie=ke.cards.length;}if(Q.bucket.id===me&&Q.cardIndex===ie){X();return}let fe=Li(t,{cardId:O,fromBucketId:Q.bucket.id,toBucketId:me,targetIndex:ie}),Ge=Wr(fe,O);Ge&&!(Ge.bucket.id===Q.bucket.id&&Ge.cardIndex===Q.cardIndex)&&r?.({cardId:O,fromBucketId:Q.bucket.id,toBucketId:Ge.bucket.id,targetIndex:Ge.cardIndex,card:Ge.card,model:fe}),X();},[t,r,X]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:K,onDragOver:W,onDragEnd:G,onDragCancel:X,children:[g(we,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(u||a)&&g(we,{role:u?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[u&&f(we,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:S,onChange:z=>D(z.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Fr,{size:16,"aria-hidden":"true"}),endAdornment:S?f(ne,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>D(""),sx:{width:26,height:26},children:f(Xt,{size:15})}):void 0})}),g(we,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[A&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:N>0?x("kanban.search.results",{count:N}):x("kanban.search.noMatch")}),a&&f(ye,{size:"small",variant:"secondary",startIcon:f(Da,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(we,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:T.buckets.map(z=>f(Xb,{bucket:z,highlighted:z.id===P,bucketHeight:R,emptyBucketLabel:A?x("kanban.search.noMatch"):y,onBucketRename:i?O=>i(z.id,O):void 0,onCardClick:o},z.id))})]}),f(DragOverlay,{children:B?f(we,{sx:{width:Math.max(l-24,260)},children:f(cl,{card:B.card,bucket:B.bucket,overlay:true})}):null})]})};var jb=({initialModel:t,initialBuckets:r,initialCards:o})=>t||ou({buckets:r??[],cards:o??[]}),pA=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=useState(()=>jb(t)),i=useCallback(h=>{a(m=>typeof h=="function"?h(m):h);},[]),s=useCallback(h=>Wr(n,h),[n]),l=useCallback((h,m,v)=>{let y=Wr(n,h);if(!y)return;let g=Li(n,{cardId:h,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=Wr(g,h);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let b={cardId:h,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(b),b},[n,r]),d=useCallback((h,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),p=useCallback(h=>{let m=tu(n,h);return m===n?false:(a(m),true)},[n]),u=useCallback((h,m)=>{let v=ru(n,h,m);return v===n?false:(a(v),true)},[n]),f=useMemo(()=>({model:n,onCardMove:h=>{l(h.cardId,h.toBucketId,h.targetIndex);},onCardClick:o}),[n,l,o]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:p,renameBucket:u,getCard:s},boardProps:f}};function yn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=useState(false),d=useRef(null),p=useRef(null),u=useRef(null),f=useRef(null),h=useRef(null),m=useRef(0),v=useRef(false),y=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),p.current&&(p.current.getTracks().forEach(C=>C.stop()),p.current=null),u.current&&(u.current.close(),u.current=null),y.current=false,l(false);},[]),x=useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=C;let P=new WebSocket(n);d.current=P,P.onopen=()=>{l(!0),y.current=!1;},P.onmessage=A=>{try{let R=JSON.parse(A.data);if(R.type==="recognition")R.is_final?r(R.text):t?.(R.text);else if(R.type==="error"){let T=R.message||"Voice recognition error";o?.(T),x();}}catch{o?.("Failed to parse voice message");}},P.onerror=()=>{o?.("Voice service connection failed"),g();},P.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let k=new w({sampleRate:16e3});u.current=k;let I=k.createMediaStreamSource(C);h.current=I;let S=k.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=A.inputBuffer.getChannelData(0),T=0;for(let L=0;L<R.length;L+=1)T+=R[L]*R[L];if(Math.sqrt(T/R.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let D=new Int16Array(R.length);for(let L=0;L<R.length;L+=1){let B=Math.max(-1,Math.min(1,R[L]));D[L]=B<0?B*32768:B*32767;}d.current.send(D.buffer);},I.connect(S),S.connect(k.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:x}}var rv=["en","zh","fr","de","ja","ko"],cu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},fl=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,maxWidth:n=540,sx:a})=>{let{t:i}=de(),[s,l]=useState(""),d=useCallback((g=s)=>{let x=g.trim();x&&(l(""),r?.(x));},[r,s]),p=g=>{g.preventDefault(),d();},{isRecording:u,startRecording:f$1,stopRecording:h}=yn({onTextUpdate:l,onComplete:g=>{l(g),d(g);},onError:g=>{console.error("Header voice input error:",g);}}),m=useCallback(async()=>{if(u){h();return}await f$1();},[u,f$1,h]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return f("form",{className:"orb-app-header-search",onSubmit:p,style:{width:"100%",maxWidth:typeof n=="number"?`${n}px`:n,...a},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:i("header.searchAddFeature"),children:f(Mt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>l(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{m();},tooltip:i(u?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:u?"var(--orb-err)":void 0},children:f(Mt,{name:"microphone",size:16})}),f(ne,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:f(Mt,{name:"paperPlane",size:16})})]})]})})},Fi=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:u,user:f$1,onUserRefresh:h,onUserSetting:m,onUserLogout:v,userMenuItems:y,leftSlot:g$1,rightSlot:x})=>{let{t:b,locale:C}=de(),P=br(),w=n||C,k=a||cu[w],I=i||rv,S=P==="dark"?f(Mc,{size:15}):f(Ac,{size:15}),A=b(P==="dark"?"header.theme.dark":"header.theme.light"),R=[...h?[{key:"refresh",label:b("header.menu.refresh"),icon:f(Na,{size:15}),onClick:h}]:[],...m?[{key:"settings",label:b("header.menu.setting"),icon:f(jo,{size:16}),onClick:m}]:[],...v?[{key:"logout",label:b("header.menu.logout"),icon:f(Pc,{size:16}),onClick:v}]:[]],T=y||R,N=I.map(D=>({label:cu[D],onClick:()=>{s?.(D),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:D===w}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[g$1,r===null?null:r||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Mt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(fl,{searchPlaceholder:l,onSearch:p,onSearchAdd:u})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Yt,{triggerLabel:k,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Ln,{size:15}),f("span",{className:"orb-label",children:k})]}),items:N,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":k,children:[f(Ln,{size:15}),f("span",{className:"orb-label",children:k})]}),f(ne,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:A,children:S})]}),f$1&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f$1&&f(Yt,{triggerLabel:f$1.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(E,{variant:"body2",className:"orb-app-header-user-name",children:f$1.name}),f$1.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f$1.subtitle,children:f$1.subtitle})]}),f(Jo,{src:f$1.avatarSrc,alt:f$1.name,size:32,children:f$1.avatarText||f$1.name.slice(0,1).toUpperCase()})]}),items:T.map(D=>({label:D.label,onClick:D.onClick,disabled:D.disabled,icon:D.icon})),align:"end"}),x]})]})};var du=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=ed({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[u,f]=useState(900);useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let h=useMemo(()=>Math.max(280,u-100),[u]);return {navigationIslandProps:p,navigationMaxHeight:h}};var Ar=12,uu=56,mu=234,sv="orbcafe:page-layout-locale",gu=["en","zh","fr","de","ja","ko"],lv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Bi=(t,r)=>`orbcafe:page-layout:${lv(t)}:${r}`,cv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,dv=t=>t==="system"?"dark":t==="dark"?"light":"system",Hi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),pv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,LA=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:u="system",onModeChange:f$1,user:h,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,logo:x,searchPlaceholder:b,searchPlacement:C="hidden",floatingSearchSx:P,onSearch:w,onSearchAdd:k,rightHeaderSlot:I,leftHeaderSlot:S,contentSx:A,navigationVariant:R="classic",navigationMode:T,defaultNavigationMode:N="fixed",onNavigationModeChange:D,showNavigationModeToggle:L=true,enableNavigationPinning:B=true,navigationPinStorageKey:X,pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:G})=>{let z=t?Bi(t,"mode"):"orbcafe:page-layout-mode",O=t?Bi(t,"locale"):sv,Y=t?Bi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[Q,me]=useState(u),[ie,se]=useState("light"),[fe,Ge]=useState(false),[Re,ke]=useState(i),[ze,Pe]=useState(false),[Ce,Ve]=useState(false),[rt,at]=useState(N),[Ye,_]=useState({x:Ar,y:Ar}),[Oe,ve]=useState("left"),[Ee,it]=useState(false),je=useRef(null),ht=useRef(null),xt=p!==void 0,At=p??Q,Et=d!==void 0,te=Et?i:Re,ot=l?.join("|")??"",Fe=T!==void 0,le=T??rt,ge=le==="floating",J=R==="v2"?zs:Xc,Te=C==="header",Ie=At==="system"?fe?ie:"light":At;useEffect(()=>{if(!xt)try{let q=window.localStorage.getItem(z);(q==="light"||q==="dark"||q==="system")&&me(q);}catch{}Ge(true);let Se=window.matchMedia("(prefers-color-scheme: dark)"),V=()=>{se(Se.matches?"dark":"light");};return V(),Se.addEventListener("change",V),()=>Se.removeEventListener("change",V)},[xt,z]),useEffect(()=>{if(!(xt||!fe))try{window.localStorage.setItem(z,At);}catch{}},[fe,xt,At,z]),useEffect(()=>{if(Et){Pe(true);return}try{let Se=window.localStorage.getItem(O),V=l??gu;Se&&gu.includes(Se)&&V.includes(Se)&&ke(Se);}catch{}finally{Pe(true);}},[Et,ot,O]),useEffect(()=>{if(!(Et||!ze))try{window.localStorage.setItem(O,te);}catch{}},[te,Et,ze,O]),useEffect(()=>{if(Fe){Ve(true);return}try{let Se=window.localStorage.getItem(Y);(Se==="fixed"||Se==="floating")&&at(Se);}catch{}finally{Ve(true);}},[Fe]),useEffect(()=>{if(Ce)try{window.localStorage.setItem(Y,le);}catch{}},[le,Ce]),useEffect(()=>{Ie==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Ie]);let Ze=useCallback(Se=>{Fe||at(Se),D?.(Se);},[Fe,D]),ut=useCallback(Se=>{xt||me(Se),f$1?.(Se);},[xt,f$1]),dt=useCallback(Se=>{Et||ke(Se),d?.(Se);},[Et,d]),{navigationIslandProps:Lt,navigationMaxHeight:_t}=du({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:le,enableNavigationPinning:B,navigationPinStorageKey:X??(t?Bi(t,"pinned-navigation-items"):cv(r)),pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:G}),bt=Lt.collapsed,ft=useCallback(Se=>{let V=je.current,q=V?.parentElement;if(!V||!q)return Se;let ee=q.getBoundingClientRect(),De=V.getBoundingClientRect(),he=Ar,Ne=Ar,_e=Math.max(he,ee.width-De.width-Ar),Je=Math.max(Ne,ee.height-De.height-Ar);return {x:Hi(Se.x,he,_e),y:Hi(Se.y,Ne,Je)}},[]),yr=useCallback(Se=>{let V=je.current,q=V?.parentElement;if(!V||!q)return Se;let ee=q.getBoundingClientRect(),De=V.getBoundingClientRect(),he=Ar,Ne=Ar,_e=Math.max(he,ee.width-De.width-Ar),Je=Math.max(Ne,ee.height-De.height-Ar),Ue={x:Hi(Se.x,he,_e),y:Hi(Se.y,Ne,Je)},Dt=[{distance:Math.abs(Ue.x-he),position:{x:he,y:Ue.y}},{distance:Math.abs(Ue.x-_e),position:{x:_e,y:Ue.y}},{distance:Math.abs(Ue.y-Ne),position:{x:Ue.x,y:Ne}},{distance:Math.abs(Ue.y-Je),position:{x:Ue.x,y:Je}}].reduce((St,yt)=>yt.distance<St.distance?yt:St).position;return ve(Dt.x>=(he+_e)/2?"right":"left"),Dt},[]),Pt=useMemo(()=>{if(!ge||Ee)return Ye.x;if(Oe==="right"){let q=je.current?.parentElement?.getBoundingClientRect().width,ee=bt?uu:mu;return q?Math.max(Ar,q-ee-Ar):bt?Ye.x:Ye.x-(mu-uu)}return Ye.x},[Oe,Ye.x,Ee,ge,bt]),Ot=useCallback(Se=>{if(!ge||!bt||pv(Se.target))return;Se.preventDefault(),Se.currentTarget.setPointerCapture(Se.pointerId);let V=ft({x:Pt,y:Ye.y});ve("left"),_(V),ht.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,startX:V.x,startY:V.y,currentX:V.x,currentY:V.y},it(true);},[ft,Pt,Ye.y,ge,bt]),pt=useCallback(Se=>{let V=ht.current;if(!V||V.pointerId!==Se.pointerId)return;let q=ft({x:V.startX+Se.clientX-V.startClientX,y:V.startY+Se.clientY-V.startClientY});V.currentX=q.x,V.currentY=q.y,_(q);},[ft]),Ft=useCallback(Se=>{let V=ht.current;if(!(!V||V.pointerId!==Se.pointerId)){try{Se.currentTarget.releasePointerCapture(Se.pointerId);}catch{}ht.current=null,_(yr({x:V.currentX,y:V.currentY})),it(false);}},[yr]);return useEffect(()=>{if(!ge)return;let Se=()=>{_(ee=>ft(ee));},V=window.requestAnimationFrame(Se),q=window.setTimeout(Se,430);return ()=>{window.cancelAnimationFrame(V),window.clearTimeout(q);}},[ft,ge,bt,_t]),f(Nn,{mode:At,children:f(Ha,{locale:te,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Fi,{appTitle:r,logo:x,mode:At,onToggleMode:()=>ut(dv(At)),locale:te,localeLabel:Et||te===i?s:void 0,localeOptions:l,onLocaleChange:dt,user:h,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,searchPlaceholder:b,showSearch:Te,onSearch:w,onSearchAdd:k,leftSlot:S,rightSlot:I}),C==="floating"&&f("div",{className:"orb-float-search",style:P,children:f(fl,{searchPlaceholder:b,onSearch:w,onSearchAdd:k,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ge&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:bt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(J,{...Lt,maxHeight:_t,colorMode:Ie,displayMode:le,onDisplayModeChange:Ze,showDisplayModeToggle:L&&bt})}),a&&ge&&f("div",{ref:je,onPointerDown:Ot,onPointerMove:pt,onPointerUp:Ft,onPointerCancel:Ft,style:{position:"absolute",top:Ye.y,left:Pt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:bt?Ee?"grabbing":"grab":"default",touchAction:bt?"none":"auto",userSelect:Ee?"none":void 0,transition:Ee?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(J,{...Lt,maxHeight:_t,colorMode:Ie,displayMode:le,onDisplayModeChange:Ze,showDisplayModeToggle:L&&bt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!ge&&bt?4:12,...A},children:n})]})]})})})};var zi="(blank)",fu="Result",hu="Grand Total",bu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},vu=["sum","count","avg","min","max"];var yu=["palette","rows","columns","filters","values"];var Cu=t=>yu.includes(t),xu=t=>t==="rows"||t==="columns"||t==="filters",Vi=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Cu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Cu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},so=t=>t==null||t===""?zi:t instanceof Date?t.toISOString().slice(0,10):String(t),Wo=t=>JSON.stringify(t),Su=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},uv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},Cn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>uv(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},ir=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},lo=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),wu=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return lo(i,s)})},Wi=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),hl=t=>!t?.aggregations||t.aggregations.length===0?vu:t.aggregations,fr=(t,r)=>{let o=hl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},sa=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Pu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(null),p=useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),u=t.length>0&&r.length===t.length,f$1=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):u?a("common.all"):`${r.length}/${t.length}`,h=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return g("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[f(ye,{variant:"outlined",size:"small",onClick:m=>d(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f$1}),f(Yt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(ye,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(u?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(u?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),p.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(m=>{let v=r.includes(m);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>h(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Rt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:m})]},m)})]})})]})};var xn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return f(we,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>f(we,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};var bl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>f(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(xn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Tu=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(bl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};var Sn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=useDroppable({id:l}),{t:u}=de();return g(Ae,{ref:p,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(st,{title:u("pivot.clearArea"),children:f(ne,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(Wd,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),f("div",{sx:{flex:1},children:a})]})};var Iu={xs:1.2,md:1.6},wn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>g(Ae,{sx:u=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${u.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:u=>({px:Iu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${u.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,f(ne,{size:"small","aria-label":o?a:i,onClick:n,sx:u=>({border:`1px solid ${u.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(Ja,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(tn,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:Iu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var $i=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>f(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(xn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&f(ne,{size:"small",onClick:p=>{p.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:f(xo,{size:13})})]})}),la=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:u}=useSortable({id:t}),f$1={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:u?999:"auto"};return f($i,{label:r,caption:o,onRemove:n,trailing:a,isDragging:u,dragRef:i,listeners:l,attributes:s,style:f$1})};var Ui={rows:f(tp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(nn,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(Fd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(on,{size:16,sx:{color:"var(--orb-accent)"}})},Mu=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:u,renderDimensionFilterSelect:f$1,renderAggregationSelect:h,getAggregationLabel:m})=>{let{t:v}=de(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return f(wn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(Sn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:f(xn,{size:18,subtle:true}),children:g(ae,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>f(Tu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ae,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Ui.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:a.map(g=>f(la,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:u(g),trailing:f$1(g),onRemove:()=>p("filters",g)},g))})})}),f(Sn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Ui.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:i.map(g=>f(la,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f$1(g),onRemove:()=>p("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Ui.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:s.map(g=>f(la,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f$1(g),onRemove:()=>p("rows",g)},g))})})}),f(Sn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Ui.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${m(g.aggregation)}(${x})`;return f(la,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:h(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Ru=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Du=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=ar();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),u=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f$1=Math.max(...p,1),h=Math.max(...u,1),m=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let b=o?g.primaryValue:x+1,C=o?g.secondaryValue??0:g.primaryValue,P=d.left+b/f$1*m,w=l-d.bottom-C/h*v;return {...g,x:P,y:w,rawX:b,rawY:C}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[f("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Dr(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Dr(i.palette.text.secondary,.35)}),y.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Dr(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
|
|
13
|
-
`,
|
|
14
|
-
${
|
|
15
|
-
`,
|
|
16
|
-
`,n,": ",(i??a)(b.item.secondaryValue??0)]})},`secondary-${b.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(b=>g("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Dr(C.palette.divider,.7)}`,bgcolor:Dr(C.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(b.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]},b.name))})]})};var Au=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},Eu=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Lu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=so(i[r]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:Cn(s,o.fieldId,o.aggregation),secondaryValue:n?Cn(s,n.fieldId,n.aggregation):void 0}))};var Ou=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:u,onChartPrimaryValueFieldIdChange:f$1,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g$1}=de(),x=useMemo(()=>Au(o,n,r),[n,r,o]),b=useMemo(()=>Eu(a,r,y),[r,y,a]),C=b.find(T=>T.fieldId===s)??b[0],P=b.find(T=>T.fieldId===l&&T.fieldId!==C?.fieldId)??null,w=x.find(T=>T.fieldId===i)??x[0],k=w&&C?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:P?`${C.label} / ${P.label}`:C.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!C?[]:Lu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:P?.item}),[C,t,P,w]),S=T=>C?sa(T,C.item,r):T.toLocaleString(),A=T=>P?sa(T,P.item,r):T.toLocaleString(),R=x.length>1||b.length>1;return g(wn,{title:g$1("pivot.chart.title"),subtitle:k,collapsed:p,onToggleCollapse:v,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(vo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(Vt,{value:w?.fieldId??"",onChange:T=>u(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(Vt,{value:C?.fieldId??"",onChange:T=>f$1(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(Vt,{value:P?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),b.filter(T=>T.fieldId!==C?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(vo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(Vt,{value:d,onChange:T=>m(T.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:w?C?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Du,{data:I,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:A}):f(Nu,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:A}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var Ki=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,p=t.isGrandTotal,u=d&&!l&&!p,f$1=p?800:u?700:d?600:500,h=p?800:u?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:f$1},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&f(ne,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(Hr,{size:12}):f(So,{size:12})}),!d&&!p&&n>0&&f("div",{sx:{width:18}}),t.value]}),r.map(m=>f("td",{align:"right",style:{fontWeight:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:sa(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),l&&t.children.map(m=>f(Ki,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};var Cl=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Xi=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",xl=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",Bu=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},Hu=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,Hu(a.children,r,o+1)),o),wv=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},SL=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:u=false,presets:f$1,defaultPresets:h,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g$1}=de(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),C=useRef(false),P=t??g$1("pivot.title.default"),w=i??g$1("pivot.empty"),k=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),I=useCallback(M=>k[M]??bu[M],[k]),S=useMemo(()=>new Set(o.map(M=>M.id)),[o]),A=useMemo(()=>new Map(o.map(M=>[M.id,M])),[o]),[R,T]=useState(()=>ir(n?.rows,S)),[N,D]=useState(()=>ir(n?.columns,S)),[L,B]=useState(()=>ir(n?.filters,S)),[X,H]=useState(()=>{let M=n?.values??[],$=new Set,U=[];return M.forEach(ce=>{if(!S.has(ce.fieldId)||$.has(ce.fieldId))return;$.add(ce.fieldId),b$1.current+=1;let Be=A.get(ce.fieldId);U.push({tokenId:`v${b$1.current}`,fieldId:ce.fieldId,aggregation:fr(ce.aggregation,Be)});}),U}),[K,W]=useState({}),[G,z]=useState(true),[O,Y]=useState(false),[Q,me]=useState(()=>Cl(ir(n?.rows,S),ir(n?.columns,S),a?.dimensionFieldId)),[ie,se]=useState(()=>{let M=(n?.values??[]).filter(($,U,ce)=>S.has($.fieldId)&&ce.findIndex(Be=>Be.fieldId===$.fieldId)===U).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:fr($.aggregation,A.get($.fieldId))}));return Xi(M,a?.primaryValueFieldId)}),[fe,Ge]=useState(()=>{let M=(n?.values??[]).filter((U,ce,Be)=>S.has(U.fieldId)&&Be.findIndex(nt=>nt.fieldId===U.fieldId)===ce).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:fr(U.aggregation,A.get(U.fieldId))})),$=Xi(M,a?.primaryValueFieldId);return xl(M,$,a?.secondaryValueFieldId)}),[Re,ke]=useState(a?.chartType??"bar-vertical"),[ze,Pe]=useState(l),[Ce,Ve]=useState(d),[rt,at]=useState(()=>h??[]),[Ye,_]=useState(""),[Oe,ve]=useState(false),[Ee,it]=useState(""),[je,ht]=useState(null),[xt,At]=useState(new Set(["__grand_total__"])),[Et,te]=useState(new Set),ot=p?.rowFields??R,Fe=p?.columnFields??N,le=p?.filterFields??L,ge=p?.valueFields??X,J=p?.filterSelections??K,Te=p?.showGrandTotal??G,Ie=p?.isConfiguratorCollapsed??O,Ze=p?.chartDimensionFieldId??Q,ut=p?.chartPrimaryValueFieldId??ie,dt=p?.chartSecondaryValueFieldId??fe,Lt=p?.chartType??Re,_t=p?.isChartCollapsed??ze,bt=p?.isTableCollapsed??Ce,ft=f$1??rt,yr=u||ft.length>0||!!m,Pt=useCallback(M=>{if(p?.setRowFields){p.setRowFields(M);return}T(M);},[p]),Ot=useCallback(M=>{if(p?.setColumnFields){p.setColumnFields(M);return}D(M);},[p]),pt=useCallback(M=>{if(p?.setFilterFields){p.setFilterFields(M);return}B(M);},[p]),Ft=useCallback(M=>{if(p?.setValueFields){p.setValueFields(M);return}H(M);},[p]),Se=useCallback(M=>{if(p?.setFilterSelections){p.setFilterSelections(M);return}W(M);},[p]),V=useCallback(M=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(M);return}z(M);},[p]),q=useCallback(M=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(M);return}Y(M);},[p]),ee=useCallback(M=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(M);return}me(M);},[p]),De=useCallback(M=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(M);return}se(M);},[p]),he=useCallback(M=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(M);return}Ge(M);},[p]),Ne=useCallback(M=>{if(p?.setChartType){p.setChartType(M);return}ke(M);},[p]),_e=useCallback(M=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(M);return}Pe(M);},[p]),Je=useCallback(M=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(M);return}Ve(M);},[p]),Ue=useCallback(M=>{let $=typeof M=="function"?M(ft):M;f$1||at($),m?.($);},[m,ft,f$1]),vt=useMemo(()=>new Set([...ot,...Fe,...le]),[ot,Fe,le]),Dt=useMemo(()=>o.filter(M=>!vt.has(M.id)),[o,vt]),St=useMemo(()=>{let M=[...ot,...Fe,...le],$=new Set,U=[];return M.forEach(ce=>{$.has(ce)||($.add(ce),U.push(ce));}),U},[Fe,le,ot]);useEffect(()=>{Pt(M=>{let $=M.filter(U=>S.has(U));return lo(M,$)?M:$}),Ot(M=>{let $=M.filter(U=>S.has(U));return lo(M,$)?M:$}),pt(M=>{let $=M.filter(U=>S.has(U));return lo(M,$)?M:$}),Ft(M=>{let $=M.filter(U=>S.has(U.fieldId)).map(U=>({...U,aggregation:fr(U.aggregation,A.get(U.fieldId))}));return Wi(M,$)?M:$});},[A,S]);let yt=useMemo(()=>{let M={};return St.forEach($=>{let U=new Set;r.forEach(ce=>{U.add(so(ce[$]));}),M[$]=Array.from(U).sort((ce,Be)=>ce.localeCompare(Be));}),M},[St,r]);useEffect(()=>{Se(M=>{let $={};return St.forEach(U=>{let ce=yt[U]??[],nt=(M[U]??[]).filter(re=>ce.includes(re)),We=Object.prototype.hasOwnProperty.call(M,U);$[U]=We?nt:ce;}),wu(M,$)?M:$});},[St,yt]),useEffect(()=>{ee(M=>Cl(ot,Fe,M));},[Fe,ot,ee]),useEffect(()=>{De(M=>Xi(ge,M));},[De,ge]),useEffect(()=>{he(M=>xl(ge,ut,M));},[ut,he,ge]);let F=useMemo(()=>r.filter(M=>St.every($=>{let U=J[$]??[],ce=yt[$]??[];if(U.length===ce.length)return true;if(U.length===0)return false;let Be=so(M[$]);return U.includes(Be)})),[St,yt,J,r]),Z=useMemo(()=>{if(ge.length===0)return null;let M=new Map;if(F.forEach(We=>{let re=Fe.length>0?Fe.map(j=>so(We[j])):[g$1("pivot.valueLabel")],pe=Wo(re);M.set(pe,re);}),M.size===0){let We=Fe.length>0?Fe.map(()=>zi):[g$1("pivot.valueLabel")];M.set(Wo(We),We);}let $=Array.from(M.entries()).sort((We,re)=>Su(We[1],re[1])),U=$.flatMap(([We,re])=>ge.map(pe=>{let j=A.get(pe.fieldId),Le=`${I(pe.aggregation)} ${j?.label??pe.fieldId}`,Qe=Fe.length===0||ge.length>1?`${re.join(" / ")} \u2022 ${Le}`:re.join(" / ");return {id:`${We}::${pe.tokenId}`,colKey:We,valueItem:pe,label:Qe}})),ce=[];Fe.length>0&&$.forEach(([We,re])=>{let pe=U.filter(Qe=>Qe.colKey===We),j=ce,Le=[];re.forEach((Qe,Me)=>{Le.push(`d${Me}:${Qe}`);let Xe=`col::${Wo(Le)}`,It=j.find(Zo=>Zo.key===Xe);It||(It={key:Xe,label:Qe,children:[],leafColumnIds:[],path:re.slice(0,Me+1),depth:Me},j.push(It)),pe.forEach(Zo=>{It.leafColumnIds.includes(Zo.id)||It.leafColumnIds.push(Zo.id);}),j=It.children;});});let Be=We=>{let re={};return U.forEach(pe=>{let j=We.filter(Le=>{let Qe=Fe.length>0?Fe.map(Me=>so(Le[Me])):[g$1("pivot.valueLabel")];return Wo(Qe)===pe.colKey});re[pe.id]=Cn(j,pe.valueItem.fieldId,pe.valueItem.aggregation);}),re},nt=[];if(ot.length===0)nt.push({key:"root",value:g$1("pivot.resultLabel")||fu,children:[],isLeaf:true,aggregatedValues:Be(F),path:[],depth:0});else {let We=(re,pe,j)=>{if(pe>=ot.length)return [];let Le=ot[pe],Qe=new Map;return re.forEach(Me=>{let Xe=so(Me[Le]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),It=[...j,Me];return {key:Wo(It),value:Me,fieldId:Le,aggregatedValues:Be(Xe),children:We(Xe,pe+1,It),isLeaf:pe===ot.length-1,path:It,depth:pe}})};nt.push(...We(F,0,[]));}return {dataColumns:U,columnTree:ce,rowTree:nt}},[Fe,A,F,I,ot,g$1,ge]),ue=useCallback((M,$)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:M,aggregation:fr($,A.get(M))}),[A]),xe=useCallback(M=>{if(M==="rows")return Pt([]);if(M==="columns")return Ot([]);if(M==="filters")return pt([]);Ft([]);},[]),et=useCallback((M,$)=>{if(M==="rows")return Pt(U=>U.filter(ce=>ce!==$));if(M==="columns")return Ot(U=>U.filter(ce=>ce!==$));if(M==="filters")return pt(U=>U.filter(ce=>ce!==$));Ft(U=>U.filter(ce=>ce.tokenId!==$));},[]),qe=useCallback((M,$)=>{Ft(U=>U.map(ce=>ce.tokenId===M?{...ce,aggregation:fr($,A.get(ce.fieldId))}:ce));},[A]),Tt=useCallback(M=>{ht(String(M.active.id));},[]),gt=useCallback(M=>{if(ht(null),!M.over)return;let $=Vi(String(M.active.id)),U=Vi(String(M.over.id));if(!$||!U||$.kind!=="item"||!$.key)return;if($.zone===U.zone&&U.kind==="item"){if($.zone==="rows"){let Me=ot.indexOf($.key),Xe=ot.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Pt(It=>arrayMove(It,Me,Xe));return}if($.zone==="columns"){let Me=Fe.indexOf($.key),Xe=Fe.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Ot(It=>arrayMove(It,Me,Xe));return}if($.zone==="filters"){let Me=le.indexOf($.key),Xe=le.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&pt(It=>arrayMove(It,Me,Xe));return}if($.zone==="values"){let Me=ge.findIndex(It=>It.tokenId===$.key),Xe=ge.findIndex(It=>It.tokenId===(U.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ft(It=>arrayMove(It,Me,Xe));}return}let ce=U.zone,Be=[...ot],nt=[...Fe],We=[...le],re=[...ge],pe="",j=null;if($.zone==="palette")pe=$.key;else if($.zone==="values"){let Me=re.find(Xe=>Xe.tokenId===$.key);if(!Me)return;pe=Me.fieldId,j=Me,re=re.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(pe=$.key,Be=Be.filter(Me=>Me!==pe)):$.zone==="columns"?(pe=$.key,nt=nt.filter(Me=>Me!==pe)):$.zone==="filters"&&(pe=$.key,We=We.filter(Me=>Me!==pe));if(!pe)return;let Le=()=>{Be=Be.filter(Me=>Me!==pe),nt=nt.filter(Me=>Me!==pe),We=We.filter(Me=>Me!==pe);},Qe=Me=>{if(U.kind!=="item"||!U.key)return Me==="rows"?Be.length:Me==="columns"?nt.length:Me==="filters"?We.length:Me==="values"?re.length:0;if(Me==="rows"){let Xe=Be.indexOf(U.key);return Xe>=0?Xe:Be.length}if(Me==="columns"){let Xe=nt.indexOf(U.key);return Xe>=0?Xe:nt.length}if(Me==="filters"){let Xe=We.indexOf(U.key);return Xe>=0?Xe:We.length}if(Me==="values"){let Xe=re.findIndex(It=>It.tokenId===U.key);return Xe>=0?Xe:re.length}return 0};if(ce==="palette"){Pt(Be),Ot(nt),pt(We),Ft(re);return}if(ce==="values"){let Me=Qe("values"),Xe=j??ue(pe);re.splice(Me,0,Xe),Pt(Be),Ot(nt),pt(We),Ft(re);return}if(xu(ce)){Le();let Me=Qe(ce);ce==="rows"?Be.splice(Me,0,pe):ce==="columns"?nt.splice(Me,0,pe):We.splice(Me,0,pe),Pt(Be),Ot(nt),pt(We),Ft(re);}},[Fe,ue,le,ot,ge]),mt=useCallback((M,$)=>{Se(U=>({...U,[M]:$}));},[]),wt=useCallback(M=>{At($=>{let U=new Set($);return U.has(M)?U.delete(M):U.add(M),U});},[]),rr=useCallback(M=>{te($=>{let U=new Set($);return U.has(M)?U.delete(M):U.add(M),U});},[]),Bt=useCallback(M=>{let $=A.get(M.fieldId),U=hl($);return f(vo,{size:"small",sx:{minWidth:98},children:f(Vt,{value:M.aggregation,onChange:ce=>qe(M.tokenId,ce.target.value),onClick:ce=>ce.stopPropagation(),onMouseDown:ce=>ce.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(ce=>f("option",{value:ce,sx:{fontSize:"0.75rem"},children:I(ce)},ce))})})},[A,I,qe]),qt=useCallback(M=>{let $=yt[M]??[],U=J[M]??$;return $.length===0?g$1("pivot.filter.noValues"):U.length===0?g$1("pivot.filter.noneSelected"):U.length===$.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:U.length,total:$.length})},[yt,J,g$1]),zt=useCallback(M=>{let $=yt[M]??[],U=J[M]??$;return f(Pu,{options:$,selectedValues:U,onChange:ce=>mt(M,ce)})},[yt,J,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=useCallback(()=>{let M={};return new Set([...St,...Object.keys(J)]).forEach(U=>{if(!S.has(U))return;let ce=J[U]??[];M[U]=[...ce];}),{layout:{rows:[...ot],columns:[...Fe],filters:[...le],values:ge.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:M,showGrandTotal:Te,chart:{dimensionFieldId:Ze,primaryValueFieldId:ut,secondaryValueFieldId:dt,chartType:Lt}}},[St,Ze,ut,dt,Lt,Fe,le,J,ot,Te,S,ge]),er=useCallback(M=>{let $=ir(M.layout.rows,S),U=ir(M.layout.columns,S),ce=ir(M.layout.filters,S),Be=new Set,nt=(M.layout.values??[]).filter(pe=>!S.has(pe.fieldId)||Be.has(pe.fieldId)?false:(Be.add(pe.fieldId),true)).map(pe=>ue(pe.fieldId,pe.aggregation)),We={};Object.entries(M.filterSelections??{}).forEach(([pe,j])=>{!S.has(pe)||!Array.isArray(j)||(We[pe]=Array.from(new Set(j.map(Le=>String(Le)))));}),Pt($),Ot(U),pt(ce),Ft(nt),Se(We),typeof M.showGrandTotal=="boolean"&&V(M.showGrandTotal),ee(Cl($,U,M.chart?.dimensionFieldId));let re=Xi(nt,M.chart?.primaryValueFieldId);De(re),he(xl(nt,re,M.chart?.secondaryValueFieldId)),Ne(M.chart?.chartType??"bar-vertical"),_(M.id),y?.(M);},[ue,y,ee,De,he,Ne,Ot,pt,Se,Pt,V,Ft,S]),or=useCallback(M=>{if(!M){_("");return}let $=ft.find(U=>U.id===M);if(!$){_("");return}er($);},[er,ft]),ur=useCallback(()=>{let M=g$1("pivot.preset.defaultName",{index:ft.length+1});it(M),ve(true);},[ft.length,g$1]),Pr=useCallback(()=>{let M=Ee.trim();if(!M)return;let $={id:Ut(),name:M,...Wt()};Ue(U=>[...U,$]),_($.id),ve(false);},[Wt,Ut,Ee,Ue]),Tr=useCallback(()=>{Ye&&(Ue(M=>M.filter($=>$.id!==Ye)),_(""));},[Ye,Ue]);useEffect(()=>{if(!v||C.current)return;let M=ft.find($=>$.id===v);M&&(C.current=true,er(M));},[er,v,ft]),useEffect(()=>{Ye&&(ft.some(M=>M.id===Ye)||_(""));},[Ye,ft]);let to=useMemo(()=>{if(!Te||!Z||!ot.length)return null;let M={};return Z.dataColumns.forEach($=>{let U=F.filter(ce=>{let Be=Fe.length>0?Fe.map(nt=>so(ce[nt])):[g$1("pivot.valueLabel")];return Wo(Be)===$.colKey});M[$.id]=Cn(U,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||hu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:M,path:[],depth:-1}},[Te,Z,F,Fe,ot.length,g$1]),hr=useMemo(()=>Bu(Z?.rowTree??[]),[Z]),Er=useMemo(()=>Bu(Z?.columnTree??[]),[Z]);useEffect(()=>{At(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),hr.forEach(U=>{M.has(U)&&$.add(U);}),$});},[hr]),useEffect(()=>{te(M=>{let $=new Set;return Er.forEach(U=>{M.has(U)&&$.add(U);}),$});},[Er]);let Uo=useCallback(()=>{At(M=>{let $=new Set(M);return hr.forEach(U=>$.add(U)),$});},[hr]),Ko=useCallback(()=>{At(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Ao=useCallback(()=>{te(new Set(Er));},[Er]),qo=useCallback(()=>{te(new Set);},[]),Xo=useMemo(()=>!Z||Fe.length===0?[]:wv(Z.columnTree,Et),[Fe.length,Et,Z]),Ir=useMemo(()=>{if(!Z)return [];if(Fe.length===0)return Z.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let M=new Map(Z.dataColumns.map($=>[$.id,$]));return Xo.flatMap($=>{let U=new Map;return $.leafColumnIds.forEach(ce=>{let Be=M.get(ce);if(!Be)return;let nt=Be.valueItem.tokenId,We=`${I(Be.valueItem.aggregation)} ${A.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,re=U.get(nt);if(re){re.leafColumnIds.push(ce);return}U.set(nt,{id:`${$.key}::${nt}`,label:ge.length>1?We:$.label,leafColumnIds:[ce],valueItem:Be.valueItem});}),Array.from(U.values())})},[Fe.length,A,I,Z,ge.length,Xo]),Eo=useMemo(()=>new Map(Ir.map(M=>[M.id,M])),[Ir]),Yo=useMemo(()=>Ir.map(M=>({id:M.id,colKey:M.id,valueItem:M.valueItem,label:M.label})),[Ir]),_r=useMemo(()=>{if(!Z||Fe.length===0)return [];let M=[],$=Hu(Z.columnTree,Et),U=$+(ge.length>1?1:0),ce=(Be,nt)=>{M[nt]??(M[nt]=[]),Be.forEach(We=>{let re=We.children.length>0&&Et.has(We.key),pe=Ir.filter(Le=>We.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,j=re||ge.length>1?1:U-nt;M[nt].push({key:We.key,label:We.label,colSpan:pe,rowSpan:j,expandable:We.children.length>0,expanded:re}),re&&ce(We.children,nt+1);});};return ce(Z.columnTree,0),ge.length>1&&(M[$]=Ir.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),M},[Fe.length,Et,Z,ge.length,Ir]),ro=useCallback((M,$)=>$.leafColumnIds.reduce((U,ce)=>U+(M.aggregatedValues[ce]??0),0),[]),Dn=useMemo(()=>g(e,{children:[f(ye,{size:"small",variant:"text",onClick:Uo,disabled:hr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(ye,{size:"small",variant:"text",onClick:Ko,disabled:hr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Nt,{orientation:"vertical",flexItem:true}),f(ye,{size:"small",variant:"text",onClick:Ao,disabled:Er.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(ye,{size:"small",variant:"text",onClick:qo,disabled:Fe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Fe.length,Er.size,hr.size,qo,Ko,Ao,Uo,g$1]),Lo=()=>{if(!je)return null;let M=Vi(je);if(!M||M.kind!=="item"||!M.key)return null;if(M.zone==="palette"){let Be=A.get(M.key);return Be?f(bl,{label:Be.label,subtitle:Be.type}):null}if(M.zone==="values"){let Be=ge.find(pe=>pe.tokenId===M.key);if(!Be)return null;let We=A.get(Be.fieldId)?.label??Be.fieldId,re=`${I(Be.aggregation)}(${We})`;return f($i,{label:We,caption:re})}let U=A.get(M.key)?.label??M.key,ce=qt(M.key);return f($i,{label:U,caption:ce})};return g(Ae,{sx:M=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${M.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:P}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[yr&&g(e,{children:[f(vo,{size:"small",sx:{minWidth:200},children:g(Vt,{value:Ye,displayEmpty:true,onChange:M=>or(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),ft.map(M=>f("option",{value:M.id,sx:{fontSize:"0.75rem"},children:M.name},M.id))]})}),f(st,{title:g$1("pivot.preset.save"),children:f(ne,{size:"small",onClick:ur,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(wo,{size:15})})}),f(st,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ne,{size:"small",onClick:Tr,disabled:!Ye,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ja,{size:15})})})}),f(Nt,{flexItem:true,orientation:"vertical"})]}),g(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:r.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Nt,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(Xa,{size:"small",checked:Te,onChange:M=>V(M.target.checked)})]})]})]}),f(Nt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:Tt,onDragEnd:gt,children:[f(Mu,{isConfiguratorCollapsed:Ie,onToggleCollapse:()=>q(M=>!M),availableFields:Dt,fieldMap:A,filterFields:le,columnFields:Fe,rowFields:ot,valueFields:ge,clearZone:xe,removeFieldFromZone:et,getFilterSelectionSummary:qt,renderDimensionFilterSelect:zt,renderAggregationSelect:Bt,getAggregationLabel:I}),f(md,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lo()})})]}),f(Ou,{rows:F,fieldMap:A,rowFields:ot,columnFields:Fe,valueFields:ge,chartDimensionFieldId:Ze,chartPrimaryValueFieldId:ut,chartSecondaryValueFieldId:dt,chartType:Lt,isCollapsed:_t,onChartDimensionFieldIdChange:M=>ee(M),onChartPrimaryValueFieldIdChange:M=>De(M),onChartSecondaryValueFieldIdChange:M=>he(M),onChartTypeChange:M=>Ne(M),onToggleCollapse:()=>_e(M=>!M),getAggregationLabel:I}),f(wn,{title:g$1("pivot.table.sectionTitle"),subtitle:ot.length>0?ot.map(M=>A.get(M)?.label??M).join(" > "):g$1("pivot.table.dimensions"),collapsed:bt,onToggleCollapse:()=>Je(M=>!M),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Dn,children:Z===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(_r.length>0?_r:[[]]).map((M,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(_r.length,1),sx:U=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${U.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ot.length>0?ot.map(U=>A.get(U)?.label).join(" > "):g$1("pivot.table.dimensions")}),(M.length>0?M:Ir.map(U=>({key:U.id,label:U.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(U=>f("td",{align:"center",colSpan:U.colSpan,rowSpan:U.rowSpan,sx:ce=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ce.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&f(ne,{size:"small",onClick:()=>rr(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?f(Hr,{size:12}):f(So,{size:12})}),f("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[Z.rowTree.map(M=>f(Ki,{node:M,dataColumns:Yo,fieldMap:A,level:0,expandedKeys:xt,onToggle:wt,getValue:($,U)=>{let ce=Eo.get(U);return ce?ro($,ce):0}},M.key)),to&&f(Ki,{node:to,dataColumns:Yo,fieldMap:A,level:0,expandedKeys:xt,onToggle:wt,getValue:(M,$)=>{let U=Eo.get($);return U?ro(M,U):0}})]})]})})}),g(Ht,{open:Oe,onClose:()=>ve(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(He,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Ee,onChange:M=>it(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),Pr());}})}),g("div",{className:"orb-dialog-actions",children:[f(ye,{onClick:()=>ve(false),children:g$1("common.cancel")}),f(ye,{variant:"contained",onClick:Pr,disabled:!Ee.trim(),children:g$1("common.save")})]})]})]})};var zu=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},wl=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Vu=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",IL=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),p=useMemo(()=>new Set(t.map(_=>_.id)),[t]),u=useMemo(()=>new Map(t.map(_=>[_.id,_])),[t]),[f,h]=useState(()=>ir(r?.rows,p)),[m,v]=useState(()=>ir(r?.columns,p)),[y,g]=useState(()=>ir(r?.filters,p)),[x,b]=useState(()=>{let _=r?.values??[],Oe=new Set,ve=[];return _.forEach(Ee=>{!p.has(Ee.fieldId)||Oe.has(Ee.fieldId)||(Oe.add(Ee.fieldId),d.current+=1,ve.push({tokenId:`v${d.current}`,fieldId:Ee.fieldId,aggregation:fr(Ee.aggregation,u.get(Ee.fieldId))}));}),ve}),[C,P]=useState(o),[w,k]=useState(n),[I,S]=useState(a),[A,R]=useState(()=>zu(ir(r?.rows,p),ir(r?.columns,p),i?.dimensionFieldId)),[T,N]=useState(()=>{let _=(()=>{let Oe=r?.values??[],ve=new Set,Ee=[];return Oe.forEach(it=>{!p.has(it.fieldId)||ve.has(it.fieldId)||(ve.add(it.fieldId),Ee.push({tokenId:it.fieldId,fieldId:it.fieldId,aggregation:fr(it.aggregation,u.get(it.fieldId))}));}),Ee})();return wl(_,i?.primaryValueFieldId)}),[D,L]=useState(()=>{let _=(()=>{let ve=r?.values??[],Ee=new Set,it=[];return ve.forEach(je=>{!p.has(je.fieldId)||Ee.has(je.fieldId)||(Ee.add(je.fieldId),it.push({tokenId:je.fieldId,fieldId:je.fieldId,aggregation:fr(je.aggregation,u.get(je.fieldId))}));}),it})(),Oe=wl(_,i?.primaryValueFieldId);return Vu(_,Oe,i?.secondaryValueFieldId)}),[B,X]=useState(i?.chartType??"bar-vertical"),[H,K]=useState(s),[W,G]=useState(l);useEffect(()=>{h(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),v(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),g(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),b(_=>{let Oe=_.filter(ve=>p.has(ve.fieldId)).map(ve=>({...ve,aggregation:fr(ve.aggregation,u.get(ve.fieldId))}));return Wi(_,Oe)?_:Oe});},[u,p]),useEffect(()=>{R(_=>zu(f,m,_));},[m,f]),useEffect(()=>{N(_=>wl(x,_));},[x]),useEffect(()=>{L(_=>Vu(x,T,_));},[T,x]);let z=useCallback(_=>{h(ir(_,p));},[p]),O=useCallback(_=>{v(ir(_,p));},[p]),Y=useCallback(_=>{g(ir(_,p));},[p]),Q=useCallback(_=>{b(Oe=>{let ve=_??[],Ee=new Set,it=[];return ve.forEach(je=>{if(!p.has(je.fieldId)||Ee.has(je.fieldId))return;Ee.add(je.fieldId);let ht=Oe.find(xt=>xt.fieldId===je.fieldId);if(ht){it.push({...ht,aggregation:fr(je.aggregation??ht.aggregation,u.get(je.fieldId))});return}d.current+=1,it.push({tokenId:`v${d.current}`,fieldId:je.fieldId,aggregation:fr(je.aggregation,u.get(je.fieldId))});}),it});},[u,p]),me=useCallback(_=>{z(_.rows??[]),O(_.columns??[]),Y(_.filters??[]),Q(_.values??[]);},[O,Y,z,Q]),ie=useCallback(_=>{if(_==="rows")return h([]);if(_==="columns")return v([]);if(_==="filters")return g([]);b([]);},[]),se=useCallback((_,Oe)=>{if(_==="rows")return h(ve=>ve.filter(Ee=>Ee!==Oe));if(_==="columns")return v(ve=>ve.filter(Ee=>Ee!==Oe));if(_==="filters")return g(ve=>ve.filter(Ee=>Ee!==Oe));b(ve=>ve.filter(Ee=>Ee.tokenId!==Oe));},[]),fe=useCallback((_,Oe)=>{b(ve=>ve.map(Ee=>Ee.tokenId===_?{...Ee,aggregation:fr(Oe,u.get(Ee.fieldId))}:Ee));},[u]),Ge=useCallback((_,Oe)=>{P(ve=>({...ve,[_]:Oe}));},[]),Re=useCallback(()=>{P({});},[]),ke=useCallback(()=>{k(_=>!_);},[]),ze=useCallback(()=>{S(_=>!_);},[]),Pe=useCallback(_=>{R(_);},[]),Ce=useCallback(_=>{N(_);},[]),Ve=useCallback(_=>{L(_);},[]),rt=useCallback(()=>{K(_=>!_);},[]),at=useCallback(()=>{G(_=>!_);},[]);return {model:useMemo(()=>({rowFields:f,setRowFields:h,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:C,setFilterSelections:P,showGrandTotal:w,setShowGrandTotal:k,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:A,setChartDimensionFieldId:R,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:N,chartSecondaryValueFieldId:D,setChartSecondaryValueFieldId:L,chartType:B,setChartType:X,isChartCollapsed:H,setIsChartCollapsed:K,isTableCollapsed:W,setIsTableCollapsed:G}),[A,T,D,B,m,y,C,H,I,W,f,w,x]),actions:{setRows:z,setColumns:O,setFilters:Y,setValues:Q,setLayout:me,clearZone:ie,removeFieldFromZone:se,setAggregationForValue:fe,setFilterSelection:Ge,resetFilterSelections:Re,toggleGrandTotal:ke,toggleConfigurator:ze,setChartDimension:Pe,setChartPrimaryValue:Ce,setChartSecondaryValue:Ve,setChartType:X,toggleChart:rt,toggleTable:at}}};var NL=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=ar(),a=yo("(orientation: portrait)"),i=yo(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=useState(r??s==="landscape");useEffect(()=>{d(r??s==="landscape");},[r,s]);let p=f=>{d(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var Rv=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},LL=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=useState(n??i),d=useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[p,u]=useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:u,selectRecord:m=>{let v=m[r];l(v);let y=m[o];u(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=Rv(p),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};var Dv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],$u=(t,r,o,n)=>{r?.(t),n&&o?.();},VL=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Dv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:u="Close",manualPlaceholder:f$1="Enter barcode manually",onDetected:h,onError:m,sx:v})=>{let y=Qt__default.useRef(null),g$1=Qt__default.useRef(null),x=Qt__default.useRef(null),b$1=Qt__default.useRef(null),[C,P]=Qt__default.useState("idle"),[w,k]=Qt__default.useState(""),[I,S]=Qt__default.useState(null),[A,R]=Qt__default.useState(null),T=Qt__default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),y.current&&(y.current.srcObject=null);},[]),N=Qt__default.useCallback(L=>{R(L),P("error"),m?.(L);},[m]);Qt__default.useEffect(()=>{if(!t){T(),P("idle"),R(null),k("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){P("unsupported"),R("Camera access is not supported in this browser.");return}P("starting"),R(null);try{let X=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){X.getTracks().forEach(H=>H.stop());return}if(g$1.current=X,y.current&&(y.current.srcObject=X,await y.current.play()),!window.BarcodeDetector){P("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b$1.current=new window.BarcodeDetector({formats:a}),P("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!b$1.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await b$1.current.detect(y.current)).find(G=>G.rawValue);if(!K?.rawValue)return;let W={rawValue:K.rawValue,format:K.format};S(W),T(),$u(W,h,r,l);}catch(H){N(H instanceof Error?H.message:"Failed to detect barcode.");}},d);}catch(X){N(X instanceof Error?X.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,r,h,t,N,d,T]);let D=()=>{let L=w.trim();if(!L)return;let B={rawValue:L,format:"manual"};S(B),$u(B,h,r,l);};return g(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(ae,{spacing:2,sx:v,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(kt,{icon:f(Td,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),I?f(kt,{icon:f(Kd,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?f(Yr,{severity:C==="unsupported"?"info":"warning",children:A}):null,s?g(ae,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:f$1,value:w,onChange:L=>k(L.target.value)}),f(ye,{variant:"contained",onClick:D,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(ye,{onClick:r,children:u})})]})};var Nv={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},qL=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:u=false,swipeThreshold:f$1=88,startAction:h,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g$1,sx:x})=>{let[b$1,C]=useState(0),[P,w]=useState(false),k=useRef(null),I=useRef(0),S=useRef(0),A=!!(h||m),R=132,T=()=>{C(0),w(false),k.current=null,I.current=0,S.current=0;},N=H=>{(H==="start"?h:m)?.onTrigger?.(),g$1?.(H),T();},D=H=>{!A||H.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(k.current=H.pointerId,I.current=H.clientX,S.current=H.clientX,w(true),H.currentTarget.setPointerCapture(H.pointerId));},L=H=>{if(!P||k.current!==H.pointerId)return;S.current=H.clientX;let K=S.current-I.current,W=Math.max(-R,Math.min(R,K));C(W);},B=H=>{if(!P||k.current!==H.pointerId)return;let K=S.current-I.current;if(K>=f$1&&h){N("start");return}if(K<=-f$1&&m){N("end");return}Math.abs(K)<12&&y?.(),T();},X=(H,K)=>{if(!H)return null;let W=H.backgroundColor||Nv[H.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:g(ae,{direction:"row",spacing:1,alignItems:"center",children:[H.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:H.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[X(h,"left"),X(m,"right"),f(Ae,{elevation:0,onPointerDown:D,onPointerMove:L,onPointerUp:B,onPointerCancel:T,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${b$1}px, 0, 0) scale(${u?.985:1})`,transition:P?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:u?.9:1},children:g(ae,{spacing:1.5,children:[g(ae,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[o?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),p?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ne,{size:"small",children:f(Ld,{})})}):null]}),a.length>0?f(ae,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((H,K)=>f(kt,{label:H,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(H=>g(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:H.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:H.value})]},H.id))}):null,l,s]})})]})};var ca=({label:t,onPress:r,emphasis:o="default"})=>f("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),tO=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:u,onChange:f$1,onSubmit:h,onClose:m,sx:v})=>{let{t:y}=de(),[g$1,x]=useState(r),b=t??g$1,C=T=>{t===void 0&&x(T),f$1?.(T);},P=T=>{l&&b.length>=l||C(`${b}${T}`);},w=T=>{if(T==="00"){if(!b){C("0");return}P("00");return}P(T);},k=()=>{!i||b.includes(".")||C(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){C(b.slice(1));return}C(b?`-${b}`:"-");}},S=()=>{C(b.slice(0,-1));},A=()=>{C("");},R=()=>{h?.(b);};return f(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ae,{spacing:2,children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[o?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?f(ne,{onClick:m,size:"small",children:f(Ad,{})}):null]}),f(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:b?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:b?"text.primary":"text.disabled"},children:b||a})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(T=>f(ca,{label:T,onPress:()=>w(T)},T)),f(ca,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(ca,{label:"0",onPress:()=>w("0")}),f(ca,{label:i?".":u?String(u):"DEL",onPress:i?k:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Pd,{}),f(E,{sx:{fontWeight:700},children:u||"DEL"})]})}),f(ca,{label:String(p||"CLR"),onPress:A,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:R,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Md,{}),f(E,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var _u=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...r},children:f(zr,{...o})})};var Fv=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},Uu=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=ar(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=yo("(orientation: portrait)"),p=yo(i.breakpoints.down("md")),u=o==="auto"?d||p?"portrait":"landscape":o,f$1=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||u==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(h=>{let m=h.id===r,v=h.color||(m?i.palette.primary.main:i.palette.divider);return f(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:h.disabled,onClick:()=>Fv(f$1,h,n),sx:{width:"100%",p:2,minHeight:u==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:h.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ae,{spacing:1.5,sx:{height:"100%"},children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:h.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var Xu=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?Xu(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,Vv=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},Yu=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:u})=>{let{t:f$1}=de(),h=ar(),m=Mr("(orientation: portrait)"),v=Mr(h.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),b=usePathname(),[C,P]=useState(""),[w,k]=useState(new Set),I=useMemo(()=>Xu(a,C),[a,C]),S=useMemo(()=>C.trim()?Vv(I):w,[w,I,C]);useEffect(()=>{t&&k(new Set);},[t]);let A=L=>L.appurl||L.href||"",R=L=>{u?.(L);let B=A(L);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}x.push(B);}},T=L=>{let B=!!L.children?.length;if(t&&B){r?.();return}if(B){k(X=>{let H=new Set(X);return H.has(L.id)?H.delete(L.id):H.add(L.id),H});return}R(L);},N=L=>{let B=p||b,X=A(L);return !!(X&&B===X)},D=(L,B=0)=>{let X=!!L.children?.length,H=S.has(L.id),K=N(L);return f("div",{sx:{pl:B===0?0:1.5},children:g(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>T(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(Ka,{variant:"rounded",sx:{width:40,height:40,bgcolor:K?"primary.main":"action.hover",color:K?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),X?f(rn,{sx:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(Za,{color:"action"})]}),X?f(tn,{in:H,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(W=>D(W,B+1))})}):null]})},L.id)};return t?f(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(ae,{spacing:1,children:[f(ne,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f$1("navigation.expand"),children:f(ri,{})}),a.map(L=>f(ne,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:N(L)?"primary.main":"action.hover",color:N(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ae,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:C,onChange:L=>P(L.target.value),placeholder:f$1("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(qd,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?f(ne,{onClick:r,sx:{bgcolor:"action.hover"},children:f($d,{})}):null]}),l,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>D(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f$1("navigation.noMatch")})}),d]})})};var Zu=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Wv=t=>Qt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),$v=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Gv=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ae,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),f(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},_v=t=>{let{t:r}=de(),o=ar(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f$1=false,maxHeight:h,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b$1="default",graphReport:C,quickCreate:P,quickEdit:w,quickDelete:k,serviceUrl:I,orientation:S="auto",cardTitleField:A,cardSubtitleFields:R,toolbarSlot:T,emptyState:N,rowHeight:D="comfortable",cardActionSlot:L,renderCardFooter:B,onRowClick:X}=t,H=n||r("table.title.default"),K=Mr("(orientation: portrait)"),W=Mr(o.breakpoints.down("md")),G=S==="auto"?K||W?"portrait":"landscape":S,{columns:z,filterText:O,setFilterText:Y,visibleColumns:Q,showSummary:me,setShowSummary:ie,summaryColumns:se,grouping:fe,setGrouping:Ge,expandedGroups:Re,groupAnchorEl:ke,setGroupAnchorEl:ze,summaryAnchorEl:Pe,setSummaryAnchorEl:Ce,anchorEl:Ve,setAnchorEl:rt,contextMenu:at,sortedAndFilteredRows:Ye,summaryRow:_,visibleRows:Oe,page:ve,setPage:Ee,rowsPerPage:it,setRowsPerPage:je,totalDisplayCount:ht,setSelected:xt,handleClick:At,toggleSummaryColumn:Et,handleExport:te,handleCloseContextMenu:ot,toggleColumnVisibility:Fe,toggleGroupExpand:le,handleExpandGroupRecursively:ge,handleCollapseGroupRecursively:J,handleLayoutLoad:Te,handleVariantLoad:Ie,handleLayoutSave:Ze,effectiveAppId:ut,currentLayoutData:dt,currentLayoutId:Lt,layoutIdToLoad:_t,graphReportOpen:bt,handleOpenGraphReport:ft,handleCloseGraphReport:yr}=gn(t),Pt=C?.enabled??false,Ot=Pt&&(C?.interaction?.enabled??true),pt=xi(),Ft=x||"id",Se=Qt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(o.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(o.palette.common.white,.06):tt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),V=Qt__default.useMemo(()=>({...Se,borderColor:tt(o.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(o.palette.primary.main,.16):tt(o.palette.primary.main,.08)}),[Se,o]),q=Qt__default.useMemo(()=>{let j=new Set(s);return Ye.filter(Le=>j.has(Le?.[Ft]))},[Ft,s,Ye]),ee=q.length===1?q[0]:null,De=!!P?.enabled,he=!!w?.enabled,Ne=!!k?.enabled,_e=P?.fields,Je=P?.excludeFields||[],Ue=P?.initialValues||{},vt=w?.fields,Dt=w?.excludeFields||[],St=w?.editableFields||[],yt=w?.nonEditableFields||[],F=w?.primaryKeys?.length?w.primaryKeys:[Ft],[Z,ue]=Qt__default.useState(false),[xe,et]=Qt__default.useState(false),[qe,Tt]=Qt__default.useState({}),[gt,mt]=Qt__default.useState(false),[wt,rr]=Qt__default.useState(false),[Bt,qt]=Qt__default.useState({}),[zt,Ut]=Qt__default.useState(false),[Wt,er]=Qt__default.useState(false),or=m||xe||wt||Wt,ur=Qt__default.useMemo(()=>{let j=[...z];if(Array.isArray(_e)&&_e.length>0){let Le=new Set(_e);j=j.filter(Qe=>Le.has(Qe.id));}if(Je.length>0){let Le=new Set(Je);j=j.filter(Qe=>!Le.has(Qe.id));}return j.filter(Le=>!!Le?.id)},[z,Je,_e]),Pr=Qt__default.useMemo(()=>{let j=[...z];if(Array.isArray(vt)&&vt.length>0){let Le=new Set(vt);j=j.filter(Qe=>Le.has(Qe.id));}if(Dt.length>0){let Le=new Set(Dt);j=j.filter(Qe=>!Le.has(Qe.id));}return j.filter(Le=>!!Le?.id)},[z,Dt,vt]),Tr=Qt__default.useMemo(()=>new Set(F),[F]),to=Qt__default.useMemo(()=>new Set(St),[St]),hr=Qt__default.useMemo(()=>new Set(yt),[yt]),Er=Qt__default.useCallback(j=>to.size>0?to.has(j):!(hr.has(j)||Tr.has(j)),[to,hr,Tr]);Qt__default.useEffect(()=>{!bt&&pt.hasActiveFilters&&pt.clearAll();},[pt,bt]);let Uo=()=>{let j={};ur.forEach(Le=>{j[Le.id]=Ue[Le.id]??"";}),Tt(j),ue(true);},Ko=(j,Le)=>{Tt(Qe=>({...Qe,[j]:Le}));},Ao=async()=>{if(!P?.onSubmit){ue(false);return}try{et(!0),await P.onSubmit(qe),ue(!1);}finally{et(false);}},qo=()=>{if(!ee)return;let j={};Pr.forEach(Qe=>{j[Qe.id]=ee[Qe.id]??"";});let Le=w?.getInitialValues?{...j,...w.getInitialValues(ee)}:j;qt(Le),mt(true);},Xo=(j,Le)=>{qt(Qe=>({...Qe,[j]:Le}));},Ir=async()=>{if(ee){if(!w?.onSubmit){mt(false);return}try{rr(!0),await w.onSubmit(Bt,ee),mt(!1);}finally{rr(false);}}},Eo=()=>{q.length!==0&&Ut(true);},Yo=async()=>{if(q.length===0){Ut(false);return}if(!k?.onConfirm){Ut(false),xt([]),l?.([]);return}try{er(!0),await k.onConfirm(q),Ut(!1),xt([]),l?.([]);}finally{er(false);}},_r=Ye,{fieldMapping:ro}=dn({rows:_r,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`}}),Dn=Qt__default.useMemo(()=>Ot?pt.applyRows(_r,ro):_r,[ro,pt,Ot,_r]),{model:Lo}=dn({rows:Dn,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`,fieldMapping:ro}}),M=Lo.table.columns.map(j=>({id:j.id,label:j.label,align:j.align||"left",minWidth:120,numeric:j.align==="right"})),$=ut?f(mn,{appId:ut,tableKey:b$1,currentLayoutData:dt,onLayoutLoad:Te,targetLayoutId:_t,activeLayoutId:Lt,serviceUrl:I??g$1?.serviceUrl}):null,U=z.filter(j=>Q.includes(j.id)),ce=U.find(j=>j.id===A)||U[0],Be=R?.map(j=>U.find(Le=>Le.id===j)).filter(Boolean)||U.filter(j=>j.id!==ce?.id).slice(0,G==="portrait"?2:3),nt=U.filter(j=>j.id!==ce?.id&&!Be.some(Le=>Le.id===j.id)),We=[T,p].filter(Boolean),re=g(e,{children:[f(ln,{groupAnchorEl:ke,setGroupAnchorEl:ze,grouping:fe,setGrouping:Ge,columns:z}),f(cn,{anchorEl:Ve,setAnchorEl:rt,columns:z,visibleColumns:Q,toggleColumnVisibility:Fe}),f(mi,{anchorEl:Pe,setAnchorEl:Ce,showSummary:me,setShowSummary:ie,columns:z,summaryColumns:se,toggleSummaryColumn:Et}),f(gi,{contextMenu:at,handleCloseContextMenu:ot,columns:z,visibleColumns:Q,toggleColumnVisibility:Fe})]}),pe=(j,Le,Qe)=>{let Me=s.includes(Le),Xe=G==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",It=Qe%2===0?tt(o.palette.primary.main,b()==="dark"?.09:.04):tt(o.palette.primary.main,b()==="dark"?.05:.022),Zo=tt(o.palette.divider,.22);return f(Ae,{elevation:0,onClick:()=>{At({},j),X?.(j);},sx:{p:D==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(o.palette.primary.main,.38):Zo,background:Me?`linear-gradient(135deg, ${tt(o.palette.primary.main,.13)}, ${tt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${It}, ${tt(o.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(o.palette.primary.main,.2)}`:`0 3px 10px ${tt(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Me?o.palette.primary.main:Qe%2===0?tt(o.palette.primary.main,.26):tt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ae,{spacing:1.25,children:[g(ae,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Rt,{checked:Me,onClick:Cr=>Cr.stopPropagation(),onChange:()=>At({},j),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[ce?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Zu(ce,j)}):null,Be.length>0?f(ae,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(Cr=>f(kt,{label:`${Cr.label}: ${$v(Cr,j)}`,size:"small",variant:"outlined",sx:Se},`${Le}-${Cr.id}`))}):null]}),L?f("div",{onClick:Cr=>Cr.stopPropagation(),children:L(j)}):null]}),nt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:nt.map(Cr=>g(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(o.palette.background.default,.7):tt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(o.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Cr.label}),Wv(Zu(Cr,j))]},`${Le}-${Cr.id}-detail`))}):null,B?g(e,{children:[f(Nt,{}),f("div",{onClick:Cr=>Cr.stopPropagation(),children:B(j)})]}):null]})},Le)};return g("div",{sx:{width:f$1?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(_u,{...g$1,onVariantLoad:j=>{Ie(j),g$1.onVariantLoad?.(j);},appId:g$1.appId,tableKey:b$1,currentLayout:[{tableKey:b$1,layoutData:dt}],currentLayoutId:Lt,layoutRefs:[{tableKey:b$1,layoutId:Lt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:G==="portrait"?"expanded":"comfortable"})}):null,g(Ae,{sx:{width:f$1?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":or?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(ci,{filterText:O,setFilterText:Y,onRowsPerPageChange:je,rowsPerPage:it,rowsPerPageOptions:v,page:ve,count:ht,onPageChange:Ee,actions:d,extraTools:We,grouping:fe,setGroupAnchorEl:ze,showSummary:me,setShowSummary:ie,setAnchorEl:rt,setSummaryAnchorEl:Ce,handleExport:te,showCreateButton:De,onOpenCreateDialog:Uo,showEditButton:he,onOpenEditDialog:qo,editDisabled:q.length!==1,showDeleteButton:Ne,onOpenDeleteConfirm:Eo,deleteDisabled:q.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Ze:void 0,loading:m,layoutManager:$,onOpenGraphReport:Pt?ft:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ae,{spacing:1.25,children:[Oe.length===0&&!m?N||f(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,Oe.map((j,Le)=>{if(j.type==="group"){let Xe=Re.has(j.id);return f(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>le(j.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Xe?f(rn,{}):f(Za,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[j.field,": ",j.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[j.count," records"]})]}),fe.length>1&&j.level<fe.length-1?g(ae,{direction:"row",spacing:.5,children:[f(kt,{size:"small",label:r("table.group.expandAll"),onClick:It=>{It.stopPropagation(),ge(j.id);},sx:V}),f(kt,{size:"small",label:r("table.group.collapseAll"),onClick:It=>{It.stopPropagation(),J(j.id);},sx:V})]}):null]})},j.id)}let Qe=j.data||j,Me=j.id||Qe[Ft]||Le;return pe(Qe,Me,Le)}),me?f(Gv,{summaryRow:_,visibleColumns:Q,columns:z}):null,m?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),De?g(Ht,{open:Z,onClose:()=>!xe&&ue(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:P?.title||r("quickCreate.createWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ur.map(j=>{let Le=j.type==="number"||j.numeric?"number":j.type==="date"?"date":"text";return f(He,{label:j.label||j.id,value:qe[j.id]??"",onChange:Qe=>Ko(j.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${j.id}`)}),P?.description?f(Yr,{severity:"info",children:P.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:()=>ue(false),disabled:xe,children:P?.cancelLabel||r("common.cancel")}),f(ye,{onClick:Ao,variant:"contained",disabled:xe,children:P?.submitLabel||r("common.save")})]})]}):null,he?g(Ht,{open:gt,onClose:()=>!wt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Pr.map(j=>{let Le=j.type==="number"||j.numeric?"number":j.type==="date"?"date":"text";return f(He,{label:j.label||j.id,value:Bt[j.id]??"",onChange:Qe=>Xo(j.id,Qe.target.value),type:Le,disabled:!Er(j.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${j.id}`)}),w?.description?f(Yr,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:()=>mt(false),disabled:wt,children:w?.cancelLabel||r("common.cancel")}),f(ye,{onClick:Ir,variant:"contained",disabled:wt||!ee,children:w?.submitLabel||r("common.save")})]})]}):null,Ne?f(Kn,{open:zt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(q.length>1?r("quickDelete.confirmMessageMultiple",{count:q.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:()=>!Wt&&Ut(false),onConfirm:Yo}):null,re,Pt?f(yi,{open:bt,onClose:yr,model:Lo,aiAssistant:C?.aiAssistant,interaction:Ot?{enabled:true,filters:pt.filters,fieldMapping:ro,onPrimaryDimensionClick:j=>pt.setFilter("primaryDimension",j),onSecondaryDimensionClick:j=>pt.setFilter("secondaryDimension",j),onStatusClick:j=>pt.setFilter("status",j),onClearFilter:pt.clearFilter,onClearAll:pt.clearAll}:void 0,tableContent:f(_v,{appId:ut||"graph-report-internal",title:r("graph.dataBody"),columns:M,rows:Lo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var YO=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:u,portraitBottomSlot:f$1,contentSx:h,containerSx:m,user:v,onSearch:y,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:C,onWorkloadSelect:P,locale:w="en",localeLabel:k,localeOptions:I,onLocaleChange:S,onUserSetting:A,onUserLogout:R,userMenuItems:T,leftHeaderSlot:N,rightHeaderSlot:D})=>{let L="orbcafe:page-layout-mode",[B,X]=useState("system"),[H,K]=useState("light"),[W,G]=useState(false),[z,O]=useState(false),Y=B==="system"?z?H:"light":B;useEffect(()=>{G(true);},[]),useEffect(()=>{try{let at=window.localStorage.getItem(L);(at==="light"||at==="dark"||at==="system")&&X(at);}catch{}O(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),rt=()=>{K(Ve.matches?"dark":"light");};return rt(),Ve.addEventListener("change",rt),()=>Ve.removeEventListener("change",rt)},[]),useEffect(()=>{if(z)try{window.localStorage.setItem(L,B);}catch{}},[z,B]),useEffect(()=>{Y==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[Y]);let Q=Mr("(orientation: portrait)"),me=Mr("(max-width: 899.95px)"),ie=l==="auto"?!W||Q||me?"portrait":"landscape":l,[se,fe]=useState({landscape:x??true,portrait:false}),Ge=se[ie],Re=b??Ge,ke=Ve=>{b===void 0&&fe(rt=>({...rt,[ie]:Ve})),C?.(Ve);},ze=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&ie==="portrait"?f(ne,{onClick:()=>ke(!Re),sx:{bgcolor:"action.hover"},children:f(ri,{})}):null,N]}),Pe=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[u,D]}),Ce=f(Yu,{collapsed:ie==="landscape"?!Re:false,onToggle:()=>ke(!Re),menuData:o,orientation:ie,colorMode:Y,maxHeight:ie==="landscape"?900:void 0});return f(Nn,{mode:B,children:f(Ha,{locale:w,children:g("div",{sx:[Ve=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ve.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ve.palette.background.default}),...Array.isArray(m)?m:[m]],children:[f(Fi,{appTitle:t,logo:d===void 0?null:d,mode:B,onToggleMode:()=>X(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:w,localeLabel:k,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:A,onUserLogout:R,userMenuItems:T,onSearch:y,onSearchAdd:g$1,leftSlot:ze,rightSlot:Pe}),p?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&ie==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Ce}):null,!W||i&&ie==="portrait"?f(hd,{open:Re,onClose:()=>ke(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Ce}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:g(ae,{spacing:1.5,children:[s&&n.length>0?f(Uu,{items:n,selectedId:a,orientation:ie,onItemSelect:P}):null,f(Ae,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:r})]})})]}),ie==="portrait"&&f$1?g(e,{children:[f(Nt,{}),f("div",{sx:{p:1.5},children:f$1})]}):null]})})})};var Qu=Uv(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function Pl({isRecording:t}){return f(AnimatePresence,{children:t&&f(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(Qu,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(Qu,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var eF=Pl;var Ju=createContext(null);function jv(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Jv({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:u}){let[f$1,h]=useState(false),[m,v]=useState(false),y=useRef(null),g$1=useRef(false),x=useRef(false),b=useCallback(()=>{x.current=false,h(false);},[]),{isRecording:C,startRecording:P,stopRecording:w}=yn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:u,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(v(!0),await r(A.trim()));}catch(R){let T=R instanceof Error?R.message:"Failed to process voice command";n?.(T);}finally{v(!1),b();}},onError:A=>{n?.(A),v(!1),g$1.current||b();}}),k=useCallback(async()=>{x.current=false,await P();},[P]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let A=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&jv(document.activeElement)||(g$1.current=true,T.preventDefault(),y.current=setTimeout(()=>{x.current=true,h(true),P();},a)));},R=T=>{(T.code==="Space"||T.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g$1.current=false,x.current&&(T.preventDefault(),h(false),w()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",R),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,P,w]);let S=useMemo(()=>({isRecording:C,isHotkeyRecording:f$1,isSubmitting:m,startRecording:k,stopRecording:I}),[f$1,C,m,k,I]);return g(Ju.Provider,{value:S,children:[l?f(Pl,{isRecording:f$1}):null,t]})}function ey(){let t=useContext(Ju);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var iF=Jv,sF=ey;function ct(...t){return twMerge(clsx(t))}var ay=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),s=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[g("span",{className:"flex items-center",children:[f(Pa,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Lr,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},em=ay;var dy=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=br(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(p){console.error("\u590D\u5236\u5931\u8D25:",p);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:ct("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),f("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?f(Ur,{size:14,className:"text-[var(--orb-status-success)]"}):f(fc,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:r,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},tm=dy;var rm="orb-html-demo",fy=160,hy=560,by=220,Ml=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(rm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,vy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",yy=t=>/<html[\s>]/i.test(t),Cy=t=>{let r=t.trim();return yy(r)?/<\/body>/i.test(r)?r.replace(/<\/body>/i,`${Ml}</body>`):`${r}${Ml}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${vy}</style></head><body>${r}${Ml}</body></html>`},xy=({content:t,title:r="Interactive HTML"})=>{let o=useRef(null),[n,a]=useState(by),i=useMemo(()=>Cy(t),[t]);return useEffect(()=>{let s=l=>{if(l.source!==o.current?.contentWindow)return;let d=l.data;!d||d.source!==rm||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(hy,Math.max(fy,Math.ceil(d.height))));};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),g("figure",{className:"orb-html-demo-frame",children:[f("figcaption",{className:"orb-html-demo-caption",children:r}),f("iframe",{ref:o,className:"orb-html-demo",title:r,sandbox:"allow-scripts",srcDoc:i,style:{height:n}})]})},om=xy;var ky=({content:t,isLoading:r,className:o="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),p=br();return useEffect(()=>{let u=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{am.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await am.render(m,v);!u&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(u)return;console.error("Mermaid render failed:",m),d(m instanceof Error?m.message:"Render failed");}finally{u||s(false);}}},h=setTimeout(()=>{f();},100);return ()=>{u=true,clearTimeout(h);}},[t,p]),g("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&g("div",{className:"overflow-auto rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-4 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),f("pre",{children:l}),f("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),f("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},im=ky;var Py=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[u,f$1]=useState(false),[h,m]=useState(false),v=async()=>{if(l){m(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(ya,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:o})]}),r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?f("p",{className:"whitespace-pre-wrap",children:r}):r}),(l||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[l&&g("button",{onClick:v,disabled:h,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Dc,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>f$1(!u),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[u?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),u?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(Xt,{className:"w-4 h-4"})})]}),n&&u&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},Qi=Py;var Ty=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,className:u="",...f$1})=>{let h=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},m=()=>{switch(n){case "info":return f(ka,{className:"w-5 h-5"});case "error":return f(Ea,{className:"w-5 h-5"});case "success":return f(Ca,{className:"w-5 h-5"});default:return f(uc,{className:"w-5 h-5"})}},v=h();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${u}`,...f$1,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((y,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:y})]},g$1))})]}),s&&l&&f("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Xt,{className:"w-4 h-4"})})]}),d&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:p||"\u786E\u8BA4"})})]})},ji=Ty;var Iy=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[u,f$1]=useState(false),[h,m]=useState(""),[v,y]=useState(false),g$1=useMemo(()=>h.trim()?o.filter(C=>C.toLowerCase().includes(h.toLowerCase())):o,[o,h]),x=useMemo(()=>u?g$1:g$1.slice(0,a),[g$1,u,a]),b=C=>{n?.(C);};return !o||o.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(Pa,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),g("div",{className:"flex items-center space-x-1",children:[o.length>3&&f("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Fr,{className:"w-4 h-4"})}),s&&l&&f("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(Xt,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:C=>m(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Fr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((C,P)=>f("li",{children:g("button",{onClick:()=>b(C),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:C}),f(Or,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},P))}),g$1.length>a&&f("button",{onClick:()=>f$1(!u),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:u?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&h&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Ji=Iy;var My=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:u,actionText:f$1,className:h="",...m})=>{let[v,y]=useState(false),[g$1,x]=useState(true),b=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},C=()=>{switch(i){case "pending":return f(kc,{className:"w-5 h-5 animate-spin"});case "error":return f(Ea,{className:"w-5 h-5"});default:return f(Ca,{className:"w-5 h-5"})}},P=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=b(),k=t||o||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${h}`,...m,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||C()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:k}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),o&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(On,{className:"w-3 h-3 mr-1"}),o]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(hc,{className:"w-3 h-3 mr-1"}),P(s)]}),d&&p&&f("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Xt,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&g("div",{children:[g("button",{onClick:()=>x(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),f(On,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),u&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:u,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f$1||"\u6267\u884C\u64CD\u4F5C"})})]})]})},es=My;var Dy=({data:t})=>{if(!t)return null;let r=useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(Qr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ts=Dy;var Ny=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(Ms,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(wc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Rc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(pc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(xc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Cc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Fc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Ln,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Tc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Ms,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return f(Qn,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(vp,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=o.reduce((p,u)=>p+(Number(u.value)||0),0),d=o.map(p=>({name:p.name,value:Number(p.value)||0,percent:typeof p.percent=="number"?p.percent:l>0?(Number(p.value)||0)/l*100:0}));return f(hi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(yp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Cp,{data:o});case "fishbone-chart-card":return f(xp,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Sp,{data:o,height:a.height});case "google-map-card":return f(wp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return f(kp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},rs=Ny;var ss=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],Ay={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},as=480,kn=214,Gt={top:18,right:16,bottom:38,left:30},jt=t=>typeof t=="number"&&Number.isFinite(t)?t:0,um=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gr=(t,r)=>`${t.id||t.label}-${r}`,mm=(t,r=13)=>t.length>r?`${t.slice(0,Math.max(1,r-1))}\u2026`:t,is=(t,r,o)=>Math.min(o,Math.max(r,t)),po=(t,r,o)=>t.color??o[r%o.length],uo=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},gm=t=>{let r=t.map(a=>jt(a.value)),o=Math.min(0,...r),n=Math.max(0,...r);return {min:o,max:n===o?o+1:n,range:n===o?1:n-o}},Ey=(t,r,o)=>{let n=as-Gt.left-Gt.right,a=kn-Gt.top-Gt.bottom,{max:i,range:s}=gm(o),l=Gt.left+t*n/Math.max(o.length-1,1),d=Gt.top+(i-jt(r.value))/s*a,p=Gt.top+i/s*a;return {x:l,y:d,zeroY:p}},ns=(t,r,o,n)=>{let a=(n-90)*Math.PI/180;return {x:t+o*Math.cos(a),y:r+o*Math.sin(a)}},Ly=(t,r,o,n,a,i)=>{let s=ns(t,r,o,i),l=ns(t,r,o,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${r} L ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=ns(t,r,n,i),u=ns(t,r,n,a);return `M ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} L ${u.x} ${u.y} A ${n} ${n} 0 ${d} 1 ${p.x} ${p.y} Z`},Oy=({children:t})=>g("div",{className:"orb-metric-empty",role:"status",children:[f("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),f(E,{variant:"body2",muted:true,children:t})]}),Fy=()=>g("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),f("span",{className:"orb-metric-skeleton"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Nl=({item:t,onItemClick:r,interactions:o})=>{let n=()=>r?.(t);return {...r?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{r&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...uo(t,o),style:{cursor:r||o?"pointer":"default"}}},By=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?f(Fy,{}):r?f("div",{className:"orb-metric-error",role:"alert",children:r}):o?f(e,{children:a}):f(Oy,{children:n??"No data for the current selection."}),Hy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(jt(l.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=jt(l.value),u=`${is(Math.abs(p)/s*100,0,100)}%`,f$1=r===l.id,h=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${f$1?" is-active":""}`,style:{width:u,backgroundColor:po(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(p)})]});return o?f("button",{type:"button",className:`orb-metric-bar-row${f$1?" is-active":""}`,onClick:()=>o(l),title:`${l.label}: ${a(p)}`,"aria-pressed":f$1,...uo(l,n),children:h},Gr(l,d)):f("div",{className:`orb-metric-bar-row${f$1?" is-active":""}`,role:"listitem",...uo(l,n),children:h},Gr(l,d))})})},zy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(jt(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(jt(l.value),0),u=is(p/s*100,0,100),f$1=r===l.id,h=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(p)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${u}%`,backgroundColor:po(l,d,i)}})})]});return o?f("button",{type:"button",className:`orb-metric-progress-row${f$1?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f$1,...uo(l,n),children:h},Gr(l,d)):f("div",{className:`orb-metric-progress-row${f$1?" is-active":""}`,role:"listitem",...uo(l,n),children:h},Gr(l,d))})})},Vy=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:u,range:f$1}=gm(r),h=as-Gt.left-Gt.right,m=kn-Gt.top-Gt.bottom,v=Gt.top+u/f$1*m,y=Math.max(1,Math.ceil(r.length/6)),g$1=r.map((C,P)=>Ey(P,C,r)),x=g$1.map(C=>`${C.x},${C.y}`).join(" "),b=Math.max(...r.map(C=>Math.max(jt(C.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${as} ${kn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:v,x2:as-Gt.right,y2:v}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:kn-Gt.bottom}),t==="column"&&r.map((C,P)=>{let w=g$1[P],k=jt(C.value),I=Math.max(Math.abs(w.y-v),k===0?2:0),S=w.x-Math.min(18,h/Math.max(r.length*2,1)),A=Math.min(36,Math.max(10,h/Math.max(r.length*1.8,1))),R=o===C.id;return g("g",{...Nl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(k)}`,children:[f("rect",{className:`orb-metric-column${R?" is-active":""}`,x:S,y:Math.min(w.y,v),width:A,height:I,rx:4,fill:po(C,P,l)}),g("title",{children:[C.label,": ",i(k)]}),(P%y===0||r.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:kn-14,textAnchor:"middle",children:mm(C.label)})]},Gr(C,P))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),r.map((C,P)=>{let w=g$1[P],k=o===C.id,I=t==="bubble"?7+Math.max(jt(C.secondaryValue),0)/b*12:t==="scatter"?5:4;return g("g",{...Nl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(jt(C.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:k?6:4,fill:po(C,P,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:po(C,P,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[C.label,": ",i(jt(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(jt(C.secondaryValue))}`:""]}),(P%y===0||r.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Gt.top+8,w.y-I-7),textAnchor:"middle",children:mm(C.label)})]},Gr(C,P))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(u)}),p<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:kn-Gt.bottom+14,children:i(p)})]})})},Wy=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=r.map(m=>({...m,value:Math.max(jt(m.value),0)})),p=d.reduce((m,v)=>m+v.value,0),u=72,f$1=92,h=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((m,v)=>{let y=m.value/p*360,g$1=h;h+=y;let x=o===m.id,b=y>=359.9?void 0:Ly(f$1,f$1,u,t==="donut"?46:0,g$1,g$1+y),C=Nl({item:m,onItemClick:n,interactions:a});return b?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:po(m,v,s),...C,children:g("title",{children:[m.label,": ",i(m.value)," (",(m.value/p*100).toFixed(1),"%)"]})},Gr(m,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f$1,cy:f$1,r:t==="donut"?60:u,fill:t==="donut"?"none":po(m,v,s),stroke:t==="donut"?po(m,v,s):void 0,strokeWidth:28,...C,children:g("title",{children:[m.label,": ",i(m.value)," (100%)"]})},Gr(m,v))}),t==="donut"&&f("circle",{cx:f$1,cy:f$1,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:f$1,y:f$1+5,textAnchor:"middle",children:i(p)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((m,v)=>{let y=o===m.id;return g("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(m),disabled:!n,title:m.label,...uo(m,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:po(m,v,s)}}),f("span",{className:"orb-metric-legend-label",children:m.label}),g("strong",{children:[(m.value/p*100).toFixed(0),"%"]})]},Gr(m,v))})})]})},$y=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=g(e,{children:[f("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),f("span",{className:"orb-metric-list-value",children:a(jt(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(jt(s.secondaryValue))})]});return o?f("button",{type:"button",className:`orb-metric-list-row${r===s.id?" is-active":""}`,onClick:()=>o(s),"aria-pressed":r===s.id,...uo(s,n),children:d},Gr(s,l)):f("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...uo(s,n),children:d},Gr(s,l))})}),ls=({title:t,subtitle:r,data:o=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=um,secondaryValueFormatter:p=um,valueLabel:u,secondaryValueLabel:f$1,emptyState:h,loading:m=false,error:v,maxItems:y=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:C,chartTypeLabels:P,footer:w,ariaLabel:k,className:I,style:S,sx:A})=>{let R=Is(),T=useRef(null),N=useRef(null),[D,L]=useState(n),[B,X]=useState(false),[H,K]=useState(null),[W,G]=useState(null);useEffect(()=>L(n),[n]);let z=useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null);},[]);useEffect(()=>z,[z]),useEffect(()=>{if(!W)return;let _=Oe=>{let ve=Oe.target;ve instanceof HTMLElement&&ve.closest(".orb-metric-context-menu")||G(null);};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[W]);let O=D,Y=useMemo(()=>[R.chart1,R.chart2,R.chart3,R.chart4,R.chart5,R.chart6],[R]),Q=useMemo(()=>B?o:o.slice(0,Math.max(1,y)),[o,y,B]),me=Math.max(0,o.length-Q.length),ie=Q.some(_=>jt(_.value)>0),se=Q.length>0&&(O!=="pie"&&O!=="donut"?true:ie),fe=(C??[O,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((_,Oe,ve)=>ss.includes(_)&&ve.indexOf(_)===Oe),Ge={...Ay,...P},Re=Q[0],ke=k??`${t} ${Ge[O]} chart`,ze=_=>{L(_),a?.(_);},Pe=useCallback((_,Oe)=>{K({item:_,source:Oe}),G(null),s?.(_,Oe);},[s]),Ce=useCallback(_=>{z(),!(!x||W)&&(N.current=window.setTimeout(()=>{Pe(_,"hover"),N.current=null;},Math.max(0,b)));},[z,W,b,Pe,x]),Ve=useCallback(()=>{z();},[z]),rt=useCallback((_,Oe)=>{if(!x)return;_.preventDefault(),z();let ve=T.current?.getBoundingClientRect(),Ee=ve?is(_.clientX-ve.left,8,Math.max(8,ve.width-164)):8,it=ve?is(_.clientY-ve.top,8,Math.max(8,ve.height-72)):8;G({item:Oe,left:Ee,top:it});},[z,x]),at=x?{onItemHoverStart:Ce,onItemHoverEnd:Ve,onItemContextMenu:rt}:void 0,Ye=O==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>Re&&i?.(Re),onKeyDown:_=>{Re&&i&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i(Re));},"aria-label":ke,...Re?uo(Re,at):{},children:[f("span",{className:"orb-metric-kpi-label",children:Re?.label??u??"Value"}),f("strong",{children:Re?d(jt(Re.value)):"\u2014"}),Re?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[f$1??"Compared with"," \xB7 ",p(jt(Re.secondaryValue))]})]}):O==="progress"?f(zy,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y}):O==="bar"?f(Hy,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y}):O==="list"?f($y,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p}):O==="pie"||O==="donut"?f(Wy,{type:O,data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y,ariaLabel:ke}):f(Vy,{type:O,data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p,colors:Y,ariaLabel:ke});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{z(),H?.source==="hover"&&K(null);},children:[g(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:A,children:[g("div",{className:"orb-metric-chart-header",children:[g("div",{className:"orb-metric-chart-heading",children:[f(E,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),r&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:r})]}),g$1&&fe.length>1&&f(Vt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:O,options:fe.map(_=>({value:_,label:Ge[_]})),onChange:_=>ze(_.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(By,{loading:m,error:v,hasData:se,emptyState:h,children:Ye}),me>0&&!m&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>X(_=>!_),children:B?"Show fewer":`Show all ${o.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),W&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:z,onKeyDown:_=>{_.key==="Escape"&&G(null);},style:{left:W.left,top:W.top},onPointerDown:_=>_.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:W.item.label}),f("button",{type:"button",role:"menuitem",onClick:_=>{_.preventDefault(),_.stopPropagation(),Pe(W.item,"contextmenu");},children:"Show data"})]}),H&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${H.item.label} data details`,onPointerDown:_=>_.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:H.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>K(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:u??"Value"}),f("strong",{children:d(jt(H.item.value))})]}),H.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:f$1??"Secondary value"}),f("strong",{children:p(jt(H.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:H.source==="hover"?`Shown after ${Math.max(0,b)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ls.displayName="CMetricChartCard";var Gy=({messageId:t,cardHooks:r,valueSuffix:o,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{r?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return f(ls,{...a,valueFormatter:l=>s(l,o),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},cs=Gy;var _y=({type:t,manifest:r})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),ds=_y;var Uy=t=>Array.isArray(t)?t.flatMap((r,o)=>{if(!r||typeof r!="object")return [];let n=r,a=String(n.label??n.name??n.id??`Item ${o+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??o),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ps=t=>{let r;try{r=JSON.parse(t);}catch{return null}if(r&&typeof r=="object"){if(r.type==="metric-chart-card"&&r.title&&Array.isArray(r.data)){let o=ss.includes(r.chartType)?r.chartType:"bar";return {...r,type:"metric-chart-card",chartType:o,data:Uy(r.data)}}if((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)return r}return null};var jy=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=useRef(l);d.current=l;let p=!!l?.onCardEvent,u=useMemo(()=>p?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[p]),f$1=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),h=(y,g,x,b,C)=>{u?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:b,rawData:C});},m=(y,g,x,b,C,P)=>{if(!(!C&&!u?.onCardEvent))return (...w)=>{let k=C?.(...w),I=P?P(...w):void 0;return h(y,g,x,I,b),k}},v=useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...b}=y;return g==="thinkbox"&&x?f(em,{content:decodeURIComponent(x),theme:r,size:o,defaultExpanded:false}):f("div",{...b})},table({children:y}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let b=/language-([\w-]+)/.exec(y||""),C=b?b[1]:"",P=String(g);if(!b&&!P.includes(`
|
|
17
|
-
`))return f("code",{children:g});let k=P.replace(/\n$/,"");if(i&&C==="mermaid")return f(im,{content:k});if(C==="html"||C==="htm")return f(om,{content:k});if(C==="json"){let I=ps(k);if(I)switch(I.type){case "table":return f(ts,{data:I.data});case "metric-chart-card":return f(cs,{...I,messageId:s,cardHooks:u});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(rs,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...I});case "error-card":{let S=I;return f(Qi,{...S,onClose:m("error-card","close",S.title,S,S.onClose),onRetry:m("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,A=S.onConfirm?m("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&u?.onCardEvent?m("warning-card","confirm",S.title,S):void 0;return f(ji,{...S,onClose:m("warning-card","close",S.title,S,S.onClose),onConfirm:A})}case "suggestions-card":{let S=I;return f(Ji,{...S,onClose:m("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:m("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,A=>({suggestion:A}))})}case "tool-result-card":{let S=I;return f(es,{...S,onClose:m("tool-result-card","close",S.title,S,S.onClose),onAction:m("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(tm,{content:k,language:C,className:"not-prose"}):f("code",{className:y,...x,children:g})}}),[r,o,i,a,u,s]);return f("div",{className:ct("markdown-body max-w-none",n),children:f(qy,{remarkPlugins:[Xy,Yy],rehypePlugins:[Zy,Qy],components:v,children:f$1})})},Pn=jy;var Jy=({content:t,messageId:r,cardHooks:o})=>{let n=(s,l,d,p,u)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:l,title:d,payload:p,rawData:u});},a=(s,l,d,p,u,f)=>{if(!(!u&&!o?.onCardEvent))return (...h)=>{let m=u?.(...h),v=f?f(...h):void 0;return n(s,l,d,v,p),m}},i=ps(t);if(i)switch(i.type){case "table":return f(ts,{data:i.data});case "metric-chart-card":return f(cs,{...i,messageId:r,cardHooks:o});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(rs,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...i});case "error-card":{let s=i;return f(Qi,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(ji,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(Ji,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return f(es,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(Pn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},fm=Jy;var El=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},tC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=Qt__default.useMemo(()=>El.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(fm,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):f(Pn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},us=tC;var rC=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=useState(r?0:t.length),[u,f$1]=useState(!r);useEffect(()=>{if(r){p(0),f$1(false);return}p(t.length),f$1(true);},[t,r]),useEffect(()=>{if(!r||u)return;if(d>=t.length){f$1(true),o?.();return}let g=window.setTimeout(()=>{p(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,u,r,o,i,a,d]);let h=()=>{r&&!u&&(p(t.length),f$1(true),o?.());},m=r?t.slice(0,d):t,v=r&&!u,y=r&&!u;return g("div",{className:`streaming-markdown ${n}`,onClick:h,style:{cursor:r?"pointer":"default"},children:[g("div",{className:"relative",children:[f(us,{content:m,messageId:s,cardHooks:l}),v&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},vm=rC;var ym=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return f(ho,{size:14});case "refresh":return f(Na,{size:14});case "volume":return f(Hc,{size:14});case "like":return f(Lc,{size:14});case "dislike":return f(Ec,{size:14});default:return null}};return f("div",{className:ct("flex items-center gap-1",r),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ct("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:o(n.type)},`${n.type}-${a}`))})};var ms=({message:t,onStreamingComplete:r,assistantActions:o,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(o?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(vm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(ym,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:d||!o?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};var Cm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=yn({onTextUpdate:t,onComplete:p=>{r?.(p);},onError:p=>{console.error("Voice input error:",p),o?.();}});return f("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ct("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?f(_d,{size:16}):f(Ud,{size:16})})};var Jt={container:"w-full max-w-4xl mx-auto",inputContainer:ct("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ct("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ct("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ct("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ct("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ct("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ct("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},nC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},aC=({enabled:t,onClick:r})=>f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,Jt.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:f(Sd,{size:16})}),iC=()=>g("button",{className:ct(Jt.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",Jt.buttonNormal),"aria-label":"Tools",type:"button",children:[f(Bd,{size:15}),f("span",{className:"text-xs font-medium",children:"Tools"})]}),sC=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,Jt.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:f(ep,{size:15})}):f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,t?Jt.sendButton:Jt.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:f(Yd,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),Ll=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[p,u]=useState(false),[f$1,h]=useState(false),m=useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!o,g$1={enabled:true},x=useCallback(B=>{s(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),b=useCallback(B=>{if(B.target.files&&B.target.files.length>0){let X=Array.from(B.target.files);d(H=>{let K=X.filter(G=>H.some(z=>z.name===G.name&&z.size===G.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(G=>G.name));let W=X.filter(G=>!H.some(z=>z.name===G.name&&z.size===G.size));return [...H,...W]}),m.current&&(m.current.value="");}},[]),C=useCallback(B=>{d(X=>X.filter((H,K)=>K!==B));},[]),P=useCallback(()=>{m.current?.click();},[]),w=useCallback(async()=>{if(!y)return;let B=i,X=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(B,X);}catch(H){console.error("Failed to send message:",H),s(B),d(X);}},[i,y,t,l]),k=useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!p&&(B.preventDefault(),w());},[w,p]),I=useCallback(()=>{u(true);},[]),S=useCallback(()=>{u(false);},[]),A=useCallback(B=>{s(B);},[]),R=useCallback(B=>{s(B);},[]),T=useCallback(()=>{},[]),N=useCallback(B=>{B.preventDefault(),h(true);},[]),D=useCallback(B=>{B.preventDefault(),h(false);},[]),L=useCallback(B=>{if(B.preventDefault(),h(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let X=Array.from(B.dataTransfer.files);d(H=>[...H,...X]);}},[]);return f("div",{className:Jt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:b}),g("div",{className:ct(Jt.inputContainer,f$1&&Jt.dragActive),onDragOver:N,onDragLeave:D,onDrop:L,children:[l.length>0&&f("div",{className:Jt.filePreviewArea,children:l.map((B,X)=>g("div",{className:Jt.fileTag,children:[f(zd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:B.name}),f("button",{onClick:()=>C(X),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(Dd,{sx:{fontSize:16}})})]},`${B.name}-${X}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ct(Jt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ct(Jt.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:k,onCompositionStart:I,onCompositionEnd:S,style:nC,"aria-label":"Message input",spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[g("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[f(aC,{enabled:g$1.enabled,onClick:P}),f(iC,{})]}),g("div",{className:"flex items-center gap-1",children:[f(Cm,{onTextUpdate:A,onComplete:R,onCancel:T,disabled:o,className:Jt.buttonSmall}),f(sC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};var Sm=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:u,showInput:f$1=true,statusLine:h})=>{let m=useRef(null),v=useRef(t.length);return useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),g("div",{className:ct("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,b=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return f(ms,{message:y,assistantActions:b,onStreamingComplete:()=>p?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:u},y.id)}),h,f("div",{ref:m})]}),f$1&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Ll,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};var wm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},km=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),u=p==="running"||p==="pending",f$1=[wm[p],r].filter(Boolean).join(" \xB7 ");return g("div",{className:ct("orb-agent-panel",n),children:[g("div",{className:ct("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":u||void 0}),f("span",{className:"truncate",children:f$1||"Agent"})]})]}),o&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),f("div",{className:"relative min-h-0 flex-1",children:f(Sm,{...d,showInput:l,statusLine:u?g("div",{className:ct("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${wm[p]}\u2026`})]}):void 0})})]})};var gC=2e3,fC=1/3,fs=[.25,.5,.75,1,1.5,2,3,4],hC=100,Pm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Tm=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let u=t.split(`
|
|
18
|
-
`);
|
|
19
|
-
`),shownCount:f,total:u.length}},[t]),d=useCallback(u=>{let f=n??o,h=o!==void 0&&f!==void 0&&u>=o&&u<=f;return {className:"orb-omph-code-line","data-line":u,...h?{"data-hit":"true"}:{}}},[n,o]);useEffect(()=>{let u=s.current,f=u?.closest(".orb-omph-pv-body");if(!u||!f)return;if(o===void 0){f.scrollTop=0;return}let h=u.querySelector(`[data-line="${o}"]`);if(!h)return;let m=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,m-f.clientHeight*fC);},[o,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[f(Prism,{language:r,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Pm,codeTagProps:{className:`language-${r}`,style:Pm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Im=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(Pn,{content:t})}),Mm=({url:t,alt:r,labels:o})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),p=n==="fit"?1:n,u=fs.some(v=>v>p),f$1=fs.some(v=>v<p),h=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?fs.find(b=>b>g):[...fs].reverse().find(b=>b<g))??y}),m=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?f("div",{className:"orb-omph-pv-note",role:"alert",children:r?`${o.imageFailed} \xB7 ${r}`:o.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:r??"",draggable:false,style:m,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":o.zoomFit,children:[f("button",{type:"button","aria-label":o.zoomOut,disabled:!f$1,onClick:()=>h(-1),children:"\u2212"}),f("button",{type:"button","aria-label":o.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?o.zoomFit:`${Math.round(n*hC)}%`}),f("button",{type:"button","aria-label":o.zoomIn,disabled:!u,onClick:()=>h(1),children:"+"})]})]})};var bC=/^[a-z][a-z0-9+.-]*:/i,vC=/^L(\d+)(?:-L?(\d+))?$/i;var Rm=["B","KB","MB","GB"];var yC=t=>{try{return decodeURIComponent(t)}catch{return t}},Fl=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||bC.test(r))return null;let o=r.indexOf("#"),n=o>=0?r.slice(0,o):r,a=o>=0?r.slice(o+1):"",i=n.indexOf("?"),s=yC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=vC.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let p=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,p)}},Bl=t=>t.split("/").filter(Boolean).pop()??t,Nm=t=>{let r=t.split("/");return r.pop(),r.join("/")},Hl=t=>{let r=Bl(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},Am={prism:"text",label:"Text"},Dm={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:Am},zl=(t,r)=>r?Object.values(Dm).find(n=>n.prism===r)??{prism:r,label:r}:Dm[Hl(t)]??Am,Em=t=>{let r=t,o=0;for(;r>=1024&&o<Rm.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${Rm[o]}`};var CC=1e3,xC=9,mo=16,Vl=({tone:t,icon:r,title:o,text:n,action:a})=>g("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[f("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:r}),f("div",{className:"orb-omph-pv-notice-title",children:o}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),Fm=({state:t,placement:r,expanded:o,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:u})=>{let[f$1,h]=useState(true),[m,v]=useState(false),{open:y,ref:g$1,phase:x,data:b}=t,C=b?.body;useEffect(()=>{if(!m)return;let L=window.setTimeout(()=>v(false),CC);return ()=>window.clearTimeout(L)},[m]),useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g$1?.path]);let P=b?.absolutePath??g$1?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:P,k=w===P?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g$1?zl(g$1.path,C.language):null,S=[];I&&S.push(I.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g$1&&S.push(Hl(g$1.path).toUpperCase()),b?.size!==void 0&&S.push(Em(b.size)),C?.kind==="code"&&g$1?.startLine!==void 0&&S.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let A=L=>{L.key==="Escape"&&(L.stopPropagation(),l(true));},R=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),T=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:xC},(L,B)=>f("span",{},B))});if(x==="error"||!C)return f(Vl,{tone:"error",icon:f(ya,{size:mo}),title:a.previewFailed,text:P,action:R});switch(C.kind){case "missing":return f(Vl,{tone:"neutral",icon:f(wa,{size:mo}),title:a.previewMissing,text:C.message??P});case "unsupported":return f(Vl,{tone:"neutral",icon:f(wa,{size:mo}),title:a.previewUnsupported,text:C.message??P,action:u&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>u(g$1),children:a.previewOpenExternal})});case "markdown":return f(Im,{text:C.text},g$1.path);case "code":return f(Tm,{text:C.text,language:zl(g$1.path,C.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:f$1,labels:a},g$1.path);case "image":return f(Mm,{url:C.url,alt:C.alt,labels:a},C.url);default:return null}},N=r==="overlay",D=C?.kind==="image"?Sc:wa;return g("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:N?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:A,children:[!N&&y&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[N&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(xa,{size:mo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(D,{size:mo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:P,children:g$1?Bl(g$1.path):""}),f("div",{className:"orb-omph-pv-path",title:P,children:f("bdi",{children:Nm(P)})})]}),g("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f$1,onClick:()=>h(L=>!L),children:a.previewWrap}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:k,title:m?a.copied:k,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:m?f(Ur,{size:mo}):f(ho,{size:mo})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":o,"aria-label":o?a.previewCollapse:a.previewExpand,title:o?a.previewCollapse:a.previewExpand,onClick:p,children:f(vc,{size:mo})}),!N&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Xt,{size:mo})})]})]}),f("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:T()})]})]})};var wC=1e3,Bm=50,kC=1e3,PC=t=>t==="tool"?jo:t==="command"?On:Ic,zm=t=>!!t.streaming||t.status==="running"||t.status==="pending",TC=(t,r)=>r==="expanded"?true:zm(t),IC=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),MC=(t,r)=>`${Math.max(1,Math.round(t/kC))}${r.secondUnit}`,RC=({content:t})=>{let r=useRef(null),[o,n]=useState(false);return useEffect(()=>{let a=r.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),f("div",{ref:r,className:"orb-omph-process-body","data-overflow":o||void 0,children:t})},DC=({turn:t,labels:r})=>{let[o,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",l=t.usage;return useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),wC);return ()=>window.clearTimeout(d)},[o]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":r.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),IC(l)&&g(e,{children:[f("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),f("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:r.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":o?r.copied:r.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:o?f(Ur,{size:14}):f(ho,{size:14})}),a&&l&&g("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&g("span",{children:[r.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&g("span",{children:[r.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&g("span",{children:[r.duration," ",MC(l.durationMs,r)]})]})]})},NC=({item:t,display:r,open:o,onToggle:n})=>{let a=PC(t.kind),i=zm(t),s=r!=="compact"&&!!t.summary,l=o&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":o||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":o,onClick:n,children:[f(Lr,{size:12,className:"orb-omph-process-chevron"}),f(a,{size:14}),f("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&f("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&f(RC,{content:t.content}),o&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Wl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
|
|
20
|
-
`).find(n=>n.trim())??r;return o.length>Bm?`${o.slice(0,Bm)}\u2026`:o},AC=0,Vm=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==AC||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let u=p.target.closest("a[href]");if(!u)return;let f=a(u.getAttribute("href")??"");f&&(p.preventDefault(),i(f,u));};return f(e,{children:t.map((p,u)=>{let f$1=!!(p.assistant&&!p.assistant.streaming),m=u===t.length-1&&f$1?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":m,children:[p.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble",children:p.user.content}),f("div",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]}),p.process&&p.process.length>0&&f("div",{className:"orb-omph-process-list",children:p.process.map(v=>{let y=v.id in s?s[v.id]:TC(v,o);return f(NC,{item:v,display:o,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),p.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(us,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&f("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),f$1&&f(DC,{turn:p,labels:r})]},p.id)})})};var EC={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width"},$m=t=>({...EC,...t}),LC={waiting:"Waiting for approval",choose:"Choose an action",details:"Approval details",choices:"Actions",reject:"Reject",allowOnce:"Allow once",confirm:"Continue",other:"Other",otherPlaceholder:"Describe the action to take",escalation:t=>`Tool ${t} requests privileged execution`},Gm=t=>({...LC,...t}),OC=1e3,Wm=60,FC=1e3,_m=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,FC)/OC)),n=Math.floor(o/Wm),a=o%Wm;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var zC={open:false,ref:null,phase:"loading",data:null},Um=t=>{let[r,o]=useState(zC),n=useRef(r);n.current=r;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),l=useRef(null),d=useCallback(h=>{let m=a.current;if(!m)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;o({open:true,ref:h,phase:"loading",data:null}),m(h,v.signal).then(g=>{y===s.current&&o(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||o(g=>({...g,phase:"error",data:null}));});},[]),p=useCallback((h,m)=>{l.current=m??null;let v=n.current;if(v.ref?.path===h.path&&v.phase==="ready"){o({...v,open:true,ref:h});return}d(h);},[d]),u=useCallback((h=false)=>{s.current+=1,i.current?.abort(),o(v=>({...v,open:false}));let m=l.current;h&&m?.isConnected&&m.focus({preventScroll:true});},[]),f=useCallback(()=>{let{ref:h}=n.current;h&&d(h);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:p,close:u,reload:f}};var Gl="--orb-omph-pv-w",_l="--orb-omph-pv-pref",$C=880,GC=560,qm=400,$o=320,_C=.45,UC=.7,Xm=24,$l=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Ym=({open:t,layout:r})=>{let o=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,p]=useState(false),[u,f]=useState(false);useLayoutEffect(()=>{let k=o.current;if(!k)return;let I=()=>i(k.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(k),()=>S.disconnect()},[]),useEffect(()=>{t||p(false);},[t]);let h=r==="overlay"?false:r==="split"?a>=qm+$o:a>=$C,m=h&&!d?"split":"overlay",v=Math.max($o,Math.min(a*UC,a-qm)),y=$l(s??a*_C,$o,v),g=a>0&&a<GC,x=useCallback(k=>{let I=o.current;I&&(I.style.setProperty(_l,`${k}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Gl,`${k}px`));},[]),b=useCallback(k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),n.current={pointerId:k.pointerId,startX:k.clientX,startWidth:y,latest:y},f(true));},[y]),C=useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(I.latest=$l(I.startWidth+(I.startX-k.clientX),$o,v),x(I.latest));},[v,x]),P=useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(n.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId),l(I.latest),f(false));},[]),w=useCallback(k=>{let I={ArrowLeft:y+Xm,ArrowRight:y-Xm,Home:$o,End:v};k.key in I&&(k.preventDefault(),l($l(I[k.key],$o,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:u,expanded:d,canExpand:h,toggleExpanded:()=>p(k=>!k),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":$o,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:b,onPointerMove:C,onPointerUp:P,onPointerCancel:P,onKeyDown:w}}};var ys=48,qC=900,Qm=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,jm=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),l=useRef(true),d=useRef({height:0,top:0}),p=useRef(void 0),u=useRef(false),[f,h]=useState(true),[m,v]=useState(false),[y,g]=useState(t[0]?.id),x=useCallback(()=>{let k=i.current;k&&(d.current={height:k.scrollHeight,top:k.scrollTop});},[]),b=useCallback(()=>{let k=i.current;if(!k)return;let I=k.getBoundingClientRect().top,S=k.querySelector("[data-omph-turn]")?.dataset.omphTurn;k.querySelectorAll("[data-omph-turn]").forEach(A=>{A.getBoundingClientRect().top-I<=ys&&(S=A.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let k=i.current,I=s.current;if(!k||!I)return;let S=()=>{v(k.clientWidth>qC),l.current&&(k.scrollTop=k.scrollHeight),x();};S();let A=new ResizeObserver(S);return A.observe(k),A.observe(I),()=>A.disconnect()},[x]),useLayoutEffect(()=>{let k=i.current;if(!k)return;let I=t[0]?.id,S=p.current,A=S!==void 0&&I!==void 0&&I!==S;if(p.current=I,A){l.current=false,h(false);let R=k.scrollHeight-d.current.height;k.scrollTop=d.current.top+Math.max(0,R),x(),b();return}l.current&&(k.scrollTop=k.scrollHeight),x(),b();},[r,x,t,b]),useEffect(()=>{n||(u.current=false);},[n]);let C=useCallback(()=>{let k=i.current;if(!k)return;let S=k.scrollHeight-k.scrollTop-k.clientHeight<=ys;S!==l.current&&(l.current=S,h(S)),x(),b();let A=k.scrollHeight-k.clientHeight>ys,R=k.scrollTop<=ys;!A||!R||S||!o||n||!a||u.current||(u.current=true,a());},[o,n,a,x,b]),P=useCallback(()=>{let k=i.current;k&&(l.current=true,h(true),k.scrollTo({top:k.scrollHeight,behavior:Qm()?"auto":"smooth"}));},[]),w=useCallback(k=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(k)}"]`);S&&(l.current=false,h(false),S.scrollIntoView({block:"start",behavior:Qm()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:P,scrollToTurn:w}};var YC=1e3,ZC=(t,r)=>r[t],QC=t=>t.map(r=>[r.id,r.user?.content.length??0,r.assistant?.content.length??0,r.assistant?.streaming?"1":"0",r.failure?.id??"",(r.process??[]).map(o=>`${o.id}:${o.status}:${o.content?.length??0}`).join(",")].join(":")).join("|"),jC=({startedAt:t,labels:r})=>{let[o,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),YC);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(_m(Math.max(0,o-t),r));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:r.working}),f("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),g("span",{className:"orb-omph-running-body",children:[f("span",{className:"orb-omph-spinner","aria-hidden":"true"}),f("span",{className:"orb-omph-shimmer",children:a})]})]})},PH=({turns:t,title:r="OMPH Agent",description:o,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:p,className:u,cardHooks:f$1,hasOlder:h=false,loadingOlder:m=false,onLoadOlder:v,onSend:y,onStop:g$1,onHeaderPointerDown:x,loadFilePreview:b,resolveFileLink:C=Fl,filePreviewLayout:P="auto",onOpenFileExternally:w})=>{let k=$m(s),I=a??(i?"running":"idle"),S=I==="running"||I==="pending",A=[ZC(I,k),o].filter(Boolean).join(" \xB7 "),R=useMemo(()=>QC(t),[t]),T=jm({turns:t,contentVersion:R,hasOlder:h,loadingOlder:m,onLoadOlder:v}),[N,D]=useState(""),L=N.trim(),B=i&&L.length===0,X=[...t].reverse().find(se=>!!se.assistant?.streaming||se.process?.some(fe=>fe.streaming||fe.status==="running"||fe.status==="pending")),H=S?X?.startedAt:void 0,K=!!b,W=Um(b),G=Ym({open:W.state.open,layout:P}),z=useRef(null),O=useRef(null),Y=K&&W.state.open&&G.placement==="overlay",Q=G.placement==="split"&&W.state.open,me={[_l]:`${G.width}px`,[Gl]:Q?`${G.width}px`:"0px"};useEffect(()=>{O.current?.toggleAttribute("inert",Y);},[Y]);let ie=async()=>{if(!L||!y)return;let se=L;D("");try{await y(se);}catch{D(fe=>fe.trim().length===0?se:fe);}};return g("div",{className:ct("orb-omph-panel",u),"data-omph-panel":"","data-status":I,"data-compact":G.compact||void 0,children:[g("div",{className:ct("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-omph-title",children:r}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":S||void 0}),f("span",{className:"truncate",children:A||k.idle})]})]}),n&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:n})]}),g("div",{ref:G.mainRef,className:"orb-omph-main","data-placement":G.placement,"data-open":String(W.state.open),"data-dragging":G.dragging||void 0,style:me,children:[g("div",{ref:O,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":T.railVisible||void 0,children:[f("div",{ref:T.scrollerRef,className:"orb-omph-scroll",onScroll:T.onScroll,children:g("div",{ref:T.contentRef,className:"orb-omph-column",children:[h&&v&&f("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?k.loadingOlder:k.loadOlder}),f(Vm,{turns:t,labels:k,processDisplay:l,cardHooks:f$1,resolveFileLink:C,onOpenFile:K?W.open:void 0}),S&&f(jC,{startedAt:H,labels:k})]})}),T.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":k.turnRail,children:t.map(se=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":T.activeTurnId===se.id||void 0,"aria-label":Wl(se),title:Wl(se),onClick:()=>T.scrollToTurn(se.id)},se.id))}),!T.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":k.toBottom,onClick:T.returnToBottom,children:f(Lr,{size:16})})]}),d&&g("form",{className:"orb-omph-composer",onSubmit:se=>{se.preventDefault(),B?g$1?.():ie();},children:[f("textarea",{className:"orb-omph-input",value:N,placeholder:p,rows:1,onChange:se=>D(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||se.nativeEvent.isComposing||(se.preventDefault(),B?g$1?.():ie());}}),f("button",{type:"submit",className:B?"orb-omph-stop":"orb-omph-send","aria-label":B?k.stop:k.send,disabled:!B&&L.length===0,children:B?f(gc,{size:16}):f(mc,{size:16})})]})]}),K&&f(Fm,{state:W.state,placement:G.placement,expanded:G.expanded,canExpand:G.canExpand,labels:k,gripProps:G.gripProps,paneRef:z,onClose:W.close,onRetry:W.reload,onToggleExpand:G.toggleExpanded,onOpenExternally:w})]})]})};var go="other",JC=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,ex=({request:t,onDecide:r,labels:o})=>{let n=Gm(o),a=useRef(null),i=useRef(null),s=useRef(false),l=useRef(false),[d,p]=useState(false),[u,f$1]=useState(null),[h,m]=useState(""),v=t.choices??[],y=t.allowOther??v.length>0,g$1=v.length>0||y,x=t.reason?.trim()||n.escalation(t.toolName),b=t.detail?.trim(),C=u===go&&h.trim().length>0,P=!g$1||u!==null&&u!==go||C;useEffect(()=>{p(false),f$1(null),m(""),a.current?.focus();},[t.id]),useEffect(()=>{u===go&&i.current?.focus();},[u]);let w=S=>{d||(p(true),r(S,t));},k=()=>{if(P){if(!g$1){w({kind:"allowed-once"});return}if(u===go){let S=h.trim();if(!S)return;w({kind:"other",text:S});return}u&&w({kind:"choice",choiceId:u});}},I=S=>{if(!(d||JC(S.target))&&!(S.key!=="Enter"&&S.key!=="Escape")&&!(S.key==="Enter"&&S.target instanceof HTMLElement&&S.target.closest('button, a[href], [role="button"]'))&&!(S.ctrlKey||S.metaKey||S.altKey||S.shiftKey)&&(S.preventDefault(),S.stopPropagation(),!(S.repeat||s.current||l.current||S.nativeEvent.isComposing))){if(S.key==="Escape"){w({kind:"rejected"});return}k();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":d,onKeyDown:I,onKeyUpCapture:()=>{l.current=false;},onCompositionStartCapture:()=>{s.current=true;},onCompositionEndCapture:()=>{s.current=false,l.current=true;},children:g("div",{className:"orb-omph-approval-card",children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),g$1?n.choose:n.waiting]}),g("div",{ref:a,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":n.details,children:[f("div",{className:"orb-omph-approval-headline",children:x}),b&&f("div",{className:"orb-omph-approval-detail",children:b}),g$1&&g("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[f("legend",{className:"orb-visually-hidden",children:n.choices}),v.map(S=>{let A=u===S.id;return g("label",{className:"orb-omph-approval-choice","data-selected":A,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:A,onChange:()=>f$1(S.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:S.label}),S.description&&f("span",{className:"orb-omph-approval-choice-description",children:S.description})]})]},S.id)}),y&&g("label",{className:"orb-omph-approval-choice","data-selected":u===go,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:go,checked:u===go,onChange:()=>f$1(go)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:n.other})})]}),y&&u===go&&f("textarea",{ref:i,className:"orb-omph-approval-other",value:h,placeholder:n.otherPlaceholder,rows:3,"aria-label":n.other,onChange:S=>m(S.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:d,onClick:()=>w({kind:"rejected"}),children:n.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!P,onClick:k,children:g$1?n.confirm:n.allowOnce})]})]})})};var ag=520,ox=88,nx=88,ax=24,xs=640,ig=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),ql=t=>typeof t=="number"?`${t}px`:t,ix=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,FH=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=ag,top:a=ox,bottom:i=nx,inset:s=ax,zIndex:l=1300,shellClassName:d,shellStyle:p,className:u,onHeaderPointerDown:f$1,...h})=>{let m=useRef(null),v=useRef(null),[y,g]=useState(r),[x,b]=useState(0),[C,P]=useState(typeof n=="number"?n:ag),[w,k]=useState(0),[I,S]=useState(false),A=t??y;useEffect(()=>{let H=()=>b(window.innerWidth);return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),useLayoutEffect(()=>{let H=()=>{let W=m.current?.getBoundingClientRect();W?.width?P(W.width):typeof n=="number"&&P(n);};if(H(),!m.current||typeof ResizeObserver>"u")return;let K=new ResizeObserver(H);return K.observe(m.current),()=>K.disconnect()},[n]);let R=useCallback(H=>{if(!x)return s;let K=x<xs?12:s,W=Math.max(K,x-C-K);return x<xs||H==="left"?K:H==="center"?ig((x-C)/2,K,W):W},[s,C,x]),T=useCallback(H=>["left","center","right"].reduce((W,G)=>{let z=Math.abs(H-R(W));return Math.abs(H-R(G))<z?G:W},"right"),[R]),N=useCallback(H=>{t===void 0&&g(H),o?.(H);},[t,o]);useEffect(()=>{I||k(R(A));},[R,I,A]);let D=useCallback(H=>{f$1?.(H),!(H.defaultPrevented||ix(H.target))&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),v.current={pointerId:H.pointerId,startClientX:H.clientX,startX:w,currentX:w,captureElement:H.currentTarget},S(true));},[f$1,w]),L=useCallback(H=>{let K=v.current;if(!K||K.pointerId!==H.pointerId)return;let W=x<xs?12:s,G=Math.max(W,x-C-W),z=ig(K.startX+H.clientX-K.startClientX,W,G);K.currentX=z,k(z);},[s,C,x]),B=useCallback(H=>{let K=v.current;if(!K||K.pointerId!==H.pointerId)return;try{K.captureElement.releasePointerCapture(H.pointerId);}catch{}let W=T(K.currentX);v.current=null,S(false),N(W),k(R(W));},[R,N,T]),X=useMemo(()=>({position:"fixed",top:ql(a),bottom:ql(i),left:w,width:ql(n),maxWidth:`calc(100vw - ${x<xs?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,I,w,p,a,x,n,l]);return f("div",{ref:m,className:ct("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":A,"data-dragging":I?"true":"false",style:X,onPointerMove:L,onPointerUp:B,onPointerCancel:B,children:f(km,{...h,className:u,onHeaderPointerDown:D})})};var cx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},_H=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:u,onMicClick:f$1,streamIntervalMs:h,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g$1,x]=useState(""),[b,C]=useState(false),P=useRef(null),w=cx[l];useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let k=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await r(S));},[n,r,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!b&&(S.preventDefault(),await k());},[k,b]);return g("div",{className:ct("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&f("button",{onClick:d,className:ct("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:f("span",{className:ct("block h-4 w-4 border-[var(--orb-ai-accent)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,A)=>{let R=S.type==="assistant"&&A===t.length-1,T=S.type==="assistant"?{isLatestAssistant:R,isResponding:n,onRegenerate:o?()=>o(S.id):void 0}:void 0;return f(ms,{message:S,assistantActions:T,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:h,streamChunkSize:m,cardHooks:y},S.id)}),f("div",{ref:P})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:u,type:"button","aria-label":"Add",children:f(Da,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f$1,type:"button","aria-label":"Microphone",children:f(Ia,{className:"h-4 w-4"})})]})})]})};var dx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],px=`
|
|
7
|
+
`),h={enableMath:n},p=0;for(;p<f$1.length;){let v=f$1[p],y=v.trim();if(!y){p+=1;continue}if(i&&Yp(v)){if(y.startsWith("<think>")){let b=[],C=v;for(;;){let k=C.indexOf("<think>"),w=k>=0?C.slice(k+7):C,P=w.indexOf("</think>");if(P>=0){b.push(w.slice(0,P)),p+=1;break}if(b.push(w),p+=1,p>=f$1.length)break;C=f$1[p];}m.push(f(Ri,{content:b.join(`
|
|
8
|
+
`).trim()},`think-tag-${p}`));continue}p+=1;let x=[];for(;p<f$1.length&&f$1[p].trim()!==":::";)x.push(f$1[p]),p+=1;p<f$1.length&&f$1[p].trim()===":::"&&(p+=1),m.push(f(Ri,{content:x.join(`
|
|
9
|
+
`).trim()},`think-fence-${p}`));continue}if(Di(v)){let x=y.slice(3).trim().toLowerCase(),b=[];for(p+=1;p<f$1.length&&!Di(f$1[p]);)b.push(f$1[p]),p+=1;p<f$1.length&&Di(f$1[p])&&(p+=1);let C=b.join(`
|
|
10
|
+
`);if(a&&x==="mermaid"){m.push(f(tl,{code:C},`mermaid-${p}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(f(aa,{expression:C,allowKatex:true},`math-fence-${p}`));continue}m.push(f(na,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${p}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),p+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),p+=1;p<f$1.length;){let k=f$1[p],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),p+=1;break}x.push(k),p+=1;}}m.push(f(aa,{expression:x.join(`
|
|
11
|
+
`).trim(),allowKatex:true},`math-${p}`));continue}if(Kp(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),b=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";m.push(f(ho,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:ia(b,h,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(qp(v)){m.push(f(sd,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(Xp(f$1,p)){let x=p+2;for(;x<f$1.length&&f$1[x].trim()&&f$1[x].includes("|");)x+=1;let b=f$1.slice(p,x).join(`
|
|
12
|
+
`),C=Mi(b);if(C){m.push(f(rl,{table:C},`table-${p}`)),p=x;continue}}if(sl(v)){let x=[];for(;p<f$1.length&&sl(f$1[p]);)x.push(f$1[p].replace(/^\s*>\s?/,"")),p+=1;m.push(f(Or,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(ho,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,C)=>g(Fragment,{children:[C>0&&f("br",{}),ia(b,h,`q-${p}-${C}`)]},`quote-line-${C}`))})},`quote-${p}`));continue}if(al(v)){let x=[];for(;p<f$1.length&&al(f$1[p]);)x.push(f$1[p].trim().replace(/^[-*+]\s+/,"")),p+=1;m.push(f(Te,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,C)=>f(Te,{component:"li",sx:{mb:.45},children:f(ho,{variant:"body2",children:ia(b,h,`ul-${p}-${C}`)})},`ul-item-${C}`))},`ul-${p}`));continue}if(il(v)){let x=[];for(;p<f$1.length&&il(f$1[p]);)x.push(f$1[p].trim().replace(/^\d+\.\s+/,"")),p+=1;m.push(f(Te,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,C)=>f(Te,{component:"li",sx:{mb:.45},children:f(ho,{variant:"body2",children:ia(b,h,`ol-${p}-${C}`)})},`ol-item-${C}`))},`ol-${p}`));continue}let g$1=[];for(;p<f$1.length;){let x=f$1[p],b=x.trim();if(!b||Di(x)||Kp(x)||qp(x)||al(x)||il(x)||sl(x)||Xp(f$1,p)||i&&Yp(x)||n&&b.startsWith("$$"))break;g$1.push(x),p+=1;}g$1.length>0?m.push(f(ho,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,b)=>g(Fragment,{children:[b>0&&f("br",{}),ia(x,h,`p-${p}-${b}`)]},`p-line-${b}`))},`p-${p}`)):p+=1;}return m},[d,n,a,i,s,l]);return f(Te,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};var dN=(t,o)=>f(sa,{markdown:t,...o});var Zp=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:u=true})=>g(ae,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Br,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(gd,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ne,{size:"small",onClick:a,children:f(xr,{sx:{fontSize:d?16:18}})}),n&&f(ne,{size:"small",onClick:n,children:f(Gd,{sx:{fontSize:d?16:18}})}),f(ne,{size:"small",onClick:r,disabled:l||!t.trim(),children:f(Yd,{sx:{fontSize:d?16:18}})})]}),u&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var Qp=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.toLowerCase(),i=n.indexOf(a);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+r.length)}),t.slice(i+r.length)]})},Ni=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(Ne,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:r===3?"repeat(3, minmax(0, 1fr))":r===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return g("div",{sx:{minWidth:0},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Qp(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Qp(a,o):n.value})]},n.id)})})]})};var ll=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ei=t=>t.trim().toLowerCase(),Nb=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||ll(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ei(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||ll(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ei(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||ll(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:l,text:Ei(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},jp=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(r||o[0]?.id),[u,m]=useState("idle"),[f,h]=useState([]),[p,v]=useState(""),[y,g]=useState(""),[x,b]=useState(false),C=useMemo(()=>Nb(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(N=>N.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=useCallback(()=>{m("idle"),h([]),v(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(m("idle"),h([]),v(""),g(""));},[]),P=useCallback(S=>{let N=Ei(S);return N?C.filter(R=>R.text.includes(N)).map(R=>R.hit):[]},[C]),I=useCallback(async()=>{let S=i.trim();if(!S)return;b(true);let N=P(S);if(h(N),N.length>0){m("search"),g(""),v(a("detail.searchAi.matches",{count:N.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),v(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(S,{query:S,hits:N,activeTabId:l,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{b(false);}return}m("search"),g(""),v(a("detail.searchAi.noMatch")),b(false);},[i,P,a,n,l,t,o]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:u,hits:f,statusText:p,aiResponse:y,searching:x,handleSubmit:I,clearResult:k}};var HN=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:u,closeLabel:m="Close"})=>{let{t:f$1}=de(),{query:h,setQuery:p,activeTabId:v,setActiveTabId:y,searchMode:g$1,hits:x,statusText:b,aiResponse:C,searching:k,handleSubmit:w,clearResult:P}=jp({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(R=>R.id===v)||n[0],[n,v]),S=useCallback(R=>{let T=D=>{let A=document.getElementById(R);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>T(D+1),60);};requestAnimationFrame(()=>T(0));},[]),N=useCallback((R,T)=>{if(n.some(D=>D.id===R)){y(R),S(T?`detail-tab-${R}-section-${T}`:`detail-tab-${R}`);return}S(`detail-section-${R}`);},[n,y,S]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ae,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(ae,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(Zp,{value:h,onChange:p,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{p(""),P();},placeholder:s?.placeholder||f$1("detail.searchAi.placeholder"),statusText:b,loading:k,compact:true,showStatusText:false})}),u&&f(lt,{title:m,children:f(ne,{size:"small",onClick:u,children:f(Ed,{fontSize:"small"})})}),l]})]}),b&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g$1==="search"&&x.length>0&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f$1("detail.searchAi.matches",{count:x.length})}),f(ae,{spacing:.35,children:x.slice(0,8).map(R=>f("div",{component:"button",type:"button",onClick:()=>N(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",f("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g$1==="ai"&&C&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f$1("detail.searchAi.aiResultTitle")}),f("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:f(sa,{markdown:C})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(R=>f("div",{id:`detail-section-${R.id}`,children:f(Ni,{section:R,highlightQuery:h})},R.id))}),n.length>0&&g(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(yd,{value:I?.id||false,onChange:(R,T)=>y(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(R=>f(Cd,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(ae,{spacing:1.5,children:[(I?.sections||[]).map(R=>f("div",{id:`detail-tab-${I?.id}-section-${R.id}`,children:f(Ni,{section:R,highlightQuery:h})},R.id)),I?.fields&&I.fields.length>0&&f(Ni,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:h})]})]})]}),i&&f(jo,{title:i.title||f$1("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var tu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:u})=>{let{t:m}=de(),[f$1,h]=useState(false),[p,v]=useState(t.title),y=()=>{v(t.title),h(false);},g$1=x=>{x.preventDefault();let b=p.trim();b&&(b!==t.title&&l?.(b),v(b),h(false));};return f(Ne,{elevation:0,sx:[x=>{let b=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${tt(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${tt(b,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:b}}},...Array.isArray(u)?u:u?[u]:[]],children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Te,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Te,{sx:{minWidth:0,flex:1},children:g(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Te,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f$1?g(Te,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:p,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!p.trim(),sx:{flex:1,minWidth:0}}),f(ne,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!p.trim(),children:f(Ko,{size:14})}),f(ne,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:y,children:f(Yt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f$1&&g(ae,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(Ct,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(Ct,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),l&&f(ne,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{v(t.title),h(true);},sx:{width:26,height:26},children:f(vc,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Te,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Te,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??m("kanban.empty")})})})]})})};var Eb={success:"success",warning:"warning",info:"info",error:"error"},Lb={critical:"error",high:"warning",medium:"info",low:"success"},Ob={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Fb=(t,o)=>{switch(t){case "critical":return o("kanban.priority.critical");case "high":return o("kanban.priority.high");case "medium":return o("kanban.priority.medium");case "low":return o("kanban.priority.low");default:return t}},Bb=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",cl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),l=!!(a&&o),d=t.tone??(t.priority?Lb[t.priority]:"default"),u=d==="default"?"primary":Eb[d],m=Ob[d],f$1=o?{card:t,bucket:o}:void 0;return f(Ne,{onClick:l?()=>f$1&&a?.(f$1):void 0,onKeyDown:l?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f$1&&a?.(f$1));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":l?{transform:"translateY(-1px)",borderColor:tt(m,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(ae,{spacing:1.25,children:[g(Te,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Te,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(Ct,{size:"small",color:u,label:Fb(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(Te,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>g(Te,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&g(Te,{children:[g(Te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(cd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&g(ae,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Te,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>f(Ct,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),g(Te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Ka,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Bb(t.assignee.name)}),g(Te,{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var ou=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},ru=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},Hb=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,nu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},$o=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},Li=(t,o)=>{let r=$o(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(u=>u.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let l=a[n],d=Hb(o.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((m,f)=>({...m,bucketId:u.id,position:f}))}))}};var ul="kanban-card|",ml="kanban-bucket|",su=t=>`${ul}${t}`,Yb=t=>`${ml}${t}`,Oi=t=>t?.startsWith(ul)?t.slice(ul.length):void 0,iu=t=>t?.startsWith(ml)?t.slice(ml.length):void 0,Zb=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:su(t.id)}),u={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:n,style:u,...a,...i,children:f(cl,{card:t,bucket:o,dragging:d,onClick:r})})},Qb=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:Yb(t.id)});return f(Te,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:f(tu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>su(d.id)),strategy:verticalListSortingStrategy,children:f(ae,{spacing:1,children:t.cards.map(d=>f(Zb,{card:d,bucket:t,onCardClick:i},d.id))})})})})},lu=t=>String(t??"").toLocaleLowerCase(),jb=(t,o)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>lu(n).includes(o)),uA=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:u,searchable:m=false,searchValue:f$1,defaultSearchValue:h="",onSearchValueChange:p,searchPlaceholder:v,emptyBucketLabel:y,sx:g$1})=>{let{t:x}=de(),[b,C]=useState(null),[k,w]=useState(),[P,I]=useState(h),S=f$1??P,N=S.trim().toLocaleLowerCase(),R=d??u??560,T=useMemo(()=>({buckets:t.buckets.map(z=>{let B=n?z.cards.filter(U=>n(U,z)):z.cards;if(!N)return {...z,cards:B};let G=[z.id,z.title,z.description].some(U=>lu(U).includes(N));return {...z,cards:G?B:B.filter(U=>jb(U,N))}})}),[n,t,N]),D=useMemo(()=>T.buckets.reduce((z,B)=>z+B.cards.length,0),[T]),A=useCallback(z=>{f$1===void 0&&I(z),p?.(z);},[p,f$1]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),O=useMemo(()=>b?$o(t,b):void 0,[b,t]),Y=useCallback(()=>{C(null),w(void 0);},[]),H=useCallback(z=>{if(!z)return;let B=Oi(z);return B?$o(t,B)?.bucket.id:iu(z)},[t]),q=useCallback(z=>{C(Oi(String(z.active.id))??null);},[]),V=useCallback(z=>{w(H(z.over?String(z.over.id):void 0));},[H]),Z=useCallback(z=>{let B=Oi(String(z.active.id)),G=z.over?String(z.over.id):void 0;if(!B||!G){Y();return}let U=$o(t,B);if(!U){Y();return}let ge=U.bucket.id,ie=U.cardIndex,pe=Oi(G);if(pe){let we=$o(t,pe);if(!we){Y();return}ge=we.bucket.id,ie=we.cardIndex;}else {let we=iu(G),se=t.buckets.find(Ae=>Ae.id===we);if(!we||!se){Y();return}ge=we,ie=se.cards.length;}if(U.bucket.id===ge&&U.cardIndex===ie){Y();return}let xe=Li(t,{cardId:B,fromBucketId:U.bucket.id,toBucketId:ge,targetIndex:ie}),We=$o(xe,B);We&&!(We.bucket.id===U.bucket.id&&We.cardIndex===U.cardIndex)&&o?.({cardId:B,fromBucketId:U.bucket.id,toBucketId:We.bucket.id,targetIndex:We.cardIndex,card:We.card,model:xe}),Y();},[t,o,Y]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:q,onDragOver:V,onDragEnd:Z,onDragCancel:Y,children:[g(Te,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Te,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&f(Te,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:S,onChange:z=>A(z.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Bo,{size:16,"aria-hidden":"true"}),endAdornment:S?f(ne,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Yt,{size:15})}):void 0})}),g(Te,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[N&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:D>0?x("kanban.search.results",{count:D}):x("kanban.search.noMatch")}),a&&f(Se,{size:"small",variant:"secondary",startIcon:f(jr,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(Te,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:T.buckets.map(z=>f(Qb,{bucket:z,highlighted:z.id===k,bucketHeight:R,emptyBucketLabel:N?x("kanban.search.noMatch"):y,onBucketRename:i?B=>i(z.id,B):void 0,onCardClick:r},z.id))})]}),f(DragOverlay,{children:O?f(Te,{sx:{width:Math.max(l-24,260)},children:f(cl,{card:O.card,bucket:O.bucket,overlay:true})}):null})]})};var tv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||nu({buckets:o??[],cards:r??[]}),bA=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>tv(t)),i=useCallback(h=>{a(p=>typeof h=="function"?h(p):h);},[]),s=useCallback(h=>$o(n,h),[n]),l=useCallback((h,p,v)=>{let y=$o(n,h);if(!y)return;let g=Li(n,{cardId:h,fromBucketId:y.bucket.id,toBucketId:p,targetIndex:v}),x=$o(g,h);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let b={cardId:h,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(b),b},[n,o]),d=useCallback((h,p)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof p=="function"?p(g):{...g,...p})}))}));},[]),u=useCallback(h=>{let p=ou(n,h);return p===n?false:(a(p),true)},[n]),m=useCallback((h,p)=>{let v=ru(n,h,p);return v===n?false:(a(v),true)},[n]),f=useMemo(()=>({model:n,onCardMove:h=>{l(h.cardId,h.toBucketId,h.targetIndex);},onCardClick:r}),[n,l,r]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:u,renameBucket:m,getCard:s},boardProps:f}};function Cn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=useState(false),d=useRef(null),u=useRef(null),m=useRef(null),f=useRef(null),h=useRef(null),p=useRef(0),v=useRef(false),y=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),u.current&&(u.current.getTracks().forEach(C=>C.stop()),u.current=null),m.current&&(m.current.close(),m.current=null),y.current=false,l(false);},[]),x=useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,p.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=C;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),y.current=!1;},k.onmessage=N=>{try{let R=JSON.parse(N.data);if(R.type==="recognition")R.is_final?o(R.text):t?.(R.text);else if(R.type==="error"){let T=R.message||"Voice recognition error";r?.(T),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let P=new w({sampleRate:16e3});m.current=P;let I=P.createMediaStreamSource(C);h.current=I;let S=P.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=N=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=N.inputBuffer.getChannelData(0),T=0;for(let L=0;L<R.length;L+=1)T+=R[L]*R[L];if(Math.sqrt(T/R.length)>i)p.current=Date.now();else if(Date.now()-p.current>a&&!v.current){x();return}let A=new Int16Array(R.length);for(let L=0;L<R.length;L+=1){let O=Math.max(-1,Math.min(1,R[L]));A[L]=O<0?O*32768:O*32767;}d.current.send(A.buffer);},I.connect(S),S.connect(P.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:x}}var av=["en","zh","fr","de","ja","ko"],du={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},fl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=de(),[d,u]=useState(""),m=useCallback((x=d)=>{let b=x.trim();b&&(u(""),o?.(b));},[o,d]),f$1=x=>{x.preventDefault(),m();},{isRecording:h,startRecording:p,stopRecording:v}=Cn({onTextUpdate:u,onComplete:x=>{u(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),y=useCallback(async()=>{if(h){v();return}await p();},[h,p,v]),g$1=t||l("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:f$1,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:l("header.searchAddFeature"),children:f(Pt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>u(x.target.value),placeholder:g$1,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&f(ne,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{y();},tooltip:l(h?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:h?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},Fi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:u,onSearchAdd:m,onOpenPanel:f$1,panelOpen:h,user:p,onUserRefresh:v,onUserSetting:y,onUserLogout:g$1,userMenuItems:x,leftSlot:b,rightSlot:C})=>{let{t:k,locale:w}=de(),P=yo(),I=n||w,S=a||du[I],N=i||av,R=P==="dark"?f(Dc,{size:15}):f(Lc,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),D=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:f(Na,{size:15}),onClick:v}]:[],...y?[{key:"settings",label:k("header.menu.setting"),icon:f(Jr,{size:16}),onClick:y}]:[],...g$1?[{key:"logout",label:k("header.menu.logout"),icon:f(Tc,{size:16}),onClick:g$1}]:[]],A=x||D,L=N.map(O=>({label:du[O],onClick:()=>{s?.(O),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:O===I}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[b,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Pt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(fl,{searchPlaceholder:l,onSearch:u,onSearchAdd:m,onOpenPanel:f$1,panelOpen:h})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Zt,{triggerLabel:S,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(On,{size:15}),f("span",{className:"orb-label",children:S})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":S,children:[f(On,{size:15}),f("span",{className:"orb-label",children:S})]}),f(ne,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:R})]}),p&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),p&&f(Zt,{triggerLabel:p.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(E,{variant:"body2",className:"orb-app-header-user-name",children:p.name}),p.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:p.subtitle,children:p.subtitle})]}),f(en,{src:p.avatarSrc,alt:p.name,size:32,children:p.avatarText||p.name.slice(0,1).toUpperCase()})]}),items:A.map(O=>({label:O.label,onClick:O.onClick,disabled:O.disabled,icon:O.icon})),align:"end"}),C]})]})};var pu=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:u}=od({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,f]=useState(900);useEffect(()=>{let p=()=>f(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let h=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:u,navigationMaxHeight:h}};var Eo=12,mu=56,gu=234,dv="orbcafe:page-layout-locale",fu=["en","zh","fr","de","ja","ko"],pv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Bi=(t,o)=>`orbcafe:page-layout:${pv(t)}:${o}`,uv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,mv=t=>t==="system"?"dark":t==="dark"?"light":"system",Hi=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),gv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,VA=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:u,defaultMode:m="system",onModeChange:f$1,user:h,onUserRefresh:p,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,logo:x,searchPlaceholder:b,searchPlacement:C="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,rightHeaderSlot:N,leftHeaderSlot:R,contentSx:T,navigationVariant:D="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:O,showNavigationModeToggle:Y=true,enableNavigationPinning:H=true,navigationPinStorageKey:q,pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Z,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:B})=>{let G=t?Bi(t,"mode"):"orbcafe:page-layout-mode",U=t?Bi(t,"locale"):dv,ge=t?Bi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[ie,pe]=useState(m),[xe,We]=useState("light"),[we,se]=useState(false),[Ae,Ie]=useState(i),[ke,ze]=useState(false),[et,rt]=useState(false),[at,K]=useState(L),[Re,ve]=useState({x:Eo,y:Eo}),[Fe,nt]=useState("left"),[Ye,xt]=useState(false),It=useRef(null),Lt=useRef(null),Nt=u!==void 0,te=u??ie,Ge=d!==void 0,Oe=Ge?i:Ae,le=l?.join("|")??"",be=A!==void 0,ee=A??at,he=ee==="floating",De=D==="v2"?zs:Zc,je=C==="header",it=te==="system"?we?xe:"light":te;useEffect(()=>{if(!Nt)try{let fe=window.localStorage.getItem(G);(fe==="light"||fe==="dark"||fe==="system")&&pe(fe);}catch{}se(true);let W=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{We(W.matches?"dark":"light");};return Q(),W.addEventListener("change",Q),()=>W.removeEventListener("change",Q)},[Nt,G]),useEffect(()=>{if(!(Nt||!we))try{window.localStorage.setItem(G,te);}catch{}},[we,Nt,te,G]),useEffect(()=>{if(Ge){ze(true);return}try{let W=window.localStorage.getItem(U),Q=l??fu;W&&fu.includes(W)&&Q.includes(W)&&Ie(W);}catch{}finally{ze(true);}},[Ge,le,U]),useEffect(()=>{if(!(Ge||!ke))try{window.localStorage.setItem(U,Oe);}catch{}},[Oe,Ge,ke,U]),useEffect(()=>{if(be){rt(true);return}try{let W=window.localStorage.getItem(ge);(W==="fixed"||W==="floating")&&K(W);}catch{}finally{rt(true);}},[be]),useEffect(()=>{if(et)try{window.localStorage.setItem(ge,ee);}catch{}},[ee,et]),useEffect(()=>{it==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[it]);let dt=useCallback(W=>{be||K(W),O?.(W);},[be,O]),Ft=useCallback(W=>{Nt||pe(W),f$1?.(W);},[Nt,f$1]),Kt=useCallback(W=>{Ge||Ie(W),d?.(W);},[Ge,d]),{navigationIslandProps:zt,navigationMaxHeight:St}=pu({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:ee,enableNavigationPinning:H,navigationPinStorageKey:q??(t?Bi(t,"pinned-navigation-items"):uv(o)),pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Z,onPinnedNavigationItemIdsChange:z,pinnedNavigationSectionTitle:B}),Vt=zt.collapsed,ht=useCallback(W=>{let Q=It.current,fe=Q?.parentElement;if(!Q||!fe)return W;let ye=fe.getBoundingClientRect(),Ee=Q.getBoundingClientRect(),$e=Eo,Ke=Eo,Ze=Math.max($e,ye.width-Ee.width-Eo),ut=Math.max(Ke,ye.height-Ee.height-Eo);return {x:Hi(W.x,$e,Ze),y:Hi(W.y,Ke,ut)}},[]),Dt=useCallback(W=>{let Q=It.current,fe=Q?.parentElement;if(!Q||!fe)return W;let ye=fe.getBoundingClientRect(),Ee=Q.getBoundingClientRect(),$e=Eo,Ke=Eo,Ze=Math.max($e,ye.width-Ee.width-Eo),ut=Math.max(Ke,ye.height-Ee.height-Eo),gt={x:Hi(W.x,$e,Ze),y:Hi(W.y,Ke,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Ze),position:{x:Ze,y:gt.y}},{distance:Math.abs(gt.y-Ke),position:{x:gt.x,y:Ke}},{distance:Math.abs(gt.y-ut),position:{x:gt.x,y:ut}}].reduce((F,j)=>j.distance<F.distance?j:F).position;return nt(bt.x>=($e+Ze)/2?"right":"left"),bt},[]),st=useMemo(()=>{if(!he||Ye)return Re.x;if(Fe==="right"){let fe=It.current?.parentElement?.getBoundingClientRect().width,ye=Vt?mu:gu;return fe?Math.max(Eo,fe-ye-Eo):Vt?Re.x:Re.x-(gu-mu)}return Re.x},[Fe,Re.x,Ye,he,Vt]),Ot=useCallback(W=>{if(!he||!Vt||gv(W.target))return;W.preventDefault(),W.currentTarget.setPointerCapture(W.pointerId);let Q=ht({x:st,y:Re.y});nt("left"),ve(Q),Lt.current={pointerId:W.pointerId,startClientX:W.clientX,startClientY:W.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},xt(true);},[ht,st,Re.y,he,Vt]),qt=useCallback(W=>{let Q=Lt.current;if(!Q||Q.pointerId!==W.pointerId)return;let fe=ht({x:Q.startX+W.clientX-Q.startClientX,y:Q.startY+W.clientY-Q.startClientY});Q.currentX=fe.x,Q.currentY=fe.y,ve(fe);},[ht]),X=useCallback(W=>{let Q=Lt.current;if(!(!Q||Q.pointerId!==W.pointerId)){try{W.currentTarget.releasePointerCapture(W.pointerId);}catch{}Lt.current=null,ve(Dt({x:Q.currentX,y:Q.currentY})),xt(false);}},[Dt]);return useEffect(()=>{if(!he)return;let W=()=>{ve(ye=>ht(ye));},Q=window.requestAnimationFrame(W),fe=window.setTimeout(W,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(fe);}},[ht,he,Vt,St]),f(An,{mode:te,children:f(Ha,{locale:Oe,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Fi,{appTitle:o,logo:x,mode:te,onToggleMode:()=>Ft(mv(te)),locale:Oe,localeLabel:Ge||Oe===i?s:void 0,localeOptions:l,onLocaleChange:Kt,user:h,onUserRefresh:p,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,searchPlaceholder:b,showSearch:je,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,leftSlot:R,rightSlot:N}),C==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(fl,{searchPlaceholder:b,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!he&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Vt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(De,{...zt,maxHeight:St,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:Y&&Vt})}),a&&he&&f("div",{ref:It,onPointerDown:Ot,onPointerMove:qt,onPointerUp:X,onPointerCancel:X,style:{position:"absolute",top:Re.y,left:st,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Vt?Ye?"grabbing":"grab":"default",touchAction:Vt?"none":"auto",userSelect:Ye?"none":void 0,transition:Ye?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(De,{...zt,maxHeight:St,colorMode:it,displayMode:ee,onDisplayModeChange:dt,showDisplayModeToggle:Y&&Vt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!he&&Vt?4:12,...T},children:n})]})]})})})};var zi="(blank)",hu="Result",bu="Grand Total",vu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},yu=["sum","count","avg","min","max"];var Cu=["palette","rows","columns","filters","values"];var xu=t=>Cu.includes(t),Su=t=>t==="rows"||t==="columns"||t==="filters",Vi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&xu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&xu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},lr=t=>t==null||t===""?zi:t instanceof Date?t.toISOString().slice(0,10):String(t),Wr=t=>JSON.stringify(t),wu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},fv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let o=Number(t);return Number.isFinite(o)?o:null}return null},xn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>fv(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},io=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},cr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),ku=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return cr(i,s)})},Wi=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),hl=t=>!t?.aggregations||t.aggregations.length===0?yu:t.aggregations,bo=(t,o)=>{let r=hl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},la=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Tu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(null),u=useMemo(()=>{let p=i.trim().toLowerCase();return p?t.filter(v=>v.toLowerCase().includes(p)):t},[t,i]),m=t.length>0&&o.length===t.length,f$1=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,h=p=>{r(o.includes(p)?o.filter(v=>v!==p):[...o,p]);};return g("div",{sx:{minWidth:n},onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:[f(Se,{variant:"outlined",size:"small",onClick:p=>d(p.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f$1}),f(Zt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:p=>p.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:p=>s(p.target.value),onKeyDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(Se,{variant:"text",size:"small",onClick:p=>{p.preventDefault(),p.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(p=>{let v=o.includes(p);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>h(p),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(p));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Tt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:p})]},p)})]})})]})};var Sn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Te,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${r}px)`,gridAutoRows:`${r}px`,gap:`${Math.max(2,Math.round(r/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:o?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>f(Te,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var bl=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>f(Ne,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(Sn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Iu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(bl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var wn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:u}=useDroppable({id:l}),{t:m}=de();return g(Ne,{ref:u,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(lt,{title:m("pivot.clearArea"),children:f(ne,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f($d,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:a})]})};var Mu={xs:1.2,md:1.6},kn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:u})=>g(Ne,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:m=>({px:Mu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,f(ne,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(Ja,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(on,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:Mu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var $i=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>f(Ne,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(Sn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&f(ne,{size:"small",onClick:u=>{u.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(xr,{size:13})})]})}),ca=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:u,isDragging:m}=useSortable({id:t}),f$1={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:u,zIndex:m?999:"auto"};return f($i,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:f$1})};var Ui={rows:f(op,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(Hd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(nn,{size:16,sx:{color:"var(--orb-accent)"}})},Ru=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:u,getFilterSelectionSummary:m,renderDimensionFilterSelect:f$1,renderAggregationSelect:h,getAggregationLabel:p})=>{let{t:v}=de(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return f(kn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:o,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(wn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:f(Sn,{size:18,subtle:true}),children:g(ae,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),r.map(g=>f(Iu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ae,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(wn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Ui.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:a.map(g=>f(ca,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:f$1(g),onRemove:()=>u("filters",g)},g))})})}),f(wn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Ui.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:i.map(g=>f(ca,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f$1(g),onRemove:()=>u("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(wn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Ui.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:s.map(g=>f(ca,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:f$1(g),onRemove:()=>u("rows",g)},g))})})}),f(wn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Ui.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${p(g.aggregation)}(${x})`;return f(ca,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:h(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Du=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Nu=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=ao();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},u=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f$1=Math.max(...u,1),h=Math.max(...m,1),p=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let b=r?g.primaryValue:x+1,C=r?g.secondaryValue??0:g.primaryValue,k=d.left+b/f$1*p,w=l-d.bottom-C/h*v;return {...g,x:k,y:w,rawX:b,rawY:C}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[f("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:No(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:No(i.palette.text.secondary,.35)}),y.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:No(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
|
|
13
|
+
`,r?`${o}: ${n(g$1.primaryValue)}`:`${o}: ${n(g$1.primaryValue)}`,r?`
|
|
14
|
+
${r}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g$1.name})]},g$1.name)),f("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),f("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Du(h)}),f("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Du(f$1)})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g$1=>g("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${No(x.palette.divider,.7)}`,bgcolor:No(x.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g$1.name,children:g$1.name}),g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",n(g$1.primaryValue)]}),r&&g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var vl=t=>Math.max(...t,1),Au=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=ao(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let b=vl(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return f(ae,{spacing:1.1,children:t.map(C=>g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),g(ae,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:No(s.palette.action.active,.08)},children:f("div",{sx:{width:`${C.primaryValue/b*100}%`,height:"100%",bgcolor:l}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:No(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(C.secondaryValue??0)/b*100}%`,height:"100%",bgcolor:d}})})]}),g("div",{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(o==="bar-vertical"){let b=vl(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),C=n?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${r}: ${a(k.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let u=Math.max(680,t.length*74),m=240,f$1={top:20,right:18,bottom:36,left:18},h=vl(t.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),p=u-f$1.left-f$1.right,v=m-f$1.top-f$1.bottom,y=b=>t.map((C,k)=>{let w=f$1.left+k*p/Math.max(t.length-1,1),P=m-f$1.bottom-b(C)/h*v;return {x:w,y:P,item:C}}),g$1=y(b=>b.primaryValue),x=n?y(b=>b.secondaryValue??0):[];return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${u} ${m}`,sx:{width:"100%",minWidth:u,height:m},children:[f("line",{x1:f$1.left,y1:m-f$1.bottom,x2:u-f$1.right,y2:m-f$1.bottom,stroke:No(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g$1.map(b=>`${b.x},${b.y}`).join(" ")}),g$1.map(b=>f("circle",{cx:b.x,cy:b.y,r:4,fill:l,children:g("title",{children:[b.item.name,`
|
|
15
|
+
`,r,": ",a(b.item.primaryValue)]})},`primary-${b.item.name}`)),n&&g(e,{children:[f("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(b=>`${b.x},${b.y}`).join(" ")}),x.map(b=>f("circle",{cx:b.x,cy:b.y,r:3.5,fill:d,children:g("title",{children:[b.item.name,`
|
|
16
|
+
`,n,": ",(i??a)(b.item.secondaryValue??0)]})},`secondary-${b.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(b=>g("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${No(C.palette.divider,.7)}`,bgcolor:No(C.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(b.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]},b.name))})]})};var Eu=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},Lu=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Ou=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=lr(i[o]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:xn(s,r.fieldId,r.aggregation),secondaryValue:n?xn(s,n.fieldId,n.aggregation):void 0}))};var Fu=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:u,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:f$1,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:p,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g$1}=de(),x=useMemo(()=>Eu(r,n,o),[n,o,r]),b=useMemo(()=>Lu(a,o,y),[o,y,a]),C=b.find(T=>T.fieldId===s)??b[0],k=b.find(T=>T.fieldId===l&&T.fieldId!==C?.fieldId)??null,w=x.find(T=>T.fieldId===i)??x[0],P=w&&C?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${C.label} / ${k.label}`:C.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!C?[]:Ou({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:k?.item}),[C,t,k,w]),S=T=>C?la(T,C.item,o):T.toLocaleString(),N=T=>k?la(T,k.item,o):T.toLocaleString(),R=x.length>1||b.length>1;return g(kn,{title:g$1("pivot.chart.title"),subtitle:P,collapsed:u,onToggleCollapse:v,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(Ht,{value:w?.fieldId??"",onChange:T=>m(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(Ht,{value:C?.fieldId??"",onChange:T=>f$1(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(Ht,{value:k?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),b.filter(T=>T.fieldId!==C?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(Ht,{value:d,onChange:T=>p(T.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:w?C?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Nu,{data:I,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:N}):f(Au,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:N}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var Ki=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,u=t.isGrandTotal,m=d&&!l&&!u,f$1=u?800:m?700:d?600:500,h=u?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:u?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:u?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:f$1},sx:p=>({fontSize:"0.76rem",borderBottom:`1px solid ${p.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!u&&f(ne,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(zo,{size:12}):f(Sr,{size:12})}),!d&&!u&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(p=>f("td",{align:"right",style:{fontWeight:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:la(s?s(t,p.id):t.aggregatedValues[p.id]??0,p.valueItem,r)},`${t.key}-${p.id}`))]}),l&&t.children.map(p=>f(Ki,{node:p,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},p.key))]})};var Cl=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Xi=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",xl=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",Hu=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},zu=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,zu(a.children,o,r+1)),r),Tv=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},ML=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:u,enablePresetManagement:m=false,presets:f$1,defaultPresets:h,onPresetsChange:p,initialPresetId:v,onPresetApplied:y})=>{let{t:g$1}=de(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),C=useRef(false),k=t??g$1("pivot.title.default"),w=i??g$1("pivot.empty"),P=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),I=useCallback(M=>P[M]??vu[M],[P]),S=useMemo(()=>new Set(r.map(M=>M.id)),[r]),N=useMemo(()=>new Map(r.map(M=>[M.id,M])),[r]),[R,T]=useState(()=>io(n?.rows,S)),[D,A]=useState(()=>io(n?.columns,S)),[L,O]=useState(()=>io(n?.filters,S)),[Y,H]=useState(()=>{let M=n?.values??[],$=new Set,_=[];return M.forEach(ce=>{if(!S.has(ce.fieldId)||$.has(ce.fieldId))return;$.add(ce.fieldId),b$1.current+=1;let Be=N.get(ce.fieldId);_.push({tokenId:`v${b$1.current}`,fieldId:ce.fieldId,aggregation:bo(ce.aggregation,Be)});}),_}),[q,V]=useState({}),[Z,z]=useState(true),[B,G]=useState(false),[U,ge]=useState(()=>Cl(io(n?.rows,S),io(n?.columns,S),a?.dimensionFieldId)),[ie,pe]=useState(()=>{let M=(n?.values??[]).filter(($,_,ce)=>S.has($.fieldId)&&ce.findIndex(Be=>Be.fieldId===$.fieldId)===_).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:bo($.aggregation,N.get($.fieldId))}));return Xi(M,a?.primaryValueFieldId)}),[xe,We]=useState(()=>{let M=(n?.values??[]).filter((_,ce,Be)=>S.has(_.fieldId)&&Be.findIndex(ot=>ot.fieldId===_.fieldId)===ce).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:bo(_.aggregation,N.get(_.fieldId))})),$=Xi(M,a?.primaryValueFieldId);return xl(M,$,a?.secondaryValueFieldId)}),[we,se]=useState(a?.chartType??"bar-vertical"),[Ae,Ie]=useState(l),[ke,ze]=useState(d),[et,rt]=useState(()=>h??[]),[at,K]=useState(""),[Re,ve]=useState(false),[Fe,nt]=useState(""),[Ye,xt]=useState(null),[It,Lt]=useState(new Set(["__grand_total__"])),[Nt,te]=useState(new Set),Ge=u?.rowFields??R,Oe=u?.columnFields??D,le=u?.filterFields??L,be=u?.valueFields??Y,ee=u?.filterSelections??q,he=u?.showGrandTotal??Z,De=u?.isConfiguratorCollapsed??B,je=u?.chartDimensionFieldId??U,it=u?.chartPrimaryValueFieldId??ie,dt=u?.chartSecondaryValueFieldId??xe,Ft=u?.chartType??we,Kt=u?.isChartCollapsed??Ae,zt=u?.isTableCollapsed??ke,St=f$1??et,Vt=m||St.length>0||!!p,ht=useCallback(M=>{if(u?.setRowFields){u.setRowFields(M);return}T(M);},[u]),Dt=useCallback(M=>{if(u?.setColumnFields){u.setColumnFields(M);return}A(M);},[u]),st=useCallback(M=>{if(u?.setFilterFields){u.setFilterFields(M);return}O(M);},[u]),Ot=useCallback(M=>{if(u?.setValueFields){u.setValueFields(M);return}H(M);},[u]),qt=useCallback(M=>{if(u?.setFilterSelections){u.setFilterSelections(M);return}V(M);},[u]),X=useCallback(M=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(M);return}z(M);},[u]),W=useCallback(M=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(M);return}G(M);},[u]),Q=useCallback(M=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(M);return}ge(M);},[u]),fe=useCallback(M=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(M);return}pe(M);},[u]),ye=useCallback(M=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(M);return}We(M);},[u]),Ee=useCallback(M=>{if(u?.setChartType){u.setChartType(M);return}se(M);},[u]),$e=useCallback(M=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(M);return}Ie(M);},[u]),Ke=useCallback(M=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(M);return}ze(M);},[u]),Ze=useCallback(M=>{let $=typeof M=="function"?M(St):M;f$1||rt($),p?.($);},[p,St,f$1]),ut=useMemo(()=>new Set([...Ge,...Oe,...le]),[Ge,Oe,le]),gt=useMemo(()=>r.filter(M=>!ut.has(M.id)),[r,ut]),Mt=useMemo(()=>{let M=[...Ge,...Oe,...le],$=new Set,_=[];return M.forEach(ce=>{$.has(ce)||($.add(ce),_.push(ce));}),_},[Oe,le,Ge]);useEffect(()=>{ht(M=>{let $=M.filter(_=>S.has(_));return cr(M,$)?M:$}),Dt(M=>{let $=M.filter(_=>S.has(_));return cr(M,$)?M:$}),st(M=>{let $=M.filter(_=>S.has(_));return cr(M,$)?M:$}),Ot(M=>{let $=M.filter(_=>S.has(_.fieldId)).map(_=>({..._,aggregation:bo(_.aggregation,N.get(_.fieldId))}));return Wi(M,$)?M:$});},[N,S]);let bt=useMemo(()=>{let M={};return Mt.forEach($=>{let _=new Set;o.forEach(ce=>{_.add(lr(ce[$]));}),M[$]=Array.from(_).sort((ce,Be)=>ce.localeCompare(Be));}),M},[Mt,o]);useEffect(()=>{qt(M=>{let $={};return Mt.forEach(_=>{let ce=bt[_]??[],ot=(M[_]??[]).filter(oe=>ce.includes(oe)),_e=Object.prototype.hasOwnProperty.call(M,_);$[_]=_e?ot:ce;}),ku(M,$)?M:$});},[Mt,bt]),useEffect(()=>{Q(M=>Cl(Ge,Oe,M));},[Oe,Ge,Q]),useEffect(()=>{fe(M=>Xi(be,M));},[fe,be]),useEffect(()=>{ye(M=>xl(be,it,M));},[it,ye,be]);let F=useMemo(()=>o.filter(M=>Mt.every($=>{let _=ee[$]??[],ce=bt[$]??[];if(_.length===ce.length)return true;if(_.length===0)return false;let Be=lr(M[$]);return _.includes(Be)})),[Mt,bt,ee,o]),j=useMemo(()=>{if(be.length===0)return null;let M=new Map;if(F.forEach(_e=>{let oe=Oe.length>0?Oe.map(J=>lr(_e[J])):[g$1("pivot.valueLabel")],ue=Wr(oe);M.set(ue,oe);}),M.size===0){let _e=Oe.length>0?Oe.map(()=>zi):[g$1("pivot.valueLabel")];M.set(Wr(_e),_e);}let $=Array.from(M.entries()).sort((_e,oe)=>wu(_e[1],oe[1])),_=$.flatMap(([_e,oe])=>be.map(ue=>{let J=N.get(ue.fieldId),Le=`${I(ue.aggregation)} ${J?.label??ue.fieldId}`,Qe=Oe.length===0||be.length>1?`${oe.join(" / ")} \u2022 ${Le}`:oe.join(" / ");return {id:`${_e}::${ue.tokenId}`,colKey:_e,valueItem:ue,label:Qe}})),ce=[];Oe.length>0&&$.forEach(([_e,oe])=>{let ue=_.filter(Qe=>Qe.colKey===_e),J=ce,Le=[];oe.forEach((Qe,Me)=>{Le.push(`d${Me}:${Qe}`);let Xe=`col::${Wr(Le)}`,kt=J.find(Zr=>Zr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Me+1),depth:Me},J.push(kt)),ue.forEach(Zr=>{kt.leafColumnIds.includes(Zr.id)||kt.leafColumnIds.push(Zr.id);}),J=kt.children;});});let Be=_e=>{let oe={};return _.forEach(ue=>{let J=_e.filter(Le=>{let Qe=Oe.length>0?Oe.map(Me=>lr(Le[Me])):[g$1("pivot.valueLabel")];return Wr(Qe)===ue.colKey});oe[ue.id]=xn(J,ue.valueItem.fieldId,ue.valueItem.aggregation);}),oe},ot=[];if(Ge.length===0)ot.push({key:"root",value:g$1("pivot.resultLabel")||hu,children:[],isLeaf:true,aggregatedValues:Be(F),path:[],depth:0});else {let _e=(oe,ue,J)=>{if(ue>=Ge.length)return [];let Le=Ge[ue],Qe=new Map;return oe.forEach(Me=>{let Xe=lr(Me[Le]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),kt=[...J,Me];return {key:Wr(kt),value:Me,fieldId:Le,aggregatedValues:Be(Xe),children:_e(Xe,ue+1,kt),isLeaf:ue===Ge.length-1,path:kt,depth:ue}})};ot.push(..._e(F,0,[]));}return {dataColumns:_,columnTree:ce,rowTree:ot}},[Oe,N,F,I,Ge,g$1,be]),me=useCallback((M,$)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:M,aggregation:bo($,N.get(M))}),[N]),Pe=useCallback(M=>{if(M==="rows")return ht([]);if(M==="columns")return Dt([]);if(M==="filters")return st([]);Ot([]);},[]),Je=useCallback((M,$)=>{if(M==="rows")return ht(_=>_.filter(ce=>ce!==$));if(M==="columns")return Dt(_=>_.filter(ce=>ce!==$));if(M==="filters")return st(_=>_.filter(ce=>ce!==$));Ot(_=>_.filter(ce=>ce.tokenId!==$));},[]),qe=useCallback((M,$)=>{Ot(_=>_.map(ce=>ce.tokenId===M?{...ce,aggregation:bo($,N.get(ce.fieldId))}:ce));},[N]),wt=useCallback(M=>{xt(String(M.active.id));},[]),ft=useCallback(M=>{if(xt(null),!M.over)return;let $=Vi(String(M.active.id)),_=Vi(String(M.over.id));if(!$||!_||$.kind!=="item"||!$.key)return;if($.zone===_.zone&&_.kind==="item"){if($.zone==="rows"){let Me=Ge.indexOf($.key),Xe=Ge.indexOf(_.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&ht(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="columns"){let Me=Oe.indexOf($.key),Xe=Oe.indexOf(_.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Dt(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="filters"){let Me=le.indexOf($.key),Xe=le.indexOf(_.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&st(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="values"){let Me=be.findIndex(kt=>kt.tokenId===$.key),Xe=be.findIndex(kt=>kt.tokenId===(_.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ot(kt=>arrayMove(kt,Me,Xe));}return}let ce=_.zone,Be=[...Ge],ot=[...Oe],_e=[...le],oe=[...be],ue="",J=null;if($.zone==="palette")ue=$.key;else if($.zone==="values"){let Me=oe.find(Xe=>Xe.tokenId===$.key);if(!Me)return;ue=Me.fieldId,J=Me,oe=oe.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(ue=$.key,Be=Be.filter(Me=>Me!==ue)):$.zone==="columns"?(ue=$.key,ot=ot.filter(Me=>Me!==ue)):$.zone==="filters"&&(ue=$.key,_e=_e.filter(Me=>Me!==ue));if(!ue)return;let Le=()=>{Be=Be.filter(Me=>Me!==ue),ot=ot.filter(Me=>Me!==ue),_e=_e.filter(Me=>Me!==ue);},Qe=Me=>{if(_.kind!=="item"||!_.key)return Me==="rows"?Be.length:Me==="columns"?ot.length:Me==="filters"?_e.length:Me==="values"?oe.length:0;if(Me==="rows"){let Xe=Be.indexOf(_.key);return Xe>=0?Xe:Be.length}if(Me==="columns"){let Xe=ot.indexOf(_.key);return Xe>=0?Xe:ot.length}if(Me==="filters"){let Xe=_e.indexOf(_.key);return Xe>=0?Xe:_e.length}if(Me==="values"){let Xe=oe.findIndex(kt=>kt.tokenId===_.key);return Xe>=0?Xe:oe.length}return 0};if(ce==="palette"){ht(Be),Dt(ot),st(_e),Ot(oe);return}if(ce==="values"){let Me=Qe("values"),Xe=J??me(ue);oe.splice(Me,0,Xe),ht(Be),Dt(ot),st(_e),Ot(oe);return}if(Su(ce)){Le();let Me=Qe(ce);ce==="rows"?Be.splice(Me,0,ue):ce==="columns"?ot.splice(Me,0,ue):_e.splice(Me,0,ue),ht(Be),Dt(ot),st(_e),Ot(oe);}},[Oe,me,le,Ge,be]),mt=useCallback((M,$)=>{qt(_=>({..._,[M]:$}));},[]),yt=useCallback(M=>{Lt($=>{let _=new Set($);return _.has(M)?_.delete(M):_.add(M),_});},[]),oo=useCallback(M=>{te($=>{let _=new Set($);return _.has(M)?_.delete(M):_.add(M),_});},[]),At=useCallback(M=>{let $=N.get(M.fieldId),_=hl($);return f(vr,{size:"small",sx:{minWidth:98},children:f(Ht,{value:M.aggregation,onChange:ce=>qe(M.tokenId,ce.target.value),onClick:ce=>ce.stopPropagation(),onMouseDown:ce=>ce.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:_.map(ce=>f("option",{value:ce,sx:{fontSize:"0.75rem"},children:I(ce)},ce))})})},[N,I,qe]),Xt=useCallback(M=>{let $=bt[M]??[],_=ee[M]??$;return $.length===0?g$1("pivot.filter.noValues"):_.length===0?g$1("pivot.filter.noneSelected"):_.length===$.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:_.length,total:$.length})},[bt,ee,g$1]),Bt=useCallback(M=>{let $=bt[M]??[],_=ee[M]??$;return f(Tu,{options:$,selectedValues:_,onChange:ce=>mt(M,ce)})},[bt,ee,mt]),Gt=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=useCallback(()=>{let M={};return new Set([...Mt,...Object.keys(ee)]).forEach(_=>{if(!S.has(_))return;let ce=ee[_]??[];M[_]=[...ce];}),{layout:{rows:[...Ge],columns:[...Oe],filters:[...le],values:be.map(_=>({fieldId:_.fieldId,aggregation:_.aggregation}))},filterSelections:M,showGrandTotal:he,chart:{dimensionFieldId:je,primaryValueFieldId:it,secondaryValueFieldId:dt,chartType:Ft}}},[Mt,je,it,dt,Ft,Oe,le,ee,Ge,he,S,be]),eo=useCallback(M=>{let $=io(M.layout.rows,S),_=io(M.layout.columns,S),ce=io(M.layout.filters,S),Be=new Set,ot=(M.layout.values??[]).filter(ue=>!S.has(ue.fieldId)||Be.has(ue.fieldId)?false:(Be.add(ue.fieldId),true)).map(ue=>me(ue.fieldId,ue.aggregation)),_e={};Object.entries(M.filterSelections??{}).forEach(([ue,J])=>{!S.has(ue)||!Array.isArray(J)||(_e[ue]=Array.from(new Set(J.map(Le=>String(Le)))));}),ht($),Dt(_),st(ce),Ot(ot),qt(_e),typeof M.showGrandTotal=="boolean"&&X(M.showGrandTotal),Q(Cl($,_,M.chart?.dimensionFieldId));let oe=Xi(ot,M.chart?.primaryValueFieldId);fe(oe),ye(xl(ot,oe,M.chart?.secondaryValueFieldId)),Ee(M.chart?.chartType??"bar-vertical"),K(M.id),y?.(M);},[me,y,Q,fe,ye,Ee,Dt,st,qt,ht,X,Ot,S]),ro=useCallback(M=>{if(!M){K("");return}let $=St.find(_=>_.id===M);if(!$){K("");return}eo($);},[eo,St]),go=useCallback(()=>{let M=g$1("pivot.preset.defaultName",{index:St.length+1});nt(M),ve(true);},[St.length,g$1]),To=useCallback(()=>{let M=Fe.trim();if(!M)return;let $={id:Gt(),name:M,...Wt()};Ze(_=>[..._,$]),K($.id),ve(false);},[Wt,Gt,Fe,Ze]),Io=useCallback(()=>{at&&(Ze(M=>M.filter($=>$.id!==at)),K(""));},[at,Ze]);useEffect(()=>{if(!v||C.current)return;let M=St.find($=>$.id===v);M&&(C.current=true,eo(M));},[eo,v,St]),useEffect(()=>{at&&(St.some(M=>M.id===at)||K(""));},[at,St]);let or=useMemo(()=>{if(!he||!j||!Ge.length)return null;let M={};return j.dataColumns.forEach($=>{let _=F.filter(ce=>{let Be=Oe.length>0?Oe.map(ot=>lr(ce[ot])):[g$1("pivot.valueLabel")];return Wr(Be)===$.colKey});M[$.id]=xn(_,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||bu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:M,path:[],depth:-1}},[he,j,F,Oe,Ge.length,g$1]),vo=useMemo(()=>Hu(j?.rowTree??[]),[j]),Lo=useMemo(()=>Hu(j?.columnTree??[]),[j]);useEffect(()=>{Lt(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),vo.forEach(_=>{M.has(_)&&$.add(_);}),$});},[vo]),useEffect(()=>{te(M=>{let $=new Set;return Lo.forEach(_=>{M.has(_)&&$.add(_);}),$});},[Lo]);let Ur=useCallback(()=>{Lt(M=>{let $=new Set(M);return vo.forEach(_=>$.add(_)),$});},[vo]),Kr=useCallback(()=>{Lt(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Ar=useCallback(()=>{te(new Set(Lo));},[Lo]),qr=useCallback(()=>{te(new Set);},[]),Xr=useMemo(()=>!j||Oe.length===0?[]:Tv(j.columnTree,Nt),[Oe.length,Nt,j]),Mo=useMemo(()=>{if(!j)return [];if(Oe.length===0)return j.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let M=new Map(j.dataColumns.map($=>[$.id,$]));return Xr.flatMap($=>{let _=new Map;return $.leafColumnIds.forEach(ce=>{let Be=M.get(ce);if(!Be)return;let ot=Be.valueItem.tokenId,_e=`${I(Be.valueItem.aggregation)} ${N.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,oe=_.get(ot);if(oe){oe.leafColumnIds.push(ce);return}_.set(ot,{id:`${$.key}::${ot}`,label:be.length>1?_e:$.label,leafColumnIds:[ce],valueItem:Be.valueItem});}),Array.from(_.values())})},[Oe.length,N,I,j,be.length,Xr]),Er=useMemo(()=>new Map(Mo.map(M=>[M.id,M])),[Mo]),Yr=useMemo(()=>Mo.map(M=>({id:M.id,colKey:M.id,valueItem:M.valueItem,label:M.label})),[Mo]),Uo=useMemo(()=>{if(!j||Oe.length===0)return [];let M=[],$=zu(j.columnTree,Nt),_=$+(be.length>1?1:0),ce=(Be,ot)=>{M[ot]??(M[ot]=[]),Be.forEach(_e=>{let oe=_e.children.length>0&&Nt.has(_e.key),ue=Mo.filter(Le=>_e.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,J=oe||be.length>1?1:_-ot;M[ot].push({key:_e.key,label:_e.label,colSpan:ue,rowSpan:J,expandable:_e.children.length>0,expanded:oe}),oe&&ce(_e.children,ot+1);});};return ce(j.columnTree,0),be.length>1&&(M[$]=Mo.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),M},[Oe.length,Nt,j,be.length,Mo]),rr=useCallback((M,$)=>$.leafColumnIds.reduce((_,ce)=>_+(M.aggregatedValues[ce]??0),0),[]),Nn=useMemo(()=>g(e,{children:[f(Se,{size:"small",variant:"text",onClick:Ur,disabled:vo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Se,{size:"small",variant:"text",onClick:Kr,disabled:vo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Rt,{orientation:"vertical",flexItem:true}),f(Se,{size:"small",variant:"text",onClick:Ar,disabled:Lo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Se,{size:"small",variant:"text",onClick:qr,disabled:Oe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Oe.length,Lo.size,vo.size,qr,Kr,Ar,Ur,g$1]),Lr=()=>{if(!Ye)return null;let M=Vi(Ye);if(!M||M.kind!=="item"||!M.key)return null;if(M.zone==="palette"){let Be=N.get(M.key);return Be?f(bl,{label:Be.label,subtitle:Be.type}):null}if(M.zone==="values"){let Be=be.find(ue=>ue.tokenId===M.key);if(!Be)return null;let _e=N.get(Be.fieldId)?.label??Be.fieldId,oe=`${I(Be.aggregation)}(${_e})`;return f($i,{label:_e,caption:oe})}let _=N.get(M.key)?.label??M.key,ce=Xt(M.key);return f($i,{label:_,caption:ce})};return g(Ne,{sx:M=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${M.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[Vt&&g(e,{children:[f(vr,{size:"small",sx:{minWidth:200},children:g(Ht,{value:at,displayEmpty:true,onChange:M=>ro(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),St.map(M=>f("option",{value:M.id,sx:{fontSize:"0.75rem"},children:M.name},M.id))]})}),f(lt,{title:g$1("pivot.preset.save"),children:f(ne,{size:"small",onClick:go,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(wr,{size:15})})}),f(lt,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ne,{size:"small",onClick:Io,disabled:!at,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ja,{size:15})})})}),f(Rt,{flexItem:true,orientation:"vertical"})]}),g(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Rt,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(Xa,{size:"small",checked:he,onChange:M=>X(M.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:wt,onDragEnd:ft,children:[f(Ru,{isConfiguratorCollapsed:De,onToggleCollapse:()=>W(M=>!M),availableFields:gt,fieldMap:N,filterFields:le,columnFields:Oe,rowFields:Ge,valueFields:be,clearZone:Pe,removeFieldFromZone:Je,getFilterSelectionSummary:Xt,renderDimensionFilterSelect:Bt,renderAggregationSelect:At,getAggregationLabel:I}),f(fd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lr()})})]}),f(Fu,{rows:F,fieldMap:N,rowFields:Ge,columnFields:Oe,valueFields:be,chartDimensionFieldId:je,chartPrimaryValueFieldId:it,chartSecondaryValueFieldId:dt,chartType:Ft,isCollapsed:Kt,onChartDimensionFieldIdChange:M=>Q(M),onChartPrimaryValueFieldIdChange:M=>fe(M),onChartSecondaryValueFieldIdChange:M=>ye(M),onChartTypeChange:M=>Ee(M),onToggleCollapse:()=>$e(M=>!M),getAggregationLabel:I}),f(kn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ge.length>0?Ge.map(M=>N.get(M)?.label??M).join(" > "):g$1("pivot.table.dimensions"),collapsed:zt,onToggleCollapse:()=>Ke(M=>!M),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Nn,children:j===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Uo.length>0?Uo:[[]]).map((M,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Uo.length,1),sx:_=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${_.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ge.length>0?Ge.map(_=>N.get(_)?.label).join(" > "):g$1("pivot.table.dimensions")}),(M.length>0?M:Mo.map(_=>({key:_.id,label:_.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(_=>f("td",{align:"center",colSpan:_.colSpan,rowSpan:_.rowSpan,sx:ce=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ce.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[_.expandable&&f(ne,{size:"small",onClick:()=>oo(_.key),sx:{width:22,height:22,p:0,ml:-0.2},children:_.expanded?f(zo,{size:12}):f(Sr,{size:12})}),f("div",{component:"span",children:_.label})]})},_.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[j.rowTree.map(M=>f(Ki,{node:M,dataColumns:Yr,fieldMap:N,level:0,expandedKeys:It,onToggle:yt,getValue:($,_)=>{let ce=Er.get(_);return ce?rr($,ce):0}},M.key)),or&&f(Ki,{node:or,dataColumns:Yr,fieldMap:N,level:0,expandedKeys:It,onToggle:yt,getValue:(M,$)=>{let _=Er.get($);return _?rr(M,_):0}})]})]})})}),g(Et,{open:Re,onClose:()=>ve(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(He,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Fe,onChange:M=>nt(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),To());}})}),g("div",{className:"orb-dialog-actions",children:[f(Se,{onClick:()=>ve(false),children:g$1("common.cancel")}),f(Se,{variant:"contained",onClick:To,disabled:!Fe.trim(),children:g$1("common.save")})]})]})]})};var Vu=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},wl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Wu=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",EL=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),u=useMemo(()=>new Set(t.map(K=>K.id)),[t]),m=useMemo(()=>new Map(t.map(K=>[K.id,K])),[t]),[f,h]=useState(()=>io(o?.rows,u)),[p,v]=useState(()=>io(o?.columns,u)),[y,g]=useState(()=>io(o?.filters,u)),[x,b]=useState(()=>{let K=o?.values??[],Re=new Set,ve=[];return K.forEach(Fe=>{!u.has(Fe.fieldId)||Re.has(Fe.fieldId)||(Re.add(Fe.fieldId),d.current+=1,ve.push({tokenId:`v${d.current}`,fieldId:Fe.fieldId,aggregation:bo(Fe.aggregation,m.get(Fe.fieldId))}));}),ve}),[C,k]=useState(r),[w,P]=useState(n),[I,S]=useState(a),[N,R]=useState(()=>Vu(io(o?.rows,u),io(o?.columns,u),i?.dimensionFieldId)),[T,D]=useState(()=>{let K=(()=>{let Re=o?.values??[],ve=new Set,Fe=[];return Re.forEach(nt=>{!u.has(nt.fieldId)||ve.has(nt.fieldId)||(ve.add(nt.fieldId),Fe.push({tokenId:nt.fieldId,fieldId:nt.fieldId,aggregation:bo(nt.aggregation,m.get(nt.fieldId))}));}),Fe})();return wl(K,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let K=(()=>{let ve=o?.values??[],Fe=new Set,nt=[];return ve.forEach(Ye=>{!u.has(Ye.fieldId)||Fe.has(Ye.fieldId)||(Fe.add(Ye.fieldId),nt.push({tokenId:Ye.fieldId,fieldId:Ye.fieldId,aggregation:bo(Ye.aggregation,m.get(Ye.fieldId))}));}),nt})(),Re=wl(K,i?.primaryValueFieldId);return Wu(K,Re,i?.secondaryValueFieldId)}),[O,Y]=useState(i?.chartType??"bar-vertical"),[H,q]=useState(s),[V,Z]=useState(l);useEffect(()=>{h(K=>{let Re=K.filter(ve=>u.has(ve));return cr(K,Re)?K:Re}),v(K=>{let Re=K.filter(ve=>u.has(ve));return cr(K,Re)?K:Re}),g(K=>{let Re=K.filter(ve=>u.has(ve));return cr(K,Re)?K:Re}),b(K=>{let Re=K.filter(ve=>u.has(ve.fieldId)).map(ve=>({...ve,aggregation:bo(ve.aggregation,m.get(ve.fieldId))}));return Wi(K,Re)?K:Re});},[m,u]),useEffect(()=>{R(K=>Vu(f,p,K));},[p,f]),useEffect(()=>{D(K=>wl(x,K));},[x]),useEffect(()=>{L(K=>Wu(x,T,K));},[T,x]);let z=useCallback(K=>{h(io(K,u));},[u]),B=useCallback(K=>{v(io(K,u));},[u]),G=useCallback(K=>{g(io(K,u));},[u]),U=useCallback(K=>{b(Re=>{let ve=K??[],Fe=new Set,nt=[];return ve.forEach(Ye=>{if(!u.has(Ye.fieldId)||Fe.has(Ye.fieldId))return;Fe.add(Ye.fieldId);let xt=Re.find(It=>It.fieldId===Ye.fieldId);if(xt){nt.push({...xt,aggregation:bo(Ye.aggregation??xt.aggregation,m.get(Ye.fieldId))});return}d.current+=1,nt.push({tokenId:`v${d.current}`,fieldId:Ye.fieldId,aggregation:bo(Ye.aggregation,m.get(Ye.fieldId))});}),nt});},[m,u]),ge=useCallback(K=>{z(K.rows??[]),B(K.columns??[]),G(K.filters??[]),U(K.values??[]);},[B,G,z,U]),ie=useCallback(K=>{if(K==="rows")return h([]);if(K==="columns")return v([]);if(K==="filters")return g([]);b([]);},[]),pe=useCallback((K,Re)=>{if(K==="rows")return h(ve=>ve.filter(Fe=>Fe!==Re));if(K==="columns")return v(ve=>ve.filter(Fe=>Fe!==Re));if(K==="filters")return g(ve=>ve.filter(Fe=>Fe!==Re));b(ve=>ve.filter(Fe=>Fe.tokenId!==Re));},[]),xe=useCallback((K,Re)=>{b(ve=>ve.map(Fe=>Fe.tokenId===K?{...Fe,aggregation:bo(Re,m.get(Fe.fieldId))}:Fe));},[m]),We=useCallback((K,Re)=>{k(ve=>({...ve,[K]:Re}));},[]),we=useCallback(()=>{k({});},[]),se=useCallback(()=>{P(K=>!K);},[]),Ae=useCallback(()=>{S(K=>!K);},[]),Ie=useCallback(K=>{R(K);},[]),ke=useCallback(K=>{D(K);},[]),ze=useCallback(K=>{L(K);},[]),et=useCallback(()=>{q(K=>!K);},[]),rt=useCallback(()=>{Z(K=>!K);},[]);return {model:useMemo(()=>({rowFields:f,setRowFields:h,columnFields:p,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:C,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:P,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:N,setChartDimensionFieldId:R,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:O,setChartType:Y,isChartCollapsed:H,setIsChartCollapsed:q,isTableCollapsed:V,setIsTableCollapsed:Z}),[N,T,A,O,p,y,C,H,I,V,f,w,x]),actions:{setRows:z,setColumns:B,setFilters:G,setValues:U,setLayout:ge,clearZone:ie,removeFieldFromZone:pe,setAggregationForValue:xe,setFilterSelection:We,resetFilterSelections:we,toggleGrandTotal:se,toggleConfigurator:Ae,setChartDimension:Ie,setChartPrimaryValue:ke,setChartSecondaryValue:ze,setChartType:Y,toggleChart:et,toggleTable:rt}}};var BL=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=ao(),a=yr("(orientation: portrait)"),i=yr(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=useState(o??s==="landscape");useEffect(()=>{d(o??s==="landscape");},[o,s]);let u=f=>{d(f),r?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:u,toggleNavigationOpen:()=>u(!l)}};var Av=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},VL=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=useState(n??i),d=useMemo(()=>t.find(p=>p[o]===s)||t[0],[o,t,s]),[u,m]=useState(()=>{let p=d?.[r];return p==null?"0":String(p)});return {selectedId:s,selectedRecord:d,editorValue:u,setEditorValue:m,selectRecord:p=>{let v=p[o];l(v);let y=p[r];m(y==null?"0":String(y));},applyEditorValue:p=>{if(s===void 0)return;let v=Av(u),y=t.map(g=>g[o]===s?{...g,[r]:v}:g);p(y);}}};var Ev=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],_u=(t,o,r,n)=>{o?.(t),n&&r?.();},KL=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Ev,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:u="Use code",cancelLabel:m="Close",manualPlaceholder:f$1="Enter barcode manually",onDetected:h,onError:p,sx:v})=>{let y=jt__default.useRef(null),g$1=jt__default.useRef(null),x=jt__default.useRef(null),b$1=jt__default.useRef(null),[C,k]=jt__default.useState("idle"),[w,P]=jt__default.useState(""),[I,S]=jt__default.useState(null),[N,R]=jt__default.useState(null),T=jt__default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),y.current&&(y.current.srcObject=null);},[]),D=jt__default.useCallback(L=>{R(L),k("error"),p?.(L);},[p]);jt__default.useEffect(()=>{if(!t){T(),k("idle"),R(null),P("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),R("Camera access is not supported in this browser.");return}k("starting"),R(null);try{let Y=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){Y.getTracks().forEach(H=>H.stop());return}if(g$1.current=Y,y.current&&(y.current.srcObject=Y,await y.current.play()),!window.BarcodeDetector){k("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b$1.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!b$1.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let q=(await b$1.current.detect(y.current)).find(Z=>Z.rawValue);if(!q?.rawValue)return;let V={rawValue:q.rawValue,format:q.format};S(V),T(),_u(V,h,o,l);}catch(H){D(H instanceof Error?H.message:"Failed to detect barcode.");}},d);}catch(Y){D(Y instanceof Error?Y.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,o,h,t,D,d,T]);let A=()=>{let L=w.trim();if(!L)return;let O={rawValue:L,format:"manual"};S(O),_u(O,h,o,l);};return g(Et,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(ae,{spacing:2,sx:v,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Ne,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(Ct,{icon:f(Md,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),I?f(Ct,{icon:f(qd,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),N?f(Zo,{severity:C==="unsupported"?"info":"warning",children:N}):null,s?g(ae,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:f$1,value:w,onChange:L=>P(L.target.value)}),f(Se,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Se,{onClick:o,children:m})})]})};var Lv={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},JL=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:u=false,isDragging:m=false,swipeThreshold:f$1=88,startAction:h,endAction:p,dragHandleProps:v,onClick:y,onSwipe:g$1,sx:x})=>{let[b$1,C]=useState(0),[k,w]=useState(false),P=useRef(null),I=useRef(0),S=useRef(0),N=!!(h||p),R=132,T=()=>{C(0),w(false),P.current=null,I.current=0,S.current=0;},D=H=>{(H==="start"?h:p)?.onTrigger?.(),g$1?.(H),T();},A=H=>{!N||H.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=H.pointerId,I.current=H.clientX,S.current=H.clientX,w(true),H.currentTarget.setPointerCapture(H.pointerId));},L=H=>{if(!k||P.current!==H.pointerId)return;S.current=H.clientX;let q=S.current-I.current,V=Math.max(-R,Math.min(R,q));C(V);},O=H=>{if(!k||P.current!==H.pointerId)return;let q=S.current-I.current;if(q>=f$1&&h){D("start");return}if(q<=-f$1&&p){D("end");return}Math.abs(q)<12&&y?.(),T();},Y=(H,q)=>{if(!H)return null;let V=H.backgroundColor||Lv[H.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[q]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:q==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${V}, rgba(15,23,42,0.92))`},children:g(ae,{direction:"row",spacing:1,alignItems:"center",children:[H.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:H.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[Y(h,"left"),Y(p,"right"),f(Ne,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:O,onPointerCancel:T,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${b$1}px, 0, 0) scale(${m?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:m?.9:1},children:g(ae,{spacing:1.5,children:[g(ae,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[r?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),u?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ne,{size:"small",children:f(Fd,{})})}):null]}),a.length>0?f(ae,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((H,q)=>f(Ct,{label:H,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},q))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(H=>g(Ne,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:H.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:H.value})]},H.id))}):null,l,s]})})]})};var da=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.palette.primary.main:r==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:r==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),sO=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:u,backspaceLabel:m,onChange:f$1,onSubmit:h,onClose:p,sx:v})=>{let{t:y}=de(),[g$1,x]=useState(o),b=t??g$1,C=T=>{t===void 0&&x(T),f$1?.(T);},k=T=>{l&&b.length>=l||C(`${b}${T}`);},w=T=>{if(T==="00"){if(!b){C("0");return}k("00");return}k(T);},P=()=>{!i||b.includes(".")||C(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){C(b.slice(1));return}C(b?`-${b}`:"-");}},S=()=>{C(b.slice(0,-1));},N=()=>{C("");},R=()=>{h?.(b);};return f(Ne,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ae,{spacing:2,children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),p?f(ne,{onClick:p,size:"small",children:f(Ld,{})}):null]}),f(Ne,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:b?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:b?"text.primary":"text.disabled"},children:b||a})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(T=>f(da,{label:T,onPress:()=>w(T)},T)),f(da,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(da,{label:"0",onPress:()=>w("0")}),f(da,{label:i?".":m?String(m):"DEL",onPress:i?P:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Id,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(da,{label:String(u||"CLR"),onPress:N,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:R,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Dd,{}),f(E,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Uu=({touchMode:t="comfortable",sx:o,...r})=>{let n=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...o},children:f(Vo,{...r})})};var zv=(t,o,r)=>{if(r?.(o),!!o.href){if(o.href.startsWith("http://")||o.href.startsWith("https://")){window.open(o.href,"_blank");return}t.push(o.href);}},Ku=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=ao(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=yr("(orientation: portrait)"),u=yr(i.breakpoints.down("md")),m=r==="auto"?d||u?"portrait":"landscape":r,f$1=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(h=>{let p=h.id===o,v=h.color||(p?i.palette.primary.main:i.palette.divider);return f(Ne,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:h.disabled,onClick:()=>zv(f$1,h,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:h.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ae,{spacing:1.5,sx:{height:"100%"},children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"var(--orb-on-primary)":"text.primary",background:p?v:"action.hover"},children:h.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var Yu=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?Yu(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,_v=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},Zu=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:u,onItemSelect:m})=>{let{t:f$1}=de(),h=ao(),p=Ro("(orientation: portrait)"),v=Ro(h.breakpoints.down("md")),y=s==="auto"?p||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),b=usePathname(),[C,k]=useState(""),[w,P]=useState(new Set),I=useMemo(()=>Yu(a,C),[a,C]),S=useMemo(()=>C.trim()?_v(I):w,[w,I,C]);useEffect(()=>{t&&P(new Set);},[t]);let N=L=>L.appurl||L.href||"",R=L=>{m?.(L);let O=N(L);if(O){if(O.startsWith("http://")||O.startsWith("https://")){window.open(O,"_blank");return}x.push(O);}},T=L=>{let O=!!L.children?.length;if(t&&O){o?.();return}if(O){P(Y=>{let H=new Set(Y);return H.has(L.id)?H.delete(L.id):H.add(L.id),H});return}R(L);},D=L=>{let O=u||b,Y=N(L);return !!(Y&&O===Y)},A=(L,O=0)=>{let Y=!!L.children?.length,H=S.has(L.id),q=D(L);return f("div",{sx:{pl:O===0?0:1.5},children:g(Ne,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:q?"primary.main":"divider",bgcolor:q?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>T(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(Ka,{variant:"rounded",sx:{width:40,height:40,bgcolor:q?"primary.main":"action.hover",color:q?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),Y?f(rn,{sx:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(Za,{color:"action"})]}),Y?f(on,{in:H,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(V=>A(V,O+1))})}):null]})},L.id)};return t?f(Ne,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(ae,{spacing:1,children:[f(ne,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f$1("navigation.expand"),children:f(oi,{})}),a.map(L=>f(ne,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(L)?"primary.main":"action.hover",color:D(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ne,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ae,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:C,onChange:L=>k(L.target.value),placeholder:f$1("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(Xd,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?f(ne,{onClick:o,sx:{bgcolor:"action.hover"},children:f(_d,{})}):null]}),l,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>A(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f$1("navigation.noMatch")})}),d]})})};var Qu=(t,o)=>{let r=o[t.id];if(t.render)return t.render(r,o);if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},Gv=t=>jt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),Uv=(t,o)=>{let r=o[t.id];if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},Kv=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Ne,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ae,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(Ne,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),f(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},qv=t=>{let{t:o}=de(),r=ao(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:u,fitContainer:m=false,fullWidth:f$1=false,maxHeight:h,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b$1="default",graphReport:C,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,orientation:S="auto",cardTitleField:N,cardSubtitleFields:R,toolbarSlot:T,emptyState:D,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:O,onRowClick:Y}=t,H=n||o("table.title.default"),q=Ro("(orientation: portrait)"),V=Ro(r.breakpoints.down("md")),Z=S==="auto"?q||V?"portrait":"landscape":S,{columns:z,filterText:B,setFilterText:G,visibleColumns:U,showSummary:ge,setShowSummary:ie,summaryColumns:pe,grouping:xe,setGrouping:We,expandedGroups:we,groupAnchorEl:se,setGroupAnchorEl:Ae,summaryAnchorEl:Ie,setSummaryAnchorEl:ke,anchorEl:ze,setAnchorEl:et,contextMenu:rt,sortedAndFilteredRows:at,summaryRow:K,visibleRows:Re,page:ve,setPage:Fe,rowsPerPage:nt,setRowsPerPage:Ye,totalDisplayCount:xt,setSelected:It,handleClick:Lt,toggleSummaryColumn:Nt,handleExport:te,handleCloseContextMenu:Ge,toggleColumnVisibility:Oe,toggleGroupExpand:le,handleExpandGroupRecursively:be,handleCollapseGroupRecursively:ee,handleLayoutLoad:he,handleVariantLoad:De,handleLayoutSave:je,effectiveAppId:it,currentLayoutData:dt,currentLayoutId:Ft,layoutIdToLoad:Kt,graphReportOpen:zt,handleOpenGraphReport:St,handleCloseGraphReport:Vt}=fn(t),ht=C?.enabled??false,Dt=ht&&(C?.interaction?.enabled??true),st=xi(),Ot=x||"id",qt=jt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(r.palette.common.white,.06):tt(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),X=jt__default.useMemo(()=>({...qt,borderColor:tt(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(r.palette.primary.main,.16):tt(r.palette.primary.main,.08)}),[qt,r]),W=jt__default.useMemo(()=>{let J=new Set(s);return at.filter(Le=>J.has(Le?.[Ot]))},[Ot,s,at]),Q=W.length===1?W[0]:null,fe=!!k?.enabled,ye=!!w?.enabled,Ee=!!P?.enabled,$e=k?.fields,Ke=k?.excludeFields||[],Ze=k?.initialValues||{},ut=w?.fields,gt=w?.excludeFields||[],Mt=w?.editableFields||[],bt=w?.nonEditableFields||[],F=w?.primaryKeys?.length?w.primaryKeys:[Ot],[j,me]=jt__default.useState(false),[Pe,Je]=jt__default.useState(false),[qe,wt]=jt__default.useState({}),[ft,mt]=jt__default.useState(false),[yt,oo]=jt__default.useState(false),[At,Xt]=jt__default.useState({}),[Bt,Gt]=jt__default.useState(false),[Wt,eo]=jt__default.useState(false),ro=p||Pe||yt||Wt,go=jt__default.useMemo(()=>{let J=[...z];if(Array.isArray($e)&&$e.length>0){let Le=new Set($e);J=J.filter(Qe=>Le.has(Qe.id));}if(Ke.length>0){let Le=new Set(Ke);J=J.filter(Qe=>!Le.has(Qe.id));}return J.filter(Le=>!!Le?.id)},[z,Ke,$e]),To=jt__default.useMemo(()=>{let J=[...z];if(Array.isArray(ut)&&ut.length>0){let Le=new Set(ut);J=J.filter(Qe=>Le.has(Qe.id));}if(gt.length>0){let Le=new Set(gt);J=J.filter(Qe=>!Le.has(Qe.id));}return J.filter(Le=>!!Le?.id)},[z,gt,ut]),Io=jt__default.useMemo(()=>new Set(F),[F]),or=jt__default.useMemo(()=>new Set(Mt),[Mt]),vo=jt__default.useMemo(()=>new Set(bt),[bt]),Lo=jt__default.useCallback(J=>or.size>0?or.has(J):!(vo.has(J)||Io.has(J)),[or,vo,Io]);jt__default.useEffect(()=>{!zt&&st.hasActiveFilters&&st.clearAll();},[st,zt]);let Ur=()=>{let J={};go.forEach(Le=>{J[Le.id]=Ze[Le.id]??"";}),wt(J),me(true);},Kr=(J,Le)=>{wt(Qe=>({...Qe,[J]:Le}));},Ar=async()=>{if(!k?.onSubmit){me(false);return}try{Je(!0),await k.onSubmit(qe),me(!1);}finally{Je(false);}},qr=()=>{if(!Q)return;let J={};To.forEach(Qe=>{J[Qe.id]=Q[Qe.id]??"";});let Le=w?.getInitialValues?{...J,...w.getInitialValues(Q)}:J;Xt(Le),mt(true);},Xr=(J,Le)=>{Xt(Qe=>({...Qe,[J]:Le}));},Mo=async()=>{if(Q){if(!w?.onSubmit){mt(false);return}try{oo(!0),await w.onSubmit(At,Q),mt(!1);}finally{oo(false);}}},Er=()=>{W.length!==0&&Gt(true);},Yr=async()=>{if(W.length===0){Gt(false);return}if(!P?.onConfirm){Gt(false),It([]),l?.([]);return}try{eo(!0),await P.onConfirm(W),Gt(!1),It([]),l?.([]);}finally{eo(false);}},Uo=at,{fieldMapping:rr}=pn({rows:Uo,config:{...C,title:C?.title||`${H} ${o("graph.reportTitle")}`}}),Nn=jt__default.useMemo(()=>Dt?st.applyRows(Uo,rr):Uo,[rr,st,Dt,Uo]),{model:Lr}=pn({rows:Nn,config:{...C,title:C?.title||`${H} ${o("graph.reportTitle")}`,fieldMapping:rr}}),M=Lr.table.columns.map(J=>({id:J.id,label:J.label,align:J.align||"left",minWidth:120,numeric:J.align==="right"})),$=it?f(gn,{appId:it,tableKey:b$1,currentLayoutData:dt,onLayoutLoad:he,targetLayoutId:Kt,activeLayoutId:Ft,serviceUrl:I??g$1?.serviceUrl}):null,_=z.filter(J=>U.includes(J.id)),ce=_.find(J=>J.id===N)||_[0],Be=R?.map(J=>_.find(Le=>Le.id===J)).filter(Boolean)||_.filter(J=>J.id!==ce?.id).slice(0,Z==="portrait"?2:3),ot=_.filter(J=>J.id!==ce?.id&&!Be.some(Le=>Le.id===J.id)),_e=[T,u].filter(Boolean),oe=g(e,{children:[f(cn,{groupAnchorEl:se,setGroupAnchorEl:Ae,grouping:xe,setGrouping:We,columns:z}),f(dn,{anchorEl:ze,setAnchorEl:et,columns:z,visibleColumns:U,toggleColumnVisibility:Oe}),f(mi,{anchorEl:Ie,setAnchorEl:ke,showSummary:ge,setShowSummary:ie,columns:z,summaryColumns:pe,toggleSummaryColumn:Nt}),f(gi,{contextMenu:rt,handleCloseContextMenu:Ge,columns:z,visibleColumns:U,toggleColumnVisibility:Oe})]}),ue=(J,Le,Qe)=>{let Me=s.includes(Le),Xe=Z==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",kt=Qe%2===0?tt(r.palette.primary.main,b()==="dark"?.09:.04):tt(r.palette.primary.main,b()==="dark"?.05:.022),Zr=tt(r.palette.divider,.22);return f(Ne,{elevation:0,onClick:()=>{Lt({},J),Y?.(J);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(r.palette.primary.main,.38):Zr,background:Me?`linear-gradient(135deg, ${tt(r.palette.primary.main,.13)}, ${tt(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${kt}, ${tt(r.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(r.palette.primary.main,.2)}`:`0 3px 10px ${tt(r.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Me?r.palette.primary.main:Qe%2===0?tt(r.palette.primary.main,.26):tt(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ae,{spacing:1.25,children:[g(ae,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Me,onClick:xo=>xo.stopPropagation(),onChange:()=>Lt({},J),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[ce?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Qu(ce,J)}):null,Be.length>0?f(ae,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(xo=>f(Ct,{label:`${xo.label}: ${Uv(xo,J)}`,size:"small",variant:"outlined",sx:qt},`${Le}-${xo.id}`))}):null]}),L?f("div",{onClick:xo=>xo.stopPropagation(),children:L(J)}):null]}),ot.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:ot.map(xo=>g(Ne,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(r.palette.background.default,.7):tt(r.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(r.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:xo.label}),Gv(Qu(xo,J))]},`${Le}-${xo.id}-detail`))}):null,O?g(e,{children:[f(Rt,{}),f("div",{onClick:xo=>xo.stopPropagation(),children:O(J)})]}):null]})},Le)};return g("div",{sx:{width:f$1?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(Uu,{...g$1,onVariantLoad:J=>{De(J),g$1.onVariantLoad?.(J);},appId:g$1.appId,tableKey:b$1,currentLayout:[{tableKey:b$1,layoutData:dt}],currentLayoutId:Ft,layoutRefs:[{tableKey:b$1,layoutId:Ft}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:Z==="portrait"?"expanded":"comfortable"})}):null,g(Ne,{sx:{width:f$1?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ro?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(ci,{filterText:B,setFilterText:G,onRowsPerPageChange:Ye,rowsPerPage:nt,rowsPerPageOptions:v,page:ve,count:xt,onPageChange:Fe,actions:d,extraTools:_e,grouping:xe,setGroupAnchorEl:Ae,showSummary:ge,setShowSummary:ie,setAnchorEl:et,setSummaryAnchorEl:ke,handleExport:te,showCreateButton:fe,onOpenCreateDialog:Ur,showEditButton:ye,onOpenEditDialog:qr,editDisabled:W.length!==1,showDeleteButton:Ee,onOpenDeleteConfirm:Er,deleteDisabled:W.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?je:void 0,loading:p,layoutManager:$,onOpenGraphReport:ht?St:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ae,{spacing:1.25,children:[Re.length===0&&!p?D||f(Ne,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,Re.map((J,Le)=>{if(J.type==="group"){let Xe=we.has(J.id);return f(Ne,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>le(J.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Xe?f(rn,{}):f(Za,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[J.field,": ",J.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[J.count," records"]})]}),xe.length>1&&J.level<xe.length-1?g(ae,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),be(J.id);},sx:X}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),ee(J.id);},sx:X})]}):null]})},J.id)}let Qe=J.data||J,Me=J.id||Qe[Ot]||Le;return ue(Qe,Me,Le)}),ge?f(Kv,{summaryRow:K,visibleColumns:U,columns:z}):null,p?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),fe?g(Et,{open:j,onClose:()=>!Pe&&me(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[go.map(J=>{let Le=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return f(He,{label:J.label||J.id,value:qe[J.id]??"",onChange:Qe=>Kr(J.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${J.id}`)}),k?.description?f(Zo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>me(false),disabled:Pe,children:k?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Ar,variant:"contained",disabled:Pe,children:k?.submitLabel||o("common.save")})]})]}):null,ye?g(Et,{open:ft,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||o("quickEdit.editWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[To.map(J=>{let Le=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return f(He,{label:J.label||J.id,value:At[J.id]??"",onChange:Qe=>Xr(J.id,Qe.target.value),type:Le,disabled:!Lo(J.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${J.id}`)}),w?.description?f(Zo,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Se,{onClick:()=>mt(false),disabled:yt,children:w?.cancelLabel||o("common.cancel")}),f(Se,{onClick:Mo,variant:"contained",disabled:yt||!Q,children:w?.submitLabel||o("common.save")})]})]}):null,Ee?f(qn,{open:Bt,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(W.length>1?o("quickDelete.confirmMessageMultiple",{count:W.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:()=>!Wt&&Gt(false),onConfirm:Yr}):null,oe,ht?f(yi,{open:zt,onClose:Vt,model:Lr,aiAssistant:C?.aiAssistant,interaction:Dt?{enabled:true,filters:st.filters,fieldMapping:rr,onPrimaryDimensionClick:J=>st.setFilter("primaryDimension",J),onSecondaryDimensionClick:J=>st.setFilter("secondaryDimension",J),onStatusClick:J=>st.setFilter("status",J),onClearFilter:st.clearFilter,onClearAll:st.clearAll}:void 0,tableContent:f(qv,{appId:it||"graph-report-internal",title:o("graph.dataBody"),columns:M,rows:Lr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var tF=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:u,actionSlot:m,portraitBottomSlot:f$1,contentSx:h,containerSx:p,user:v,onSearch:y,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:C,onWorkloadSelect:k,locale:w="en",localeLabel:P,localeOptions:I,onLocaleChange:S,onUserSetting:N,onUserLogout:R,userMenuItems:T,leftHeaderSlot:D,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[O,Y]=useState("system"),[H,q]=useState("light"),[V,Z]=useState(false),[z,B]=useState(false),G=O==="system"?z?H:"light":O;useEffect(()=>{Z(true);},[]),useEffect(()=>{try{let rt=window.localStorage.getItem(L);(rt==="light"||rt==="dark"||rt==="system")&&Y(rt);}catch{}B(true);let ze=window.matchMedia("(prefers-color-scheme: dark)"),et=()=>{q(ze.matches?"dark":"light");};return et(),ze.addEventListener("change",et),()=>ze.removeEventListener("change",et)},[]),useEffect(()=>{if(z)try{window.localStorage.setItem(L,O);}catch{}},[z,O]),useEffect(()=>{G==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[G]);let U=Ro("(orientation: portrait)"),ge=Ro("(max-width: 899.95px)"),ie=l==="auto"?!V||U||ge?"portrait":"landscape":l,[pe,xe]=useState({landscape:x??true,portrait:false}),We=pe[ie],we=b??We,se=ze=>{b===void 0&&xe(et=>({...et,[ie]:ze})),C?.(ze);},Ae=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[!V||i&&ie==="portrait"?f(ne,{onClick:()=>se(!we),sx:{bgcolor:"action.hover"},children:f(oi,{})}):null,D]}),Ie=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),ke=f(Zu,{collapsed:ie==="landscape"?!we:false,onToggle:()=>se(!we),menuData:r,orientation:ie,colorMode:G,maxHeight:ie==="landscape"?900:void 0});return f(An,{mode:O,children:f(Ha,{locale:w,children:g("div",{sx:[ze=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:ze.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":ze.palette.background.default}),...Array.isArray(p)?p:[p]],children:[f(Fi,{appTitle:t,logo:d===void 0?null:d,mode:O,onToggleMode:()=>Y(ze=>ze==="system"?"dark":ze==="dark"?"light":"system"),locale:w,localeLabel:P,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:N,onUserLogout:R,userMenuItems:T,onSearch:y,onSearchAdd:g$1,leftSlot:Ae,rightSlot:Ie}),u?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[V&&i&&ie==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ke}):null,!V||i&&ie==="portrait"?f(vd,{open:we,onClose:()=>se(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:ke}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:g(ae,{spacing:1.5,children:[s&&n.length>0?f(Ku,{items:n,selectedId:a,orientation:ie,onItemSelect:k}):null,f(Ne,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),ie==="portrait"&&f$1?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:f$1})]}):null]})})})};var ju=Xv(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function Pl({isRecording:t}){return f(AnimatePresence,{children:t&&f(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(ju,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(ju,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var iF=Pl;var em=createContext(null);function ty(t){if(!t||!(t instanceof HTMLElement))return false;let o=t.tagName;return !!(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function oy({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:u,minVolumeRms:m}){let[f$1,h]=useState(false),[p,v]=useState(false),y=useRef(null),g$1=useRef(false),x=useRef(false),b=useCallback(()=>{x.current=false,h(false);},[]),{isRecording:C,startRecording:k,stopRecording:w}=Cn({wsUrl:d,silenceThresholdMs:u,minVolumeRms:m,onTextUpdate:N=>{r?.(N);},onComplete:async N=>{try{N.trim()&&(v(!0),await o(N.trim()));}catch(R){let T=R instanceof Error?R.message:"Failed to process voice command";n?.(T);}finally{v(!1),b();}},onError:N=>{n?.(N),v(!1),g$1.current||b();}}),P=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let N=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&ty(document.activeElement)||(g$1.current=true,T.preventDefault(),y.current=setTimeout(()=>{x.current=true,h(true),k();},a)));},R=T=>{(T.code==="Space"||T.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g$1.current=false,x.current&&(T.preventDefault(),h(false),w()));};return window.addEventListener("keydown",N),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",R),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,k,w]);let S=useMemo(()=>({isRecording:C,isHotkeyRecording:f$1,isSubmitting:p,startRecording:P,stopRecording:I}),[f$1,C,p,P,I]);return g(em.Provider,{value:S,children:[l?f(Pl,{isRecording:f$1}):null,t]})}function ry(){let t=useContext(em);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var uF=oy,mF=ry;function pt(...t){return twMerge(clsx(t))}var ly=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),s=useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${o==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[g("span",{className:"flex items-center",children:[f(Ta,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Oo,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},tm=ly;var my=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=yo(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(u){console.error("\u590D\u5236\u5931\u8D25:",u);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:pt("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),f("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(Ko,{size:14,className:"text-[var(--orb-status-success)]"}):f(hc,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:o,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},om=my;var rm="orb-html-demo",vy=160,yy=560,Cy=220,Ml=`<script>(function(){var post=function(){var height=Math.ceil(document.documentElement.scrollHeight);parent.postMessage({source:${JSON.stringify(rm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});post()})()</script>`,xy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Sy=t=>/<html[\s>]/i.test(t),wy=t=>{let o=t.trim();return Sy(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Ml}</body>`):`${o}${Ml}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${xy}</style></head><body>${o}${Ml}</body></html>`},ky=({content:t,title:o="Interactive HTML"})=>{let r=useRef(null),[n,a]=useState(Cy),i=useMemo(()=>wy(t),[t]);return useEffect(()=>{let s=l=>{if(l.source!==r.current?.contentWindow)return;let d=l.data;!d||d.source!==rm||typeof d.height!="number"||!Number.isFinite(d.height)||a(Math.min(yy,Math.max(vy,Math.ceil(d.height))));};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[]),g("figure",{className:"orb-html-demo-frame",children:[f("figcaption",{className:"orb-html-demo-caption",children:o}),f("iframe",{ref:r,className:"orb-html-demo",title:o,sandbox:"allow-scripts",srcDoc:i,style:{height:n}})]})},nm=ky;var Iy=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},My=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),u=yo();return useEffect(()=>{let m=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{im.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let p=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await im.render(p,v);!m&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(p){if(m)return;console.error("Mermaid render failed:",p),d(p instanceof Error?p.message:"Render failed");}finally{m||s(false);}}},h=setTimeout(()=>{f();},100);return ()=>{m=true,clearTimeout(h);}},[t,u]),g("div",{className:`mermaid-block ${r}`,style:n,children:[(o||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&g("div",{className:"rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-3 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"font-medium",children:Iy(l)}),g("details",{className:"mt-1",children:[f("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),f("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),f("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),f("div",{ref:a,className:`overflow-x-auto ${o||i||l?"hidden":""}`})]})},sm=My;var Ry=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...u})=>{let[m,f$1]=useState(false),[h,p]=useState(false),v=async()=>{if(l){p(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{p(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...u,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(Ca,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?f("p",{className:"whitespace-pre-wrap",children:o}):o}),(l||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[l&&g("button",{onClick:v,disabled:h,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Ac,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>f$1(!m),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[m?f(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{className:"w-3.5 h-3.5 mr-1"}),m?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(Yt,{className:"w-4 h-4"})})]}),n&&m&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},Qi=Ry;var Dy=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:u,className:m="",...f$1})=>{let h=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},p=()=>{switch(n){case "info":return f(Pa,{className:"w-5 h-5"});case "error":return f(Ea,{className:"w-5 h-5"});case "success":return f(xa,{className:"w-5 h-5"});default:return f(mc,{className:"w-5 h-5"})}},v=h();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${m}`,...f$1,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||p()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((y,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:y})]},g$1))})]}),s&&l&&f("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Yt,{className:"w-4 h-4"})})]}),d&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:u||"\u786E\u8BA4"})})]})},ji=Dy;var Ny=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...u})=>{let[m,f$1]=useState(false),[h,p]=useState(""),[v,y]=useState(false),g$1=useMemo(()=>h.trim()?r.filter(C=>C.toLowerCase().includes(h.toLowerCase())):r,[r,h]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),b=C=>{n?.(C);};return !r||r.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...u,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(Ta,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),g("div",{className:"flex items-center space-x-1",children:[r.length>3&&f("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Bo,{className:"w-4 h-4"})}),s&&l&&f("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(Yt,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:C=>p(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Bo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((C,k)=>f("li",{children:g("button",{onClick:()=>b(C),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:C}),f(Fo,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g$1.length>a&&f("button",{onClick:()=>f$1(!m),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&h&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Ji=Ny;var Ay=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:u,onAction:m,actionText:f$1,className:h="",...p})=>{let[v,y]=useState(false),[g$1,x]=useState(true),b=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},C=()=>{switch(i){case "pending":return f(Pc,{className:"w-5 h-5 animate-spin"});case "error":return f(Ea,{className:"w-5 h-5"});default:return f(xa,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=b(),P=t||r||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${h}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||C()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:P}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Fn,{className:"w-3 h-3 mr-1"}),r]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(bc,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&u&&f("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Yt,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&g("div",{children:[g("button",{onClick:()=>x(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Oo,{className:"w-3.5 h-3.5 mr-1"}):f(Fo,{className:"w-3.5 h-3.5 mr-1"}),f(Fn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),m&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:m,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f$1||"\u6267\u884C\u64CD\u4F5C"})})]})]})},es=Ay;var Ly=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,r=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):r.length>0&&(n=Object.keys(r[0]).map(s=>({id:s,label:s,numeric:typeof r[0][s]=="number"})))),r=r.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:r}},[t]);return o.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(jo,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},ts=Ly;var Oy=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(Ms,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(kc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Nc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(uc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(Sc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(xc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Hc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(On,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Ic,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Ms,{className:"w-4 h-4"})}},s=()=>{if(!r&&n!=="google-map-card"&&n!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return f(jn,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(yp,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=r.reduce((u,m)=>u+(Number(m.value)||0),0),d=r.map(u=>({name:u.name,value:Number(u.value)||0,percent:typeof u.percent=="number"?u.percent:l>0?(Number(u.value)||0)/l*100:0}));return f(hi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Cp,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(xp,{data:r});case "fishbone-chart-card":return f(Sp,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(wp,{data:r,height:a.height});case "google-map-card":return f(kp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return f(Pp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[0]?.keyword||t,height:a.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(r,null,2)})]})})]})]})},os=Oy;var ss=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],Fy={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},as=480,Pn=214,_t={top:18,right:16,bottom:38,left:30},Jt=t=>typeof t=="number"&&Number.isFinite(t)?t:0,mm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Go=(t,o)=>`${t.id||t.label}-${o}`,gm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,is=(t,o,r)=>Math.min(r,Math.max(o,t)),pr=(t,o,r)=>t.color??r[o%r.length],ur=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},fm=t=>{let o=t.map(a=>Jt(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},By=(t,o,r)=>{let n=as-_t.left-_t.right,a=Pn-_t.top-_t.bottom,{max:i,range:s}=fm(r),l=_t.left+t*n/Math.max(r.length-1,1),d=_t.top+(i-Jt(o.value))/s*a,u=_t.top+i/s*a;return {x:l,y:d,zeroY:u}},ns=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},Hy=(t,o,r,n,a,i)=>{let s=ns(t,o,r,i),l=ns(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} Z`;let u=ns(t,o,n,i),m=ns(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${d} 1 ${u.x} ${u.y} Z`},zy=({children:t})=>g("div",{className:"orb-metric-empty",role:"status",children:[f("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),f(E,{variant:"body2",muted:true,children:t})]}),Vy=()=>g("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),f("span",{className:"orb-metric-skeleton"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Nl=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...ur(t,r),style:{cursor:o||r?"pointer":"default"}}},Wy=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(Vy,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(zy,{children:n??"No data for the current selection."}),$y=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(Jt(l.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=Jt(l.value),m=`${is(Math.abs(u)/s*100,0,100)}%`,f$1=o===l.id,h=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${f$1?" is-active":""}`,style:{width:m,backgroundColor:pr(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(u)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${f$1?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(u)}`,"aria-pressed":f$1,...ur(l,n),children:h},Go(l,d)):f("div",{className:`orb-metric-bar-row${f$1?" is-active":""}`,role:"listitem",...ur(l,n),children:h},Go(l,d))})})},_y=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(Jt(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let u=Math.max(Jt(l.value),0),m=is(u/s*100,0,100),f$1=o===l.id,h=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(u)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:pr(l,d,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${f$1?" is-active":""}`,onClick:()=>r(l),"aria-pressed":f$1,...ur(l,n),children:h},Go(l,d)):f("div",{className:`orb-metric-progress-row${f$1?" is-active":""}`,role:"listitem",...ur(l,n),children:h},Go(l,d))})})},Gy=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:u,max:m,range:f$1}=fm(o),h=as-_t.left-_t.right,p=Pn-_t.top-_t.bottom,v=_t.top+m/f$1*p,y=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((C,k)=>By(k,C,o)),x=g$1.map(C=>`${C.x},${C.y}`).join(" "),b=Math.max(...o.map(C=>Math.max(Jt(C.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${as} ${Pn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:_t.left,y1:v,x2:as-_t.right,y2:v}),f("line",{className:"orb-metric-grid",x1:_t.left,y1:_t.top,x2:_t.left,y2:Pn-_t.bottom}),t==="column"&&o.map((C,k)=>{let w=g$1[k],P=Jt(C.value),I=Math.max(Math.abs(w.y-v),P===0?2:0),S=w.x-Math.min(18,h/Math.max(o.length*2,1)),N=Math.min(36,Math.max(10,h/Math.max(o.length*1.8,1))),R=r===C.id;return g("g",{...Nl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(P)}`,children:[f("rect",{className:`orb-metric-column${R?" is-active":""}`,x:S,y:Math.min(w.y,v),width:N,height:I,rx:4,fill:pr(C,k,l)}),g("title",{children:[C.label,": ",i(P)]}),(k%y===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Pn-14,textAnchor:"middle",children:gm(C.label)})]},Go(C,k))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),o.map((C,k)=>{let w=g$1[k],P=r===C.id,I=t==="bubble"?7+Math.max(Jt(C.secondaryValue),0)/b*12:t==="scatter"?5:4;return g("g",{...Nl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(Jt(C.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:P?6:4,fill:pr(C,k,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:pr(C,k,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[C.label,": ",i(Jt(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(Jt(C.secondaryValue))}`:""]}),(k%y===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(_t.top+8,w.y-I-7),textAnchor:"middle",children:gm(C.label)})]},Go(C,k))})]}),f("text",{className:"orb-metric-axis-label",x:_t.left,y:_t.top-5,children:i(m)}),u<0&&f("text",{className:"orb-metric-axis-label",x:_t.left,y:Pn-_t.bottom+14,children:i(u)})]})})},Uy=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=o.map(p=>({...p,value:Math.max(Jt(p.value),0)})),u=d.reduce((p,v)=>p+v.value,0),m=72,f$1=92,h=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((p,v)=>{let y=p.value/u*360,g$1=h;h+=y;let x=r===p.id,b=y>=359.9?void 0:Hy(f$1,f$1,m,t==="donut"?46:0,g$1,g$1+y),C=Nl({item:p,onItemClick:n,interactions:a});return b?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:pr(p,v,s),...C,children:g("title",{children:[p.label,": ",i(p.value)," (",(p.value/u*100).toFixed(1),"%)"]})},Go(p,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f$1,cy:f$1,r:t==="donut"?60:m,fill:t==="donut"?"none":pr(p,v,s),stroke:t==="donut"?pr(p,v,s):void 0,strokeWidth:28,...C,children:g("title",{children:[p.label,": ",i(p.value)," (100%)"]})},Go(p,v))}),t==="donut"&&f("circle",{cx:f$1,cy:f$1,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:f$1,y:f$1+5,textAnchor:"middle",children:i(u)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((p,v)=>{let y=r===p.id;return g("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(p),disabled:!n,title:p.label,...ur(p,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:pr(p,v,s)}}),f("span",{className:"orb-metric-legend-label",children:p.label}),g("strong",{children:[(p.value/u*100).toFixed(0),"%"]})]},Go(p,v))})})]})},Ky=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=g(e,{children:[f("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),f("span",{className:"orb-metric-list-value",children:a(Jt(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(Jt(s.secondaryValue))})]});return r?f("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...ur(s,n),children:d},Go(s,l)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...ur(s,n),children:d},Go(s,l))})}),ls=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=mm,secondaryValueFormatter:u=mm,valueLabel:m,secondaryValueLabel:f$1,emptyState:h,loading:p=false,error:v,maxItems:y=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:C,chartTypeLabels:k,footer:w,ariaLabel:P,className:I,style:S,sx:N})=>{let R=Is(),T=useRef(null),D=useRef(null),[A,L]=useState(n),[O,Y]=useState(false),[H,q]=useState(null),[V,Z]=useState(null);useEffect(()=>L(n),[n]);let z=useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null);},[]);useEffect(()=>z,[z]),useEffect(()=>{if(!V)return;let K=Re=>{let ve=Re.target;ve instanceof HTMLElement&&ve.closest(".orb-metric-context-menu")||Z(null);};return document.addEventListener("pointerdown",K),()=>document.removeEventListener("pointerdown",K)},[V]);let B=A,G=useMemo(()=>[R.chart1,R.chart2,R.chart3,R.chart4,R.chart5,R.chart6],[R]),U=useMemo(()=>O?r:r.slice(0,Math.max(1,y)),[r,y,O]),ge=Math.max(0,r.length-U.length),ie=U.some(K=>Jt(K.value)>0),pe=U.length>0&&(B!=="pie"&&B!=="donut"?true:ie),xe=(C??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((K,Re,ve)=>ss.includes(K)&&ve.indexOf(K)===Re),We={...Fy,...k},we=U[0],se=P??`${t} ${We[B]} chart`,Ae=K=>{L(K),a?.(K);},Ie=useCallback((K,Re)=>{q({item:K,source:Re}),Z(null),s?.(K,Re);},[s]),ke=useCallback(K=>{z(),!(!x||V)&&(D.current=window.setTimeout(()=>{Ie(K,"hover"),D.current=null;},Math.max(0,b)));},[z,V,b,Ie,x]),ze=useCallback(()=>{z();},[z]),et=useCallback((K,Re)=>{if(!x)return;K.preventDefault(),z();let ve=T.current?.getBoundingClientRect(),Fe=ve?is(K.clientX-ve.left,8,Math.max(8,ve.width-164)):8,nt=ve?is(K.clientY-ve.top,8,Math.max(8,ve.height-72)):8;Z({item:Re,left:Fe,top:nt});},[z,x]),rt=x?{onItemHoverStart:ke,onItemHoverEnd:ze,onItemContextMenu:et}:void 0,at=B==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>we&&i?.(we),onKeyDown:K=>{we&&i&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),i(we));},"aria-label":se,...we?ur(we,rt):{},children:[f("span",{className:"orb-metric-kpi-label",children:we?.label??m??"Value"}),f("strong",{children:we?d(Jt(we.value)):"\u2014"}),we?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[f$1??"Compared with"," \xB7 ",u(Jt(we.secondaryValue))]})]}):B==="progress"?f(_y,{data:U,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G}):B==="bar"?f($y,{data:U,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G}):B==="list"?f(Ky,{data:U,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u}):B==="pie"||B==="donut"?f(Uy,{type:B,data:U,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,colors:G,ariaLabel:se}):f(Gy,{type:B,data:U,activeId:l,onItemClick:i,interactions:rt,valueFormatter:d,secondaryValueFormatter:u,colors:G,ariaLabel:se});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{z(),H?.source==="hover"&&q(null);},children:[g(Ne,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:N,children:[g("div",{className:"orb-metric-chart-header",children:[g("div",{className:"orb-metric-chart-heading",children:[f(E,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),o&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g$1&&xe.length>1&&f(Ht,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:xe.map(K=>({value:K,label:We[K]})),onChange:K=>Ae(K.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(Wy,{loading:p,error:v,hasData:pe,emptyState:h,children:at}),ge>0&&!p&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>Y(K=>!K),children:O?"Show fewer":`Show all ${r.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),V&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:z,onKeyDown:K=>{K.key==="Escape"&&Z(null);},style:{left:V.left,top:V.top},onPointerDown:K=>K.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:V.item.label}),f("button",{type:"button",role:"menuitem",onClick:K=>{K.preventDefault(),K.stopPropagation(),Ie(V.item,"contextmenu");},children:"Show data"})]}),H&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${H.item.label} data details`,onPointerDown:K=>K.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:H.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>q(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:d(Jt(H.item.value))})]}),H.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:f$1??"Secondary value"}),f("strong",{children:u(Jt(H.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:H.source==="hover"?`Shown after ${Math.max(0,b)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ls.displayName="CMetricChartCard";var qy=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return f(ls,{...a,valueFormatter:l=>s(l,r),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},cs=qy;var Xy=({type:t,manifest:o})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),ds=Xy;var Yy=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??r),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ps=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=ss.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:Yy(o.data)}}if((o.type==="bar-chart-card"||o.type==="line-chart-card"||o.type==="pie-chart-card"||o.type==="combo-chart-card"||o.type==="heatmap-chart-card"||o.type==="fishbone-chart-card"||o.type==="waterfall-chart-card"||o.type==="google-map-card"||o.type==="amap-card")&&o.title||(o.type==="sap-analytical-card"||o.type==="sap-list-card"||o.type==="sap-object-card"||o.type==="sap-component-card")&&o.manifest||o.type==="error-card"||o.type==="warning-card"||o.type==="suggestions-card"||o.type==="tool-result-card"||o.type==="table"&&o.data)return o}return null};var oC=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=useRef(l);d.current=l;let u=!!l?.onCardEvent,m=useMemo(()=>u?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[u]),f$1=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),h=(y,g,x,b,C)=>{m?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:b,rawData:C});},p=(y,g,x,b,C,k)=>{if(!(!C&&!m?.onCardEvent))return (...w)=>{let P=C?.(...w),I=k?k(...w):void 0;return h(y,g,x,I,b),P}},v=useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...b}=y;return g==="thinkbox"&&x?f(tm,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...b})},table({children:y}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let b=/language-([\w-]+)/.exec(y||""),C=b?b[1]:"",k=String(g);if(!b&&!k.includes(`
|
|
17
|
+
`))return f("code",{children:g});let P=k.replace(/\n$/,"");if(i&&C==="mermaid")return f(sm,{content:P});if(C==="html"||C==="htm")return f(nm,{content:P});if(C==="json"){let I=ps(P);if(I)switch(I.type){case "table":return f(ts,{data:I.data});case "metric-chart-card":return f(cs,{...I,messageId:s,cardHooks:m});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(os,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...I});case "error-card":{let S=I;return f(Qi,{...S,onClose:p("error-card","close",S.title,S,S.onClose),onRetry:p("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,N=S.onConfirm?p("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&m?.onCardEvent?p("warning-card","confirm",S.title,S):void 0;return f(ji,{...S,onClose:p("warning-card","close",S.title,S,S.onClose),onConfirm:N})}case "suggestions-card":{let S=I;return f(Ji,{...S,onClose:p("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,N=>({suggestion:N}))})}case "tool-result-card":{let S=I;return f(es,{...S,onClose:p("tool-result-card","close",S.title,S,S.onClose),onAction:p("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(om,{content:P,language:C,className:"not-prose"}):f("code",{className:y,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:pt("markdown-body max-w-none",n),children:f(Qy,{remarkPlugins:[jy,Jy],rehypePlugins:[eC,tC],components:v,children:f$1})})},Tn=oC;var rC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,l,d,u,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:l,title:d,payload:u,rawData:m});},a=(s,l,d,u,m,f)=>{if(!(!m&&!r?.onCardEvent))return (...h)=>{let p=m?.(...h),v=f?f(...h):void 0;return n(s,l,d,v,u),p}},i=ps(t);if(i)switch(i.type){case "table":return f(ts,{data:i.data});case "metric-chart-card":return f(cs,{...i,messageId:o,cardHooks:r});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(os,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(ds,{...i});case "error-card":{let s=i;return f(Qi,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(ji,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(Ji,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return f(es,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(Tn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},hm=rC;var El=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:false,overallType:"simple"}}},aC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=jt__default.useMemo(()=>El.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(hm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(Tn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},us=aC;var iC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,u]=useState(o?0:t.length),[m,f$1]=useState(!o);useEffect(()=>{if(o){u(0),f$1(false);return}u(t.length),f$1(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){f$1(true),r?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,d]);let h=()=>{o&&!m&&(u(t.length),f$1(true),r?.());},p=o?t.slice(0,d):t,v=o&&!m,y=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:h,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(us,{content:p,messageId:s,cardHooks:l}),v&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},ym=iC;var Cm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(hr,{size:14});case "refresh":return f(Na,{size:14});case "volume":return f(Vc,{size:14});case "like":return f(Fc,{size:14});case "dislike":return f(Oc,{size:14});default:return null}};return f("div",{className:pt("flex items-center gap-1",o),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:pt("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:r(n.type)},`${n.type}-${a}`))})};var ms=({message:t,onStreamingComplete:o,assistantActions:r,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(r?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(ym,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(Cm,{buttons:[{type:"refresh",onClick:()=>{r?.onRegenerate?.();},disabled:d||!r?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};var xm=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Cn({onTextUpdate:t,onComplete:u=>{o?.(u);},onError:u=>{console.error("Voice input error:",u),r?.();}});return f("button",{onClick:async()=>{i?l():await s();},disabled:n,className:pt("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?f(Ud,{size:16}):f(Kd,{size:16})})};var lo={container:"w-full max-w-4xl mx-auto",inputContainer:pt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:pt("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:pt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:pt("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:pt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:pt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:pt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},lC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},cC=({enabled:t,onClick:o})=>f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.buttonNormal),onClick:o,disabled:!t,"aria-label":"Upload file",type:"button",children:f(kd,{size:16})}),dC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>o?f("button",{className:pt(lo.buttonBase,lo.buttonSmall,lo.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:f(tp,{size:15})}):f("button",{className:pt(lo.buttonBase,lo.buttonSmall,t?lo.sendButton:lo.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":"Send message",type:"button",children:f(Zd,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),Ll=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[u,m]=useState(false),[f$1,h]=useState(false),p=useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!r,g$1={enabled:true},x=useCallback(O=>{s(O.target.value),O.target.style.height="auto",O.target.style.height=`${Math.min(O.target.scrollHeight,200)}px`;},[]),b=useCallback(O=>{if(O.target.files&&O.target.files.length>0){let Y=Array.from(O.target.files);d(H=>{let q=Y.filter(Z=>H.some(z=>z.name===Z.name&&z.size===Z.size));q.length>0&&console.warn("Duplicate files ignored:",q.map(Z=>Z.name));let V=Y.filter(Z=>!H.some(z=>z.name===Z.name&&z.size===Z.size));return [...H,...V]}),p.current&&(p.current.value="");}},[]),C=useCallback(O=>{d(Y=>Y.filter((H,q)=>q!==O));},[]),k=useCallback(()=>{p.current?.click();},[]),w=useCallback(async()=>{if(!y)return;let O=i,Y=[...l];s(""),d([]),p.current&&(p.current.value="");try{await t(O,Y);}catch(H){console.error("Failed to send message:",H),s(O),d(Y);}},[i,y,t,l]),P=useCallback(O=>{O.key==="Enter"&&!O.shiftKey&&!u&&(O.preventDefault(),w());},[w,u]),I=useCallback(()=>{m(true);},[]),S=useCallback(()=>{m(false);},[]),N=useCallback(O=>{s(O);},[]),R=useCallback(O=>{s(O);},[]),T=useCallback(()=>{},[]),D=useCallback(O=>{O.preventDefault(),h(true);},[]),A=useCallback(O=>{O.preventDefault(),h(false);},[]),L=useCallback(O=>{if(O.preventDefault(),h(false),O.dataTransfer.files&&O.dataTransfer.files.length>0){let Y=Array.from(O.dataTransfer.files);d(H=>[...H,...Y]);}},[]);return f("div",{className:lo.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:b}),g("div",{className:pt(lo.inputContainer,f$1&&lo.dragActive),onDragOver:D,onDragLeave:A,onDrop:L,children:[l.length>0&&f("div",{className:lo.filePreviewArea,children:l.map((O,Y)=>g("div",{className:lo.fileTag,children:[f(Vd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:O.name}),f("button",{onClick:()=>C(Y),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(Ad,{sx:{fontSize:16}})})]},`${O.name}-${Y}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:pt(lo.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:pt(lo.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:P,onCompositionStart:I,onCompositionEnd:S,style:lC,"aria-label":"Message input",spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[f("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:f(cC,{enabled:g$1.enabled,onClick:k})}),g("div",{className:"flex items-center gap-1",children:[f(xm,{onTextUpdate:N,onComplete:R,onCancel:T,disabled:r,className:lo.buttonSmall}),f(dC,{canSend:y,isResponding:r,onSend:w,onStop:o})]})]})]})]})]})})};var wm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:u,cardHooks:m,showInput:f$1=true,statusLine:h})=>{let p=useRef(null),v=useRef(t.length);return useEffect(()=>{t.length>v.current&&p.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),g("div",{className:pt("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,b=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return f(ms,{message:y,assistantActions:b,onStreamingComplete:()=>u?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},y.id)}),h,f("div",{ref:p})]}),f$1&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Ll,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var km={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Pm=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let u=a??(d.isResponding?"running":"idle"),m=u==="running"||u==="pending",f$1=[km[u],o].filter(Boolean).join(" \xB7 ");return g("div",{className:pt("orb-agent-panel",n),children:[g("div",{className:pt("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":m||void 0}),f("span",{className:"truncate",children:f$1||"Agent"})]})]}),r&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),f("div",{className:"relative min-h-0 flex-1",children:f(wm,{...d,showInput:l,statusLine:m?g("div",{className:pt("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${km[u]}\u2026`})]}):void 0})})]})};var gC=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),Im=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),l=useRef(null),d=useRef(null),u=useRef(null),m=useId(),f$1=!!a;useEffect(()=>{if(!i)return;let p=y=>{l.current?.contains(y.target)||s(false);},v=y=>{y.key==="Escape"&&(y.stopPropagation(),s(false),u.current?.focus());};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",v);}},[i]),useEffect(()=>{if(!i)return;let p=d.current?.querySelector('[aria-selected="true"]'),v=d.current?.querySelector('[role="option"]');(p??v)?.focus();},[i]);let h=p=>{let v=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(v.length===0)return;let y=v.findIndex(x=>x===document.activeElement),g=y<0?p===1?0:v.length-1:(y+p+v.length)%v.length;v[g]?.focus();};return !n&&!f$1?null:g(e,{children:[n&&f("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:f(jr,{size:16})}),f$1&&a&&g("div",{className:"orb-omph-conversation-anchor",ref:l,children:[f("button",{ref:u,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(p=>!p),children:f(Mc,{size:16})}),i&&f("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:p=>{p.key==="ArrowDown"?(p.preventDefault(),h(1)):p.key==="ArrowUp"&&(p.preventDefault(),h(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(p=>{let v=p.updatedAt?gC(p.updatedAt):"",y=[p.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=p.id===o;return g("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g$1,"data-active":g$1||void 0,onClick:()=>{a(p.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:p.title}),y&&f("span",{className:"orb-omph-conversation-meta",children:y})]},p.id)})})]})]})};var CC=2e3,xC=1/3,fs=[.25,.5,.75,1,1.5,2,3,4],SC=100,Mm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Rm=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let m=t.split(`
|
|
18
|
+
`);m.length>1&&m[m.length-1]===""&&m.pop();let f=Math.min(m.length,CC);return {shown:m.slice(0,f).join(`
|
|
19
|
+
`),shownCount:f,total:m.length}},[t]),d=useCallback(m=>{let f=n??r,h=r!==void 0&&f!==void 0&&m>=r&&m<=f;return {className:"orb-omph-code-line","data-line":m,...h?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,f=m?.closest(".orb-omph-pv-body");if(!m||!f)return;if(r===void 0){f.scrollTop=0;return}let h=m.querySelector(`[data-line="${r}"]`);if(!h)return;let p=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,p-f.clientHeight*xC);},[r,l.shown]);let u={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:u,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Mm,codeTagProps:{className:`language-${o}`,style:Mm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Dm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(Tn,{content:t})}),Nm=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),u=n==="fit"?1:n,m=fs.some(v=>v>u),f$1=fs.some(v=>v<u),h=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?fs.find(b=>b>g):[...fs].reverse().find(b=>b<g))??y}),p=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?f("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:o??"",draggable:false,style:p,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[f("button",{type:"button","aria-label":r.zoomOut,disabled:!f$1,onClick:()=>h(-1),children:"\u2212"}),f("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*SC)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>h(1),children:"+"})]})]})};var wC=/^[a-z][a-z0-9+.-]*:/i,kC=/^L(\d+)(?:-L?(\d+))?$/i;var Am=["B","KB","MB","GB"];var PC=t=>{try{return decodeURIComponent(t)}catch{return t}},Bl=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||wC.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=PC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=kC.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let u=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,u)}},Hl=t=>t.split("/").filter(Boolean).pop()??t,Lm=t=>{let o=t.split("/");return o.pop(),o.join("/")},zl=t=>{let o=Hl(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},Om={prism:"text",label:"Text"},Em={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:Om},Vl=(t,o)=>o?Object.values(Em).find(n=>n.prism===o)??{prism:o,label:o}:Em[zl(t)]??Om,Fm=t=>{let o=t,r=0;for(;o>=1024&&r<Am.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${Am[r]}`};var TC=1e3,IC=9,mr=16,Wl=({tone:t,icon:o,title:r,text:n,action:a})=>g("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[f("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:o}),f("div",{className:"orb-omph-pv-notice-title",children:r}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),zm=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:u,onOpenExternally:m})=>{let[f$1,h]=useState(true),[p,v]=useState(false),{open:y,ref:g$1,phase:x,data:b}=t,C=b?.body;useEffect(()=>{if(!p)return;let L=window.setTimeout(()=>v(false),TC);return ()=>window.clearTimeout(L)},[p]),useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g$1?.path]);let k=b?.absolutePath??g$1?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:k,P=w===k?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g$1?Vl(g$1.path,C.language):null,S=[];I&&S.push(I.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g$1&&S.push(zl(g$1.path).toUpperCase()),b?.size!==void 0&&S.push(Fm(b.size)),C?.kind==="code"&&g$1?.startLine!==void 0&&S.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let N=L=>{L.key==="Escape"&&(L.stopPropagation(),l(true));},R=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),T=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:IC},(L,O)=>f("span",{},O))});if(x==="error"||!C)return f(Wl,{tone:"error",icon:f(Ca,{size:mr}),title:a.previewFailed,text:k,action:R});switch(C.kind){case "missing":return f(Wl,{tone:"neutral",icon:f(ka,{size:mr}),title:a.previewMissing,text:C.message??k});case "unsupported":return f(Wl,{tone:"neutral",icon:f(ka,{size:mr}),title:a.previewUnsupported,text:C.message??k,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f(Dm,{text:C.text},g$1.path);case "code":return f(Rm,{text:C.text,language:Vl(g$1.path,C.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:f$1,labels:a},g$1.path);case "image":return f(Nm,{url:C.url,alt:C.alt,labels:a},C.url);case "embed":return f("iframe",{src:C.url,title:C.caption??"Embedded document",className:"orb-omph-pv-embed"},C.url);default:return null}},D=o==="overlay",A=C?.kind==="image"?wc:ka;return g("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":o,role:D?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:N,children:[!D&&y&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[D&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(Sa,{size:mr})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(A,{size:mr})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?Hl(g$1.path):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:Lm(k)})})]}),g("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f$1,onClick:()=>h(L=>!L),children:a.previewWrap}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":p?a.copied:P,title:p?a.copied:P,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:p?f(Ko,{size:mr}):f(hr,{size:mr})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:u,children:f(yc,{size:mr})}),!D&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Yt,{size:mr})})]})]}),f("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:T()})]})]})};var RC=1e3,Vm=50,DC=1e3,NC=t=>t==="tool"?Jr:t==="command"?Fn:Rc,$m=t=>!!t.streaming||t.status==="running"||t.status==="pending",AC=(t,o)=>o==="expanded"?true:$m(t),EC=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),LC=(t,o)=>`${Math.max(1,Math.round(t/DC))}${o.secondUnit}`,OC=({content:t})=>{let o=useRef(null),[r,n]=useState(false);return useEffect(()=>{let a=o.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),f("div",{ref:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},FC=({turn:t,labels:o})=>{let[r,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",l=t.usage;return useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),RC);return ()=>window.clearTimeout(d)},[r]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),EC(l)&&g(e,{children:[f("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),f("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:o.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?f(Ko,{size:14}):f(hr,{size:14})}),a&&l&&g("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&g("span",{children:[o.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&g("span",{children:[o.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&g("span",{children:[o.duration," ",LC(l.durationMs,o)]})]})]})},BC=({item:t,display:o,open:r,onToggle:n})=>{let a=NC(t.kind),i=$m(t),s=o!=="compact"&&!!t.summary,l=r&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[f(Oo,{size:12,className:"orb-omph-process-chevron"}),f(a,{size:14}),f("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&f("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&f(OC,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},$l=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
|
|
20
|
+
`).find(n=>n.trim())??o;return r.length>Vm?`${r.slice(0,Vm)}\u2026`:r},HC=0,_m=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=u=>{if(!i||u.defaultPrevented||u.button!==HC||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;let m=u.target.closest("a[href]");if(!m)return;let f=a(m.getAttribute("href")??"");f&&(u.preventDefault(),i(f,m));};return f(e,{children:t.map((u,m)=>{let f$1=!!(u.assistant&&!u.assistant.streaming),p=m===t.length-1&&f$1?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":u.id,"data-actions-reveal":p,children:[u.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble",children:u.user.content}),f("div",{className:"orb-omph-clock",children:u.user.timestamp.toLocaleTimeString()})]}),u.process&&u.process.length>0&&f("div",{className:"orb-omph-process-list",children:u.process.map(v=>{let y=v.id in s?s[v.id]:AC(v,r);return f(BC,{item:v,display:r,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),u.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(us,{content:u.assistant.content,messageId:u.assistant.id,cardHooks:n}),u.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),u.failure&&f("div",{className:"orb-omph-failure","data-severity":u.failure.severity,children:u.failure.content}),f$1&&f(FC,{turn:u,labels:o})]},u.id)})})};var zC={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,o)=>t===o?`Line ${t}`:`Lines ${t}\u2013${o}`,previewTruncated:(t,o)=>`Showing the first ${t.toLocaleString()} of ${o.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width",newConversation:"New conversation",conversationList:"Conversation list",conversations:"Conversations",noConversations:"No conversations yet"},Um=t=>({...zC,...t}),VC={waiting:"Waiting for approval",choose:"Choose an action",details:"Approval details",choices:"Actions",reject:"Reject",allowOnce:"Allow once",confirm:"Continue",other:"Other",otherPlaceholder:"Describe the action to take",escalation:t=>`Tool ${t} requests privileged execution`},Km=t=>({...VC,...t}),WC=1e3,Gm=60,$C=1e3,qm=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,$C)/WC)),n=Math.floor(r/Gm),a=r%Gm;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var UC={open:false,ref:null,phase:"loading",data:null},Xm=t=>{let[o,r]=useState(UC),n=useRef(o);n.current=o;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),l=useRef(null),d=useCallback(h=>{let p=a.current;if(!p)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;r({open:true,ref:h,phase:"loading",data:null}),p(h,v.signal).then(g=>{y===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),u=useCallback((h,p)=>{l.current=p??null;let v=n.current;if(v.ref?.path===h.path&&v.phase==="ready"){r({...v,open:true,ref:h});return}d(h);},[d]),m=useCallback((h=false)=>{s.current+=1,i.current?.abort(),r(v=>({...v,open:false}));let p=l.current;h&&p?.isConnected&&p.focus({preventScroll:true});},[]),f=useCallback(()=>{let{ref:h}=n.current;h&&d(h);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:u,close:m,reload:f}};var Gl="--orb-omph-pv-w",Ul="--orb-omph-pv-pref",XC=880,YC=560,Zm=400,$r=320,ZC=.45,QC=.7,Qm=24,_l=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),jm=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,u]=useState(false),[m,f]=useState(false);useLayoutEffect(()=>{let P=r.current;if(!P)return;let I=()=>i(P.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(P),()=>S.disconnect()},[]),useEffect(()=>{t||u(false);},[t]);let h=o==="overlay"?false:o==="split"?a>=Zm+$r:a>=XC,p=h&&!d?"split":"overlay",v=Math.max($r,Math.min(a*QC,a-Zm)),y=_l(s??a*ZC,$r,v),g=a>0&&a<YC,x=useCallback(P=>{let I=r.current;I&&(I.style.setProperty(Ul,`${P}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Gl,`${P}px`));},[]),b=useCallback(P=>{P.button===0&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),n.current={pointerId:P.pointerId,startX:P.clientX,startWidth:y,latest:y},f(true));},[y]),C=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(I.latest=_l(I.startWidth+(I.startX-P.clientX),$r,v),x(I.latest));},[v,x]),k=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(n.current=null,P.currentTarget.hasPointerCapture(P.pointerId)&&P.currentTarget.releasePointerCapture(P.pointerId),l(I.latest),f(false));},[]),w=useCallback(P=>{let I={ArrowLeft:y+Qm,ArrowRight:y-Qm,Home:$r,End:v};P.key in I&&(P.preventDefault(),l(_l(I[P.key],$r,v)));},[v,y]);return {mainRef:r,placement:p,width:y,compact:g,dragging:m,expanded:d,canExpand:h,toggleExpanded:()=>u(P=>!P),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":$r,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:b,onPointerMove:C,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var ys=48,JC=900,eg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,tg=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),l=useRef(true),d=useRef({height:0,top:0}),u=useRef(void 0),m=useRef(false),[f,h]=useState(true),[p,v]=useState(false),[y,g]=useState(t[0]?.id),x=useCallback(()=>{let P=i.current;P&&(d.current={height:P.scrollHeight,top:P.scrollTop});},[]),b=useCallback(()=>{let P=i.current;if(!P)return;let I=P.getBoundingClientRect().top,S=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(N=>{N.getBoundingClientRect().top-I<=ys&&(S=N.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let P=i.current,I=s.current;if(!P||!I)return;let S=()=>{v(P.clientWidth>JC),l.current&&(P.scrollTop=P.scrollHeight),x();};S();let N=new ResizeObserver(S);return N.observe(P),N.observe(I),()=>N.disconnect()},[x]),useLayoutEffect(()=>{let P=i.current;if(!P)return;let I=t[0]?.id,S=u.current,N=S!==void 0&&t.some(D=>D.id===S),R=N&&I!==void 0&&I!==S,T=S!==void 0&&!N;if(u.current=I,T){l.current=true,h(true),P.scrollTop=P.scrollHeight,x(),b();return}if(R){l.current=false,h(false);let D=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,D),x(),b();return}l.current&&(P.scrollTop=P.scrollHeight),x(),b();},[o,x,t,b]),useEffect(()=>{n||(m.current=false);},[n]);let C=useCallback(()=>{let P=i.current;if(!P)return;let S=P.scrollHeight-P.scrollTop-P.clientHeight<=ys;S!==l.current&&(l.current=S,h(S)),x(),b();let N=P.scrollHeight-P.clientHeight>ys,R=P.scrollTop<=ys;!N||!R||S||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,b]),k=useCallback(()=>{let P=i.current;P&&(l.current=true,h(true),P.scrollTo({top:P.scrollHeight,behavior:eg()?"auto":"smooth"}));},[]),w=useCallback(P=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);S&&(l.current=false,h(false),S.scrollIntoView({block:"start",behavior:eg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:p,activeTurnId:y,onScroll:C,returnToBottom:k,scrollToTurn:w}};var tx=1e3,ox=(t,o)=>o[t],rx=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),nx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),tx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(qm(Math.max(0,r-t),o));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.working}),f("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),g("span",{className:"orb-omph-running-body",children:[f("span",{className:"orb-omph-spinner","aria-hidden":"true"}),f("span",{className:"orb-omph-shimmer",children:a})]})]})},FH=({turns:t,title:o="OMPH Agent",description:r,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:u,className:m,cardHooks:f$1,hasOlder:h=false,loadingOlder:p=false,onLoadOlder:v,onSend:y,onStop:g$1,onHeaderPointerDown:x,conversations:b=[],activeConversationId:C,onNewConversation:k,onSelectConversation:w,loadFilePreview:P,resolveFileLink:I=Bl,filePreviewLayout:S="auto",onOpenFileExternally:N})=>{let R=Um(s),T=a??(i?"running":"idle"),D=T==="running"||T==="pending",A=[ox(T,R),r].filter(Boolean).join(" \xB7 "),L=useMemo(()=>rx(t),[t]),O=tg({turns:t,contentVersion:L,hasOlder:h,loadingOlder:p,onLoadOlder:v}),[Y,H]=useState(""),q=Y.trim(),V=i&&q.length===0,Z=[...t].reverse().find(se=>!!se.assistant?.streaming||se.process?.some(Ae=>Ae.streaming||Ae.status==="running"||Ae.status==="pending")),z=D?Z?.startedAt:void 0,B=!!P,G=Xm(P),U=jm({open:G.state.open,layout:S}),ge=useRef(null),ie=useRef(null),pe=B&&G.state.open&&U.placement==="overlay",xe=U.placement==="split"&&G.state.open,We={[Ul]:`${U.width}px`,[Gl]:xe?`${U.width}px`:"0px"};useEffect(()=>{ie.current?.toggleAttribute("inert",pe);},[pe]);let we=async()=>{if(!q||!y)return;let se=q;H("");try{await y(se);}catch{H(Ae=>Ae.trim().length===0?se:Ae);}};return g("div",{className:pt("orb-omph-panel",m),"data-omph-panel":"","data-status":T,"data-compact":U.compact||void 0,children:[g("div",{className:pt("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":D||void 0}),f("span",{className:"truncate",children:A||R.idle})]})]}),(k||w||n)&&g("div",{className:"orb-omph-header-actions",onPointerDown:se=>se.stopPropagation(),children:[f(Im,{conversations:b,activeConversationId:C,labels:R,onNewConversation:k,onSelectConversation:w}),n]})]}),g("div",{ref:U.mainRef,className:"orb-omph-main","data-placement":U.placement,"data-open":String(G.state.open),"data-dragging":U.dragging||void 0,style:We,children:[g("div",{ref:ie,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":O.railVisible||void 0,children:[f("div",{ref:O.scrollerRef,className:"orb-omph-scroll",onScroll:O.onScroll,children:g("div",{ref:O.contentRef,className:"orb-omph-column",children:[h&&v&&f("button",{type:"button",className:"orb-omph-older",disabled:p,onClick:v,children:p?R.loadingOlder:R.loadOlder}),f(_m,{turns:t,labels:R,processDisplay:l,cardHooks:f$1,resolveFileLink:I,onOpenFile:B?G.open:void 0}),D&&f(nx,{startedAt:z,labels:R})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":R.turnRail,children:t.map(se=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===se.id||void 0,"aria-label":$l(se),title:$l(se),onClick:()=>O.scrollToTurn(se.id)},se.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":R.toBottom,onClick:O.returnToBottom,children:f(Oo,{size:16})})]}),d&&g("form",{className:"orb-omph-composer",onSubmit:se=>{se.preventDefault(),V?g$1?.():we();},children:[f("textarea",{className:"orb-omph-input",value:Y,placeholder:u,rows:1,onChange:se=>H(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||se.nativeEvent.isComposing||(se.preventDefault(),V?g$1?.():we());}}),f("button",{type:"submit",className:V?"orb-omph-stop":"orb-omph-send","aria-label":V?R.stop:R.send,disabled:!V&&q.length===0,children:V?f(fc,{size:16}):f(gc,{size:16})})]})]}),B&&f(zm,{state:G.state,placement:U.placement,expanded:U.expanded,canExpand:U.canExpand,labels:R,gripProps:U.gripProps,paneRef:ge,onClose:G.close,onRetry:G.reload,onToggleExpand:U.toggleExpanded,onOpenExternally:N})]})]})};var gr="other",ax=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,ix=({request:t,onDecide:o,labels:r})=>{let n=Km(r),a=useRef(null),i=useRef(null),s=useRef(false),l=useRef(false),[d,u]=useState(false),[m,f$1]=useState(null),[h,p]=useState(""),v=t.choices??[],y=t.allowOther??v.length>0,g$1=v.length>0||y,x=t.reason?.trim()||n.escalation(t.toolName),b=t.detail?.trim(),C=m===gr&&h.trim().length>0,k=!g$1||m!==null&&m!==gr||C;useEffect(()=>{u(false),f$1(null),p(""),a.current?.focus();},[t.id]),useEffect(()=>{m===gr&&i.current?.focus();},[m]);let w=S=>{d||(u(true),o(S,t));},P=()=>{if(k){if(!g$1){w({kind:"allowed-once"});return}if(m===gr){let S=h.trim();if(!S)return;w({kind:"other",text:S});return}m&&w({kind:"choice",choiceId:m});}},I=S=>{if(!(d||ax(S.target))&&!(S.key!=="Enter"&&S.key!=="Escape")&&!(S.key==="Enter"&&S.target instanceof HTMLElement&&S.target.closest('button, a[href], [role="button"]'))&&!(S.ctrlKey||S.metaKey||S.altKey||S.shiftKey)&&(S.preventDefault(),S.stopPropagation(),!(S.repeat||s.current||l.current||S.nativeEvent.isComposing))){if(S.key==="Escape"){w({kind:"rejected"});return}P();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":d,onKeyDown:I,onKeyUpCapture:()=>{l.current=false;},onCompositionStartCapture:()=>{s.current=true;},onCompositionEndCapture:()=>{s.current=false,l.current=true;},children:g("div",{className:"orb-omph-approval-card",children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),g$1?n.choose:n.waiting]}),g("div",{ref:a,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":n.details,children:[f("div",{className:"orb-omph-approval-headline",children:x}),b&&f("div",{className:"orb-omph-approval-detail",children:b}),g$1&&g("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[f("legend",{className:"orb-visually-hidden",children:n.choices}),v.map(S=>{let N=m===S.id;return g("label",{className:"orb-omph-approval-choice","data-selected":N,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:S.id,checked:N,onChange:()=>f$1(S.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:S.label}),S.description&&f("span",{className:"orb-omph-approval-choice-description",children:S.description})]})]},S.id)}),y&&g("label",{className:"orb-omph-approval-choice","data-selected":m===gr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:gr,checked:m===gr,onChange:()=>f$1(gr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:n.other})})]}),y&&m===gr&&f("textarea",{ref:i,className:"orb-omph-approval-other",value:h,placeholder:n.otherPlaceholder,rows:3,"aria-label":n.other,onChange:S=>p(S.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:d,onClick:()=>w({kind:"rejected"}),children:n.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!k,onClick:P,children:g$1?n.confirm:n.allowOnce})]})]})})};var lg=520,cx=88,dx=88,px=24,xs=640,cg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Xl=t=>typeof t=="number"?`${t}px`:t,ux=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,qH=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=lg,top:a=cx,bottom:i=dx,inset:s=px,zIndex:l=1300,shellClassName:d,shellStyle:u,className:m,onHeaderPointerDown:f$1,...h})=>{let p=useRef(null),v=useRef(null),[y,g]=useState(o),[x,b]=useState(0),[C,k]=useState(typeof n=="number"?n:lg),[w,P]=useState(0),[I,S]=useState(false),N=t??y;useEffect(()=>{let H=()=>b(window.innerWidth);return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),useLayoutEffect(()=>{let H=()=>{let V=p.current?.getBoundingClientRect();V?.width?k(V.width):typeof n=="number"&&k(n);};if(H(),!p.current||typeof ResizeObserver>"u")return;let q=new ResizeObserver(H);return q.observe(p.current),()=>q.disconnect()},[n]);let R=useCallback(H=>{if(!x)return s;let q=x<xs?12:s,V=Math.max(q,x-C-q);return x<xs||H==="left"?q:H==="center"?cg((x-C)/2,q,V):V},[s,C,x]),T=useCallback(H=>["left","center","right"].reduce((V,Z)=>{let z=Math.abs(H-R(V));return Math.abs(H-R(Z))<z?Z:V},"right"),[R]),D=useCallback(H=>{t===void 0&&g(H),r?.(H);},[t,r]);useEffect(()=>{I||P(R(N));},[R,I,N]);let A=useCallback(H=>{f$1?.(H),!(H.defaultPrevented||ux(H.target))&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),v.current={pointerId:H.pointerId,startClientX:H.clientX,startX:w,currentX:w,captureElement:H.currentTarget},S(true));},[f$1,w]),L=useCallback(H=>{let q=v.current;if(!q||q.pointerId!==H.pointerId)return;let V=x<xs?12:s,Z=Math.max(V,x-C-V),z=cg(q.startX+H.clientX-q.startClientX,V,Z);q.currentX=z,P(z);},[s,C,x]),O=useCallback(H=>{let q=v.current;if(!q||q.pointerId!==H.pointerId)return;try{q.captureElement.releasePointerCapture(H.pointerId);}catch{}let V=T(q.currentX);v.current=null,S(false),D(V),P(R(V));},[R,D,T]),Y=useMemo(()=>({position:"fixed",top:Xl(a),bottom:Xl(i),left:w,width:Xl(n),maxWidth:`calc(100vw - ${x<xs?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,I,w,u,a,x,n,l]);return f("div",{ref:p,className:pt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":N,"data-dragging":I?"true":"false",style:Y,onPointerMove:L,onPointerUp:O,onPointerCancel:O,children:f(Pm,{...h,className:m,onHeaderPointerDown:A})})};var fx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},tz=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:u,onPlusClick:m,onMicClick:f$1,streamIntervalMs:h,streamChunkSize:p,onMessageStreamingComplete:v,cardHooks:y})=>{let[g$1,x]=useState(""),[b,C]=useState(false),k=useRef(null),w=fx[l];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await o(S));},[n,o,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!b&&(S.preventDefault(),await P());},[P,b]);return g("div",{className:pt("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&f("button",{onClick:d,className:pt("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:f("span",{className:pt("block h-4 w-4 border-[var(--orb-ai-accent)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:u,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,N)=>{let R=S.type==="assistant"&&N===t.length-1,T=S.type==="assistant"?{isLatestAssistant:R,isResponding:n,onRegenerate:r?()=>r(S.id):void 0}:void 0;return f(ms,{message:S,assistantActions:T,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:h,streamChunkSize:p,cardHooks:y},S.id)}),f("div",{ref:k})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:m,type:"button","aria-label":"Add",children:f(jr,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f$1,type:"button","aria-label":"Microphone",children:f(Ma,{className:"h-4 w-4"})})]})})]})};var hx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],bx=`
|
|
21
21
|
.orbcafe-ai-browser-glow {
|
|
22
22
|
position: fixed;
|
|
23
23
|
inset: 0;
|
|
@@ -49,4 +49,4 @@ ${o}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1
|
|
|
49
49
|
0%, 100% { opacity: 0.5; }
|
|
50
50
|
50% { opacity: 1; }
|
|
51
51
|
}
|
|
52
|
-
`,qH=({active:t=false,colors:r=dx,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return g(e,{children:[f("style",{children:px}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var sz=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),p=useCallback(m=>d(()=>r?.(m)),[r,d]),u=useCallback(m=>d(()=>o?.(m)),[o,d]),f=useCallback(m=>d(()=>n?.(m)),[n,d]),h=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:u,onForgotPassword:f}),[f,p,u,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:h}};var gx={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},hz=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let u=t!==void 0,[f$1,h]=useState(r),m=t??f$1,v=useMemo(()=>({...gx,...d}),[d]),[y,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,P]=useState({email:""}),[w,k]=useState(""),I=D=>{u||h(D),k(""),o?.(D);},S=async D=>{D.preventDefault(),await n?.(y),k("Demo login accepted. No real authentication request was sent.");},A=async D=>{D.preventDefault(),await a?.(x),k("Demo registration saved locally for this screen.");},R=async D=>{D.preventDefault(),await i?.(C),k("Demo reset link request created. No email was sent.");},T=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,N=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:p,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:v.headline}),f("p",{children:v.subheadline})]}),f("div",{className:"orb-auth-meta",children:v.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:T}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:N}),w&&f(en,{severity:"success",children:w}),m==="login"&&g("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:D=>g$1(L=>({...L,username:D.target.value})),startAdornment:f(Ns,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:D=>g$1(L=>({...L,password:D.target.value})),startAdornment:f(Ta,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Rt,{label:"Remember me",checked:y.remember,onChange:D=>g$1(L=>({...L,remember:D.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),m==="register"&&g("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:D=>b(L=>({...L,name:D.target.value})),startAdornment:f(Ns,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:D=>b(L=>({...L,email:D.target.value})),startAdornment:f(Ds,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:D=>b(L=>({...L,password:D.target.value})),startAdornment:f(Ta,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:D=>b(L=>({...L,confirmPassword:D.target.value}))}),f(Rt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:D=>b(L=>({...L,acceptedTerms:D.target.checked}))}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),m==="forgot"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:D=>P({email:D.target.value}),startAdornment:f(Ds,{size:15,strokeWidth:1.8})}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(ye,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var hx={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},bx=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],dg=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:u,layout:f,columns:h,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:C,onFilterVariantLoad:P,enableRowReorder:w,onTaskReorder:k,onLayoutIdChange:I,onLayoutSave:S})=>{let A=r??l??"planning-gantt",R=o??d??"planning",[T,N]=useState(n),[D,L]=useState(a??t[0]?.id??""),[B,X]=useState(""),[H,K]=useState(null),[W,G]=useState({...hx,...i}),z=useMemo(()=>{let se=String(W.keyword?.value??"").trim().toLowerCase(),fe=String(W.status?.value??"").trim(),Ge=String(W.owner?.value??"").trim().toLowerCase(),Re=String(W.workCenter?.value??"").trim().toLowerCase(),ke=W.dateRange?.value,ze=ke?.[0]?eo(ke[0]):null,Pe=ke?.[1]?eo(ke[1]):null;return t.filter(Ce=>{if(se&&![Ce.id,Ce.code,Ce.title,Ce.project,Ce.workCenter,Ce.owner?.name].join(" ").toLowerCase().includes(se)||fe&&Ce.status!==fe||Ge&&!String(Ce.owner?.name??"").toLowerCase().includes(Ge)||Re&&!String(Ce.workCenter??"").toLowerCase().includes(Re))return false;if(ze||Pe){let Ve=eo(Ce.startDate),rt=eo(Ce.endDate),at=ze?rt.isAfter(ze)||rt.isSame(ze,"day"):true,Ye=Pe?Ve.isBefore(Pe)||Ve.isSame(Pe,"day"):true;if(!at||!Ye)return false}return true})},[W,t]);useEffect(()=>{z.length!==0&&(z.some(se=>se.id===D)||L(z[0].id));},[z,D]);let O=useCallback(se=>{L(se.id);},[]),Y=useCallback(se=>{X(se),I?.(se);},[I]),Q=useCallback(se=>{K(fe=>({key:(fe?.key??0)+1,variant:se})),P?.(se);},[P]),me=useMemo(()=>({appId:A,tableKey:R,fields:s??bx,filters:W,onFilterChange:G,onVariantLoad:Q,onSearch:C??(()=>{}),currentLayoutId:B,layoutRefs:[{tableKey:R,layoutId:B||null}],variantService:u,serviceUrl:p}),[B,s,W,Q,C,A,R,p,u]),ie=useMemo(()=>({appId:A,tableKey:R,serviceUrl:p,tasks:z,columns:h,scale:T,onScaleChange:N,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:D,onTaskSelect:O,enableRowReorder:w,onTaskReorder:k,layout:f,layoutVariant:H?.variant,layoutVariantLoadKey:H?.key,onLayoutIdChange:Y,onLayoutSave:S}),[h,g,w,z,Y,f,H?.key,H?.variant,x,b,S,k,O,m,A,R,v,y,T,p,D]);return {scale:T,setScale:N,selectedTaskId:D,setSelectedTaskId:L,filters:W,setFilters:G,filteredTasks:z,smartFilterProps:me,planningGanttProps:ie}};var kz=t=>{let r=dg(t),o=useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};eo.extend(yx);var Ql=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],jl=36,Jl=58,va=8,ec=260,Tx=320,Go="220ms cubic-bezier(0.2, 0, 0, 1)",pg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},Ix=t=>t?pg[t]?.label??t:"Planned",Mx=t=>t?pg[t]?.color??"default":"info",ug=t=>Math.min(100,Math.max(0,t??0)),mg=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...mg(o.children??[],r+1)]),Rx=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:Ix(t.status),statusTone:t.status??"planned",progress:ug(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),gg=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),fg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),Dx=(t,r,o)=>{let n=[],a=gg(t,o),i=fg(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},tc=(t,r,o)=>{let n=0;for(let a of r){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*o}n+=o;}return n},hg=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:p,page:u,rowsPerPage:f$1=20,rowsPerPageOptions:h=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g$1,timelineEnd:x,selectedTaskId:b$1,onTaskSelect:C,enableRowReorder:P=true,onTaskReorder:w,layout:k,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:A,onLayoutSave:R,emptyLabel:T="No planning tasks available.",sx:N})=>{let D=ar(),{t:L}=de(),B=useRef(null),X=useRef(null),H=useRef(null),K=useRef(false),[W,G]=useState(null),[z,O]=useState("content"),[Y,Q]=useState(null),[me,ie]=useState(0),[se,fe]=useState({}),[Ge,Re]=useState(jl),[ke,ze]=useState([]),Pe=useRef(void 0),[Ce,Ve]=useState({activeId:null,overId:null}),[rt,at]=useState(null),[Ye,_]=useState(false),Oe=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ve=useRef(null),Ee=useMemo(()=>mg(s),[s]),it=useMemo(()=>{if(ke.length===0)return Ee;let F=new Map(Ee.map(xe=>[xe.id,xe])),Z=ke.map(xe=>F.get(xe)).filter(xe=>!!xe),ue=new Set(Z.map(xe=>xe.id));return [...Z,...Ee.filter(xe=>!ue.has(xe.id))]},[Ee,ke]),je=useMemo(()=>new Map(it.map(F=>[F.id,F])),[it]),ht=useMemo(()=>it.map(F=>Rx(F)),[it]),xt=useMemo(()=>new Map(ht.map(F=>[F.id,F])),[ht]),At=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,Z)=>g(ae,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Z.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:Z.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,Z)=>f(kt,{label:Z.status,color:Mx(Z.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ae,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(Bn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Et=useMemo(()=>{if(!l||l.length===0)return At;let F=new Map(At.map(Z=>[Z.id,Z]));return l.map(Z=>{let ue=F.get(Z.id),xe=Z.width??ue?.minWidth??120,et={id:Z.id,label:Z.label,minWidth:xe};if(ue?.numeric&&(et.numeric=true),Z.render){let qe=Z.render;return et.render=(Tt,gt)=>{let mt=je.get(gt.id);return qe(mt||gt)},et}return ue?.render?(et.render=ue.render,et):(et.render=(qe,Tt)=>{let gt=Tt[Z.id];if(gt!=null&&String(gt).length>0)return String(gt);let wt=je.get(Tt.id)?.[Z.id];return wt!=null&&String(wt).length>0?String(wt):"-"},et)})},[l,At,je]),te=gn({appId:t,tableKey:r,title:n,columns:Et,rows:ht,rowKey:"id",page:u,rowsPerPage:f$1,rowsPerPageOptions:h,count:m??ht.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:k,onLayoutSave:R}),ot=t?f(mn,{appId:t,tableKey:r,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:o}):null,Fe=te.visibleRows;useEffect(()=>{let F=Ee.map(Z=>Z.id);ze(Z=>{let ue=new Set(F),xe=Z.filter(gt=>ue.has(gt)),et=new Set(xe),qe=F.filter(gt=>!et.has(gt)),Tt=[...xe,...qe];return Tt.length===Z.length&&Tt.every((gt,mt)=>gt===Z[mt])?Z:Tt});},[Ee]),useEffect(()=>{S===void 0||!I||Pe.current!==S&&(Pe.current=S,te.handleVariantLoad(I));},[te,I,S]),useEffect(()=>{A?.(te.currentLayoutId);},[te.currentLayoutId,A]);let le=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,ge=useMemo(()=>{let F=ht.map(mt=>eo(mt.startDate)),Z=ht.map(mt=>eo(mt.endDate)),ue=g$1?eo(g$1):F.reduce((mt,wt)=>wt.isBefore(mt)?wt:mt,F[0]??eo()),xe=x?eo(x):Z.reduce((mt,wt)=>wt.isAfter(mt)?wt:mt,Z[0]??eo().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Tt=d==="hour"?12:1,gt=d==="hour"?12:1;return {start:gg(ue.subtract(Tt,et),d),end:fg(xe.add(gt,qe),d)}},[ht,d,x,g$1]),J=Ql.find(F=>F.value===d)??Ql[1],Te=Array.isArray(a)?a:a?[a]:[],Ie=useMemo(()=>Dx(ge.start,ge.end,d),[ge.end,ge.start,d]),Ze=Ie.length*J.width,ut=Ie.length>0?100/Ie.length:100,dt=Ie.length>0?`repeat(${Ie.length}, minmax(${J.width}px, 1fr))`:"1fr",Lt=Ie.length>0?`calc(100% / ${Ie.length}) 100%`:"100% 100%",_t=(te.columns||[]).filter(F=>te.visibleColumns.includes(F.id)).reduce((F,Z)=>F+(te.columnWidths?.[Z.id]||Z.minWidth||100),0)+(te.grouping.length>0?72:0),bt=z==="manual"&&W!==null?W:_t,ft=Y==="table",yr=Y==="timeline",Pt=Y==="timeline",Ot=Y==="table",pt=!Pt&&!Ot,Ft=()=>{let F=me||B.current?.clientWidth||0;return F>0?Math.max(ec,F-va-Tx):Math.max(ec,_t)},Se=F=>Math.min(Math.max(F,ec),Ft()),q=(()=>{if(me<=0)return null;let F=pt?va:0;if(ft)return {tableWidth:me,splitterWidth:F,timelineWidth:0};if(yr)return {tableWidth:0,splitterWidth:F,timelineWidth:me};if(z==="even"){let ue=Math.max(0,(me-F)/2);return {tableWidth:ue,splitterWidth:F,timelineWidth:Math.max(0,me-F-ue)}}let Z=Se(bt);return {tableWidth:Z,splitterWidth:F,timelineWidth:Math.max(0,me-F-Z)}})(),ee=q?`${q.tableWidth}px ${q.splitterWidth}px ${q.timelineWidth}px`:ft?"minmax(0, 1fr) 0px 0px":yr?"0px 0px minmax(0, 1fr)":z==="even"?`minmax(0, 1fr) ${va}px minmax(0, 1fr)`:`${bt}px ${va}px minmax(0, 1fr)`;useEffect(()=>{z==="manual"&&G(F=>F===null?null:Se(F));},[z,_t,me]);let De=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),Q(null),O("manual"),ve.current={startX:F.clientX,startWidth:X.current?.getBoundingClientRect().width??bt};let Z=xe=>{let et=ve.current;if(!et)return;let qe=Se(et.startWidth+xe.clientX-et.startX);G(qe);},ue=()=>{ve.current=null,window.removeEventListener("pointermove",Z),window.removeEventListener("pointerup",ue),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Z),window.addEventListener("pointerup",ue);},he=()=>{Q(null),O("even"),G(null);},Ne=F=>!P||!F?false:xt.get(F)?.reorderable!==false,_e=(F,Z)=>{if(!F||!Z||F===Z||!Ne(F)||!Ne(Z))return false;if(te.grouping.length===0)return true;let ue=xt.get(F),xe=xt.get(Z);return !ue||!xe?false:te.grouping.every(et=>ue[et]===xe[et])},Je=(F,Z)=>{if(!_e(F,Z))return;let ue=Fe.filter(Bt=>Bt.type!=="group").map(Bt=>String((Bt.data||Bt)?.id)),xe=ue.indexOf(F),et=ue.indexOf(Z);if(xe<0||et<0)return;let qe=[...ue];[qe[xe],qe[et]]=[qe[et],qe[xe]];let Tt=new Set(ue),gt=it.map(Bt=>Bt.id),mt=[...qe,...gt.filter(Bt=>!Tt.has(Bt))],wt=je.get(F),rr=je.get(Z);if(te.setOrder("asc"),te.setOrderBy(""),ze(mt),wt&&rr){let{level:Bt,...qt}=wt,{level:zt,...Ut}=rr,Wt=mt.reduce((er,or)=>{let ur=je.get(or);if(ur){let{level:Pr,...Tr}=ur;er.push(Tr);}return er},[]);w?.(Wt,{activeTask:qt,targetTask:Ut});}},Ue=(F,Z)=>{if(!Ne(Z.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",Z.id),Ve({activeId:Z.id,overId:null}),C?.(je.get(Z.id)||Z);},vt=(F,Z)=>{if(!_e(Ce.activeId,Z)){Ve(ue=>ue.overId===null?ue:{...ue,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",Ve(ue=>ue.overId===Z?ue:{...ue,overId:Z});},Dt=(F,Z)=>{let ue=Ce.activeId||F.dataTransfer.getData("text/plain");if(!_e(ue,Z)){Ve({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Je(ue,Z),Ve({activeId:null,overId:null});},St=()=>{Ve({activeId:null,overId:null});},yt=F=>{if(K.current)return;let Z=F==="table"?X.current:H.current,ue=F==="table"?H.current:X.current;!Z||!ue||(K.current=true,ue.scrollTop=Z.scrollTop,window.requestAnimationFrame(()=>{K.current=false;}));};return useLayoutEffect(()=>{let F=B.current;if(!F){ie(0);return}let Z=0,ue=()=>{window.cancelAnimationFrame(Z),Z=window.requestAnimationFrame(()=>{let et=F.clientWidth;ie(qe=>Math.abs(qe-et)<.5?qe:et);});};if(ue(),typeof ResizeObserver>"u")return window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Z),window.removeEventListener("resize",ue);};let xe=new ResizeObserver(ue);return xe.observe(F),window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Z),xe.disconnect(),window.removeEventListener("resize",ue);}},[ht.length]),useLayoutEffect(()=>{if(!b$1||Ot)return;let F=H.current,Z=X.current;if(!F)return;let ue=`row-${b$1}`,xe=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(Tt=>Tt.dataset.planningTimelineRowKey===ue),et=xt.get(b$1);if(!xe||!et)return;let qe=window.requestAnimationFrame(()=>{let Tt=F.getBoundingClientRect(),gt=xe.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-Ge),wt=F.scrollTop+gt.top-Tt.top-Ge-(mt-gt.height)/2;K.current=true,F.scrollTop=Math.max(0,wt),Z&&!Pt&&(Z.scrollTop=F.scrollTop);let rr=Math.max(1,F.scrollWidth),Bt=Ie.length>0?rr/Ie.length:J.width,qt=tc(eo(et.startDate),Ie,Bt),zt=Math.max(0,qt-Bt);F.scrollLeft=Math.min(zt,Math.max(0,rr-F.clientWidth)),window.requestAnimationFrame(()=>{K.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[J.width,Ge,b$1,Pt,xt,Ot,Fe,Ie]),useLayoutEffect(()=>{let F=X.current;if(!F)return;let Z=0,ue=0,xe=false,et=()=>{if(xe)return;let zt=F.querySelector("thead"),Ut=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let Wt=zt?.getBoundingClientRect().height||jl,er={};Ut.forEach(or=>{let ur=or.dataset.ctableRowKey;ur&&(er[ur]=or.getBoundingClientRect().height);}),Re(or=>Math.abs(or-Wt)<.01?or:Wt),fe(or=>{let ur=Object.keys(or),Pr=Object.keys(er);return ur.length===Pr.length&&Pr.every(Tr=>Math.abs((or[Tr]??0)-er[Tr])<.01)?or:er});},qe=()=>{window.cancelAnimationFrame(Z),Z=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(ue),ue=window.requestAnimationFrame(()=>{ue=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{xe||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{xe=true,window.cancelAnimationFrame(Z),window.cancelAnimationFrame(ue),window.removeEventListener("resize",qe);};let Tt=new ResizeObserver(qe),gt=F.querySelector("table"),mt=F.querySelector("tbody"),wt=F.querySelector("thead");gt&&Tt.observe(gt),wt&&Tt.observe(wt);let rr=new WeakSet,Bt=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(zt=>{rr.has(zt)||(Tt.observe(zt),rr.add(zt));});};Bt();let qt=null;return mt&&typeof MutationObserver<"u"&&(qt=new MutationObserver(()=>{Bt(),qe();}),qt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{xe=true,window.cancelAnimationFrame(Z),window.cancelAnimationFrame(ue),Tt.disconnect(),qt?.disconnect(),window.removeEventListener("resize",qe);}},[Fe,te.visibleColumns,te.grouping,te.columnWidths]),g(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${D.palette.divider}`,...N},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(li,{value:te.filterText,onChange:F=>{te.setFilterText(F),te.setPage(0);}}),f(si,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:h,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),Te.length>0&&f("div",{className:"orb-table-toolbar-custom",children:Te.map((F,Z)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${Z}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ne,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>te.setAnchorEl(F.currentTarget),sx:lr,children:f(nn,{fontSize:"small"})}),f(ne,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>te.setGroupAnchorEl(F.currentTarget),sx:lr,children:f(Co,{fontSize:"small"})}),f(ne,{className:`orb-table-tool-button ${te.sortBy.length>0||te.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:te.sortBy.length>0||!!te.orderBy,onClick:()=>_(true),sx:lr,children:f(Qd,{fontSize:"small"})})]}),ot&&f("div",{className:"orb-table-tool-group",children:ot}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(Hn,{"aria-label":"Planning pane layout",size:"small",value:Y??(z==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(oi,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(ei,{fontSize:"small"})}],onValueChange:F=>{F==="split"?he():Q(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(Vt,{label:"",value:d,options:Ql.map(F=>({value:F.value,label:F.label})),onChange:F=>p?.(F.target.value)})})]})]})}),ht.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:T}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:B,sx:{height:"100%",display:"grid",gridTemplateColumns:ee,minWidth:0,transition:`grid-template-columns ${Go}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:X,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Pt?0:1,transform:Pt?"translateX(-10px)":"translateX(0)",pointerEvents:Pt?"none":"auto",transition:`opacity ${Go}, transform ${Go}`},children:f(DndContext,{sensors:Oe,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let Z=F?.active?.id,ue=F?.over?.id;typeof Z=="string"&&typeof ue=="string"&&te.handleColumnReorder(Z,ue);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:_t,"& thead th":{height:jl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(pi,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(F,Z)=>{F.preventDefault(),F.stopPropagation(),at({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:Z});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),f(ui,{visibleRows:Fe,columns:te.columns,visibleColumns:te.visibleColumns,selected:b$1?[b$1]:[],expandedGroups:te.expandedGroups,toggleGroupExpand:te.toggleGroupExpand,handleExpandGroupRecursively:te.handleExpandGroupRecursively,handleCollapseGroupRecursively:te.handleCollapseGroupRecursively,isGroupFullyExpanded:te.isGroupFullyExpanded,grouping:te.grouping,rowKeyProp:"id",page:te.page,rowsPerPage:te.rowsPerPage,emptyLabel:T,handleClick:(F,Z)=>{C?.(je.get(Z.id)||Z);},getRowDataKey:({entry:F})=>le(F),getGroupRowProps:()=>({style:{height:Jl}}),getRowProps:({data:F})=>{let Z=F,ue=Ne(Z.id),xe=Ce.activeId===Z.id,et=Ce.overId===Z.id&&_e(Ce.activeId,Z.id);return {draggable:ue,className:et?"orb-is-drop-target":void 0,style:{cursor:xe?"grabbing":ue?"grab":C?"pointer":"default",height:Jl,opacity:xe?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ue(qe,Z),onDragOver:qe=>vt(qe,Z.id),onDragEnter:qe=>vt(qe,Z.id),onDrop:qe=>Dt(qe,Z.id),onDragEnd:St}}})]})})}),f("div",{onPointerDown:pt?De:void 0,role:"separator","aria-orientation":"vertical",sx:{width:pt?va:0,cursor:pt?"col-resize":"default",opacity:pt?1:0,pointerEvents:pt?"auto":"none",borderLeft:pt?`1px solid ${D.palette.divider}`:"0 solid transparent",borderRight:pt?`1px solid ${D.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Go}, opacity ${Go}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:D.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:pt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ot?0:1,transform:Ot?"translateX(10px)":"translateX(0)",pointerEvents:Ot?"none":"auto",transition:`opacity ${Go}, transform ${Go}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:H,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:Ze||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:dt,height:Ge,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ie.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${D.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(ae,{sx:{position:"relative"},children:Fe.map(F=>{let Z=le(F),ue=se[Z]??Jl;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":Z,sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`}},F.id);let xe=F.data||F,et=eo(xe.startDate),qe=eo(xe.endDate),Tt=tc(et,Ie,ut),gt=tc(qe,Ie,ut),mt=Math.max(0,gt-Tt),wt=ug(xe.progress),rr=xe.id===b$1,Bt=Ne(xe.id),qt=Ce.activeId===xe.id,zt=Ce.overId===xe.id&&_e(Ce.activeId,xe.id),Ut=xe.color??(xe.statusTone==="blocked"?D.palette.error.main:D.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${rr?"orb-is-selected":""}`,"data-planning-timeline-row-key":Z,draggable:Bt,onDragStart:Wt=>Ue(Wt,xe),onDragOver:Wt=>vt(Wt,xe.id),onDragEnter:Wt=>vt(Wt,xe.id),onDrop:Wt=>Dt(Wt,xe.id),onDragEnd:St,onClick:()=>C?.(je.get(xe.id)||xe),sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`,opacity:qt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:D.palette.primary.main,opacity:zt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Lt,cursor:qt?"grabbing":Bt?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:f(st,{title:`${xe.title}: ${et.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${Tt}%`,top:Math.max(8,(ue-24)/2),width:`max(18px, ${mt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:rr?`2px solid ${D.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${wt}%`,backgroundColor:Ut}}),f(E,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:xe.code})]})})},xe.id)})})]})})})]})}),f(ln,{groupAnchorEl:te.groupAnchorEl,setGroupAnchorEl:te.setGroupAnchorEl,grouping:te.grouping,setGrouping:te.setGrouping,columns:te.columns}),f(cn,{anchorEl:te.anchorEl,setAnchorEl:te.setAnchorEl,columns:te.columns,visibleColumns:te.visibleColumns,toggleColumnVisibility:te.toggleColumnVisibility}),f(fp,{contextMenu:rt,handleClose:()=>at(null),columns:te.columns,visibleColumns:te.visibleColumns,grouping:te.grouping,summaryColumns:te.summaryColumns,showSummary:te.showSummary,sortBy:te.sortBy,orderBy:te.orderBy,order:te.order,onSortAsc:F=>{te.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{te.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let Z=te.sortBy.filter(ue=>ue.field!==F);Z.length>0?te.applyMultiSort(Z):(te.clearMultiSort(),te.orderBy===F&&te.setOrderBy(""));},onHideColumn:F=>{te.visibleColumns.includes(F)&&te.toggleColumnVisibility(F);},onToggleGroup:F=>te.toggleGroupField(F),onToggleSummary:F=>te.toggleSummaryColumn(F),onOpenSortDialog:()=>_(true)}),f(hp,{open:Ye,onClose:()=>_(false),columns:te.columns,initialRules:te.sortBy.length>0?te.sortBy:te.orderBy?[{field:te.orderBy,direction:te.order}]:[],onApply:F=>te.applyMultiSort(F),onClear:()=>{te.clearMultiSort(),te.setOrderBy("");}})]})};var o5=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return g(ae,{spacing:o,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(zr,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(hg,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};var bg=640,Nx=360,Ax=360,Ps=8,Rn="220ms cubic-bezier(0.2, 0, 0, 1)",nc=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...nc(i,r,o+1,[...n,a.id])]:s}),yg=t=>t.flatMap(r=>[r,...yg(r.children??[])]),Cg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...Cg(a,r+1,[...o,n.id])]}),xg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...xg(o)]}),vg=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),g5=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:u,defaultPaneMode:f$1="split",minTreePaneWidth:h=Nx,minDetailPaneWidth:m=Ax,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g$1,filterConfig:x,searchQuery:b$1,searchToken:C,defaultRowsPerPage:P=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:k,emptyLabel:I="No tree items available.",headerAction:S,sx:A,className:R})=>{let T=ar(),N=useRef(null),D=useRef(null),L=useRef(null),[B,X]=useState(s??o[0]?.id??null),[H,K]=useState(p??xg(o).slice(0,3)),[W,G]=useState(f$1),[z,O]=useState(bg),[Y,Q]=useState(0),[me,ie]=useState(0),[se,fe]=useState(P),Ge=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:le=>g(ae,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:le.label}),le.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:le.subtitle})]})}],[n]),Re=useMemo(()=>new Set(d??H),[d,H]),ke=useMemo(()=>nc(o,Re),[o,Re]),ze=useMemo(()=>yg(o),[o]),Pe=useMemo(()=>Cg(o),[o]),Ce=i===void 0?B:i,Ve=useMemo(()=>ze.find(le=>le.id===Ce)??null,[Ce,ze]),rt=le=>{let ge=D.current?.clientWidth??0,J=ge>0?Math.max(h,ge-Ps-m):Math.max(h,le);return Math.min(Math.max(le,h),J)},at=W==="detail",Ye=W==="tree"||!a,_=W==="split"&&!!a,ve=(()=>{if(Y<=0)return null;if(W==="tree"||!a)return {treeWidth:Y,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Y};let le=_?Ps:0,ge=rt(z);return {treeWidth:ge,splitterWidth:le,detailWidth:Math.max(0,Y-le-ge)}})(),Ee=ve?`${ve.treeWidth}px ${ve.splitterWidth}px ${ve.detailWidth}px`:W==="tree"||!a?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${z}px) ${Ps}px minmax(${m}px, 1fr)`;useEffect(()=>{let le=D.current;if(!le){Q(0);return}let ge=0,J=()=>{window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{let Ie=le.clientWidth;Q(Ze=>Math.abs(Ze-Ie)<.5?Ze:Ie);});};if(J(),typeof ResizeObserver>"u")return window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(ge),window.removeEventListener("resize",J);};let Te=new ResizeObserver(J);return Te.observe(le),window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(ge),Te.disconnect(),window.removeEventListener("resize",J);}},[]);let it=le=>{d===void 0&&K(le),u?.(le);},je=le=>{let ge=new Set(Re);ge.has(le)?ge.delete(le):ge.add(le),it(Array.from(ge));},ht=le=>{i===void 0&&X(le.id),l?.(le);};useEffect(()=>{ie(0);},[o]),useEffect(()=>{let le=b$1?.trim().toLowerCase();if(!le)return;let ge=Pe.find(({node:dt})=>vg(dt).includes(le));if(!ge)return;let J=new Set(Re);ge.parentIds.forEach(dt=>J.add(dt)),it(Array.from(J)),ht(ge.node);let Ie=nc(o,J).findIndex(({node:dt})=>dt.id===ge.node.id);Ie>=0&&se>0&&ie(Math.floor(Ie/se));let Ze=0,ut=0;return Ze=window.requestAnimationFrame(()=>{ut=window.requestAnimationFrame(()=>{let dt=N.current?.querySelector("tr.orb-selected"),Lt=dt?.closest(".orb-table-container");if(dt&&Lt){let _t=Lt.getBoundingClientRect(),bt=dt.getBoundingClientRect(),ft=bt.top-_t.top+Lt.scrollTop;Lt.scrollTo({top:ft-Lt.clientHeight/2+bt.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Ze),window.cancelAnimationFrame(ut);}},[b$1,C,Pe,o,se]);let xt=useMemo(()=>ke.map(({node:le,level:ge,hasChildren:J})=>({...le,id:le.id,__node:le,__level:ge,__hasChildren:J,__expanded:Re.has(le.id),__searchText:vg(le)})),[Re,ke]),At=useMemo(()=>Ge.map((le,ge)=>({id:le.id,label:le.label,minWidth:typeof le.width=="number"?le.width:le.minWidth??(ge===0?320:120),numeric:le.numeric??le.align==="right",render:(J,Te)=>{let Ie=Te.__node,Ze=le.render?le.render(Ie):Ie[le.id];if(ge!==0)return f(we,{sx:{minWidth:0,color:le.align==="right"?"text.primary":"text.secondary",fontWeight:le.align==="right"?750:500,textAlign:le.align??"left"},children:Ze});let ut=Number(Te.__level??0),dt=!!Te.__hasChildren,Lt=!!Te.__expanded;return g(ae,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${ut*24}px`},children:[f(ne,{tooltip:dt?Lt?"Collapse":"Expand":"",onClick:_t=>{_t.stopPropagation(),dt&&je(Ie.id);},disabled:!dt,sx:{width:24,height:24,visibility:dt?"visible":"hidden",transform:Lt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Hr,{sx:{fontSize:20}})}),f(we,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ie.markerColor??T.palette.primary.main}}),f(we,{sx:{minWidth:0},children:Ze})]})}})),[Ge,Re,T.palette.primary.main]),Et=le=>{if(!_)return;le.preventDefault(),le.currentTarget.setPointerCapture(le.pointerId),L.current={startX:le.clientX,startWidth:z};let ge=Te=>{let Ie=L.current;Ie&&O(rt(Ie.startWidth+Te.clientX-Ie.startX));},J=()=>{L.current=null,window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",J),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ge),window.addEventListener("pointerup",J);},te=()=>{let le=D.current?.clientWidth??0,ge=le>0?Math.max(h,(le-Ps)/2):bg;G("split"),O(rt(ge));},ot=()=>a?typeof a=="function"?a(Ve):a:null,Fe=a?f(Hn,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(oi,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(ei,{fontSize:"small"})}],onValueChange:le=>{le==="split"?te():G(le);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(we,{ref:N,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${T.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(T.palette.common.black,b()==="dark"?.24:.08)}`,...A},children:[Fe,g(we,{ref:D,sx:{height:"100%",display:"grid",gridTemplateColumns:Ee,transition:`grid-template-columns ${Rn}`,minWidth:0},children:[g(we,{"aria-hidden":at?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:at?0:1,transform:at?"translateX(-12px)":"translateX(0)",pointerEvents:at?"none":"auto",transition:`opacity ${Rn}, transform ${Rn}`,willChange:"opacity, transform"},children:[g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[g(ae,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(Co,{sx:{color:"primary.main",fontSize:28}}),g(we,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),S!==void 0?S:f(ne,{tooltip:"Add node",color:"default",children:f(Fo,{fontSize:"small"})})]}),g(we,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(Qr,{appId:v,tableKey:y,title:g$1??(typeof t=="string"?t:"Tree"),columns:At,rows:xt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Ce?[Ce]:[],onSelectionChange:le=>{let ge=le[le.length-1],J=ze.find(Te=>Te.id===ge);J&&ht(J);},page:me,rowsPerPage:se,rowsPerPageOptions:w,count:xt.length,onPageChange:ie,onRowsPerPageChange:le=>{ie(0),fe(le);},filterConfig:x,serviceUrl:k,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),xt.length===0&&f(we,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(we,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:_?Et:void 0,sx:{width:"100%",cursor:_?"col-resize":"default",backgroundColor:_?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:_?1:0,pointerEvents:_?"auto":"none",position:"relative",transition:`opacity ${Rn}, background-color 120ms ease`,"&:hover":{backgroundColor:_?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(we,{"aria-hidden":Ye?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Ye?0:1,transform:Ye?"translateX(12px)":"translateX(0)",pointerEvents:Ye?"none":"auto",transition:`opacity ${Rn}, transform ${Rn}`,willChange:"opacity, transform"},children:[f(we,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Nt,{sx:{width:"100%"}})}),f(we,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:ot()})]})]})]})};var Fx={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},y5=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=yo("(prefers-reduced-motion: reduce)"),[p,u]=useState("to"),f$1=!s&&!d&&o!=="none";useEffect(()=>{if(!f$1){u("to");return}u("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{u("to");});});return ()=>cancelAnimationFrame(v)},[r,f$1]);let h=Fx[o],m=useMemo(()=>f$1?p==="from"?h.from:h.to:{opacity:1,transform:"none"},[f$1,p,h.from,h.to]);return f(we,{sx:{willChange:f$1?"opacity, transform":"auto",transition:f$1?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...l},children:t})},C5={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{qH as AIBrowserGlow,pc as Activity,km as AgentPanel,ya as AlertCircle,uc as AlertTriangle,a0 as ArrowDown,i0 as ArrowRight,mc as ArrowUp,Ms as BarChart,s0 as Bot,Fs as Button,Jv as CAINavProvider,en as CAlert,kp as CAmapChart,Fi as CAppHeader,fl as CAppHeaderSearch,LA as CAppPageLayout,hz as CAuthPage,Jo as CAvatar,Oa as CBadge,Qn as CBarChart,ye as CButton,Vn as CCalendar,zp as CCardDetailPanel,Wp as CCardGrid,lb as CCardGridCard,dD as CCardPage,fi as CChartCard,Rt as CCheckbox,kt as CChip,yp as CComboChart,Tp as CCustomizeAgent,Tf as CDatePicker,AN as CDetailInfoPage,Yp as CDetailSearchAiBar,Ni as CDetailSectionCard,Ht as CDialog,Nt as CDivider,Mf as CFileUpload,KP as CFilterField,xp as CFishboneChart,wp as CGoogleMapChart,Pp as CGraphCharts,bp as CGraphKpiCards,yi as CGraphReport,Cp as CHeatmapChart,ne as CIconButton,iA as CKanbanBoard,eu as CKanbanBucket,cl as CKanbanCard,Op as CLayoutManagement,mn as CLayoutManager,vp as CLineChart,BP as CList,HP as CListItem,GP as CListItemAvatar,zP as CListItemButton,VP as CListItemIcon,WP as CListItemText,$P as CListSubheader,Yt as CMenu,Kn as CMessageBox,ls as CMetricChartCard,ii as CPageLayout,y5 as CPageTransition,Ae as CPaper,hi as CPieChart,SL as CPivotTable,hg as CPlanningGantt,o5 as CPlanningLayout,Es as CPopover,Bn as CProgress,Qg as CRadioGroup,Hn as CSegmentedControl,Vt as CSelect,nf as CSkeleton,zr as CSmartFilter,R1 as CSmartTable,Kr as CSpinner,ae as CStack,F1 as CStandardPage,LP as CStatusBadge,La as CSwitch,Qr as CTable,k1 as CTableBody,P1 as CTableCell,T1 as CTableContainer,I1 as CTableHead,M1 as CTableRow,Sf as CTabs,Fn as CTextArea,He as CTextField,st as CTooltip,g5 as CTreeComp,E as CTypography,lp as CValueHelp,wi as CVariantManagement,Dp as CVariantManager,Pl as CVoiceWaveOverlay,Sp as CWaterfallChart,Rs as Calendar,l0 as CalendarDays,c0 as Camera,d0 as ChartNoAxesCombined,Ur as Check,Ca as CheckCircle,Lr as ChevronDown,xa as ChevronLeft,Or as ChevronRight,p0 as ChevronUp,u0 as ChevronsDown,m0 as ChevronsUp,Sa as CircleAlert,An as CircleCheck,g0 as CircleCheckBig,gc as CircleStop,fc as Clipboard,f0 as ClipboardCheck,h0 as ClipboardList,hc as Clock,oa as CodeBlock,b0 as Columns3,_H as CopilotChat,ho as Copy,v0 as CopyPlus,y0 as Delete,C0 as Download,bc as Edit,vc as Expand,x0 as Eye,S0 as EyeOff,wa as File,yc as FileText,w0 as Filter,FH as FloatingAgentPanel,En as FolderTree,Cc as GitBranch,RP as GlobalMessage,Ln as Globe,xc as Grid,k0 as GripVertical,P0 as Hammer,Sc as Image,ka as Info,Ll as InputArea,T0 as Languages,I0 as Layers,M0 as LayoutDashboard,Pa as Lightbulb,wc as LineChart,kc as Loader2,Ta as Lock,R0 as LockKeyhole,Pc as LogOut,ss as METRIC_CHART_TYPES,Ds as Mail,Tc as MapPin,ia as MarkdownRenderer,na as MathBlock,D0 as Menu,tl as MermaidBlock,Lg as MessageCircle,Ic as MessageSquare,Ia as Mic,N0 as MicOff,Mc as Moon,A0 as MoreHorizontal,Xc as NavigationIsland,zs as NavigationIsland2,ex as OMPHApprovalCard,PH as OMPHPanel,$n as ORBCAFE_I18N_MESSAGES,wg as ORB_DARK,Hx as ORB_FONT_STACK,Sg as ORB_LIGHT,Vx as ORB_RADIUS,Ts as ORB_TOKENS,Wx as ORB_TRANSITION_FAST,Ha as OrbcafeI18nProvider,Nn as OrbisModeProvider,C5 as PAGE_TRANSITION_PRESETS,YO as PAppPageLayout,VL as PBarcodeScanner,Yu as PNavIsland,tO as PNumericKeypad,_u as PSmartFilter,_v as PTable,qL as PTouchCard,Uu as PWorkloadNav,E0 as PackageCheck,L0 as PackageSearch,Ma as PanelLeftOpen,Ra as PanelRight,O0 as PanelsTopLeft,Rc as PieChart,Qo as Pin,Ou as PivotChartPanel,F0 as Play,Da as Plus,B0 as QrCode,H0 as ReceiptText,Na as RefreshCw,z0 as Rocket,V0 as RotateCcw,Dc as RotateCw,W0 as Rows3,Mt as SapIcon,$0 as Save,G0 as ScanLine,Fr as Search,Og as Send,Nc as SendHorizontal,jo as Settings,_0 as ShieldCheck,U0 as Sigma,K0 as SortAsc,q0 as SquareSplitHorizontal,X0 as Star,Sm as StdChat,Ac as Sun,Y0 as Table2,ol as TableBlock,Z0 as TabletSmartphone,On as Terminal,Ri as ThinkBlock,Ec as ThumbsDown,Lc as ThumbsUp,Oc as Trash2,Gn as TreeMenu,Q0 as TreePine,Fc as TrendingDown,Aa as TriangleAlert,j0 as Truck,Bc as UploadCloud,Ns as User,iF as VoiceNavigatorProvider,eF as VoiceWaveOverlay,Hc as Volume2,J0 as Warehouse,eS as Workflow,Xt as X,Ea as XCircle,tu as addKanbanBucket,bi as buildAmapEmbedUrl,jn as buildGoogleMapEmbedUrl,CM as buildGoogleMapIframe,Ef as buttonVariants,ou as createKanbanBoardModel,oe as createSapIcon,Wr as findKanbanCard,xP as message,oo as messageManager,Li as moveKanbanCard,tt as orbAlpha,zx as orbChartSeries,Mi as parseMarkdownTable,Fl as parseOmphFileHref,ru as renameKanbanBucket,nN as renderMarkdown,Ti as resolveVariantFilters,Ii as resolveVariantLayout,ey as useAINav,kD as useAmapEmbedUrl,sz as useAuthPage,fD as useCardPage,Qp as useDetailInfo,wD as useGoogleMapEmbedUrl,vD as useGraphChartData,xi as useGraphInteraction,dn as useGraphReport,pA as useKanbanBoard,Mr as useMediaQuery,ed as useNavigationIsland,br as useOrbMode,Is as useOrbTokens,de as useOrbcafeI18n,NL as usePadLayout,LL as usePadRecordEditor,du as usePageLayout,IL as usePivotTable,dg as usePlanningGantt,kz as usePlanningLayout,$1 as useStandardReport,yn as useVoiceInput,sF as useVoiceNavigator};
|
|
52
|
+
`,nz=({active:t=false,colors:o=hx,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:bx}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var vz=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async p=>{l(true);try{await p?.();}finally{l(false);}},[]),u=useCallback(p=>d(()=>o?.(p)),[o,d]),m=useCallback(p=>d(()=>r?.(p)),[r,d]),f=useCallback(p=>d(()=>n?.(p)),[n,d]),h=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:m,onForgotPassword:f}),[f,u,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:h}};var Cx={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},Iz=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:u})=>{let m=t!==void 0,[f$1,h]=useState(o),p=t??f$1,v=useMemo(()=>({...Cx,...d}),[d]),[y,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,k]=useState({email:""}),[w,P]=useState(""),I=A=>{m||h(A),P(""),r?.(A);},S=async A=>{A.preventDefault(),await n?.(y),P("Demo login accepted. No real authentication request was sent.");},N=async A=>{A.preventDefault(),await a?.(x),P("Demo registration saved locally for this screen.");},R=async A=>{A.preventDefault(),await i?.(C),P("Demo reset link request created. No email was sent.");},T=p==="login"?v.loginTitle:p==="register"?v.registerTitle:v.forgotTitle,D=p==="login"?v.loginSubtitle:p==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:u,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:v.headline}),f("p",{children:v.subheadline})]}),f("div",{className:"orb-auth-meta",children:v.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:T}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:D}),w&&f(tn,{severity:"success",children:w}),p==="login"&&g("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(Ns,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(Ia,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:y.remember,onChange:A=>g$1(L=>({...L,remember:A.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(Se,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),p==="register"&&g("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:A=>b(L=>({...L,name:A.target.value})),startAdornment:f(Ns,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:A=>b(L=>({...L,email:A.target.value})),startAdornment:f(Ds,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:A=>b(L=>({...L,password:A.target.value})),startAdornment:f(Ia,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:A=>b(L=>({...L,confirmPassword:A.target.value}))}),f(Tt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:A=>b(L=>({...L,acceptedTerms:A.target.checked}))}),f(Se,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),p==="forgot"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:A=>k({email:A.target.value}),startAdornment:f(Ds,{size:15,strokeWidth:1.8})}),f(Se,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(Se,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var Sx={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},wx=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],mg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:u,variantService:m,layout:f,columns:h,page:p,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:C,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:P,onLayoutIdChange:I,onLayoutSave:S})=>{let N=o??l??"planning-gantt",R=r??d??"planning",[T,D]=useState(n),[A,L]=useState(a??t[0]?.id??""),[O,Y]=useState(""),[H,q]=useState(null),[V,Z]=useState({...Sx,...i}),z=useMemo(()=>{let pe=String(V.keyword?.value??"").trim().toLowerCase(),xe=String(V.status?.value??"").trim(),We=String(V.owner?.value??"").trim().toLowerCase(),we=String(V.workCenter?.value??"").trim().toLowerCase(),se=V.dateRange?.value,Ae=se?.[0]?tr(se[0]):null,Ie=se?.[1]?tr(se[1]):null;return t.filter(ke=>{if(pe&&![ke.id,ke.code,ke.title,ke.project,ke.workCenter,ke.owner?.name].join(" ").toLowerCase().includes(pe)||xe&&ke.status!==xe||We&&!String(ke.owner?.name??"").toLowerCase().includes(We)||we&&!String(ke.workCenter??"").toLowerCase().includes(we))return false;if(Ae||Ie){let ze=tr(ke.startDate),et=tr(ke.endDate),rt=Ae?et.isAfter(Ae)||et.isSame(Ae,"day"):true,at=Ie?ze.isBefore(Ie)||ze.isSame(Ie,"day"):true;if(!rt||!at)return false}return true})},[V,t]);useEffect(()=>{z.length!==0&&(z.some(pe=>pe.id===A)||L(z[0].id));},[z,A]);let B=useCallback(pe=>{L(pe.id);},[]),G=useCallback(pe=>{Y(pe),I?.(pe);},[I]),U=useCallback(pe=>{q(xe=>({key:(xe?.key??0)+1,variant:pe})),k?.(pe);},[k]),ge=useMemo(()=>({appId:N,tableKey:R,fields:s??wx,filters:V,onFilterChange:Z,onVariantLoad:U,onSearch:C??(()=>{}),currentLayoutId:O,layoutRefs:[{tableKey:R,layoutId:O||null}],variantService:m,serviceUrl:u}),[O,s,V,U,C,N,R,u,m]),ie=useMemo(()=>({appId:N,tableKey:R,serviceUrl:u,tasks:z,columns:h,scale:T,onScaleChange:D,page:p,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:A,onTaskSelect:B,enableRowReorder:w,onTaskReorder:P,layout:f,layoutVariant:H?.variant,layoutVariantLoadKey:H?.key,onLayoutIdChange:G,onLayoutSave:S}),[h,g,w,z,G,f,H?.key,H?.variant,x,b,S,P,B,p,N,R,v,y,T,u,A]);return {scale:T,setScale:D,selectedTaskId:A,setSelectedTaskId:L,filters:V,setFilters:Z,filteredTasks:z,smartFilterProps:ge,planningGanttProps:ie}};var Oz=t=>{let o=mg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};tr.extend(Px);var jl=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Jl=36,ec=58,ya=8,tc=260,Ax=320,_r="220ms cubic-bezier(0.2, 0, 0, 1)",gg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},Ex=t=>t?gg[t]?.label??t:"Planned",Lx=t=>t?gg[t]?.color??"default":"info",fg=t=>Math.min(100,Math.max(0,t??0)),hg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...hg(r.children??[],o+1)]),Ox=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:Ex(t.status),statusTone:t.status??"planned",progress:fg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),bg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),vg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),Fx=(t,o,r)=>{let n=[],a=bg(t,r),i=vg(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},oc=(t,o,r)=>{let n=0;for(let a of o){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*r}n+=r;}return n},yg=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:u,page:m,rowsPerPage:f$1=20,rowsPerPageOptions:h=[20,50,100,-1],count:p,onPageChange:v,onRowsPerPageChange:y,timelineStart:g$1,timelineEnd:x,selectedTaskId:b$1,onTaskSelect:C,enableRowReorder:k=true,onTaskReorder:w,layout:P,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:N,onLayoutSave:R,emptyLabel:T="No planning tasks available.",sx:D})=>{let A=ao(),{t:L}=de(),O=useRef(null),Y=useRef(null),H=useRef(null),q=useRef(false),[V,Z]=useState(null),[z,B]=useState("content"),[G,U]=useState(null),[ge,ie]=useState(0),[pe,xe]=useState({}),[We,we]=useState(Jl),[se,Ae]=useState([]),Ie=useRef(void 0),[ke,ze]=useState({activeId:null,overId:null}),[et,rt]=useState(null),[at,K]=useState(false),Re=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ve=useRef(null),Fe=useMemo(()=>hg(s),[s]),nt=useMemo(()=>{if(se.length===0)return Fe;let F=new Map(Fe.map(Pe=>[Pe.id,Pe])),j=se.map(Pe=>F.get(Pe)).filter(Pe=>!!Pe),me=new Set(j.map(Pe=>Pe.id));return [...j,...Fe.filter(Pe=>!me.has(Pe.id))]},[Fe,se]),Ye=useMemo(()=>new Map(nt.map(F=>[F.id,F])),[nt]),xt=useMemo(()=>nt.map(F=>Ox(F)),[nt]),It=useMemo(()=>new Map(xt.map(F=>[F.id,F])),[xt]),Lt=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,j)=>g(ae,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:j.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:j.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,j)=>f(Ct,{label:j.status,color:Lx(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ae,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(Hn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Nt=useMemo(()=>{if(!l||l.length===0)return Lt;let F=new Map(Lt.map(j=>[j.id,j]));return l.map(j=>{let me=F.get(j.id),Pe=j.width??me?.minWidth??120,Je={id:j.id,label:j.label,minWidth:Pe};if(me?.numeric&&(Je.numeric=true),j.render){let qe=j.render;return Je.render=(wt,ft)=>{let mt=Ye.get(ft.id);return qe(mt||ft)},Je}return me?.render?(Je.render=me.render,Je):(Je.render=(qe,wt)=>{let ft=wt[j.id];if(ft!=null&&String(ft).length>0)return String(ft);let yt=Ye.get(wt.id)?.[j.id];return yt!=null&&String(yt).length>0?String(yt):"-"},Je)})},[l,Lt,Ye]),te=fn({appId:t,tableKey:o,title:n,columns:Nt,rows:xt,rowKey:"id",page:m,rowsPerPage:f$1,rowsPerPageOptions:h,count:p??xt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:P,onLayoutSave:R}),Ge=t?f(gn,{appId:t,tableKey:o,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:r}):null,Oe=te.visibleRows;useEffect(()=>{let F=Fe.map(j=>j.id);Ae(j=>{let me=new Set(F),Pe=j.filter(ft=>me.has(ft)),Je=new Set(Pe),qe=F.filter(ft=>!Je.has(ft)),wt=[...Pe,...qe];return wt.length===j.length&&wt.every((ft,mt)=>ft===j[mt])?j:wt});},[Fe]),useEffect(()=>{S===void 0||!I||Ie.current!==S&&(Ie.current=S,te.handleVariantLoad(I));},[te,I,S]),useEffect(()=>{N?.(te.currentLayoutId);},[te.currentLayoutId,N]);let le=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,be=useMemo(()=>{let F=xt.map(mt=>tr(mt.startDate)),j=xt.map(mt=>tr(mt.endDate)),me=g$1?tr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??tr()),Pe=x?tr(x):j.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,j[0]??tr().add(30,"day")),Je=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",wt=d==="hour"?12:1,ft=d==="hour"?12:1;return {start:bg(me.subtract(wt,Je),d),end:vg(Pe.add(ft,qe),d)}},[xt,d,x,g$1]),ee=jl.find(F=>F.value===d)??jl[1],he=Array.isArray(a)?a:a?[a]:[],De=useMemo(()=>Fx(be.start,be.end,d),[be.end,be.start,d]),je=De.length*ee.width,it=De.length>0?100/De.length:100,dt=De.length>0?`repeat(${De.length}, minmax(${ee.width}px, 1fr))`:"1fr",Ft=De.length>0?`calc(100% / ${De.length}) 100%`:"100% 100%",Kt=(te.columns||[]).filter(F=>te.visibleColumns.includes(F.id)).reduce((F,j)=>F+(te.columnWidths?.[j.id]||j.minWidth||100),0)+(te.grouping.length>0?72:0),zt=z==="manual"&&V!==null?V:Kt,St=G==="table",Vt=G==="timeline",ht=G==="timeline",Dt=G==="table",st=!ht&&!Dt,Ot=()=>{let F=ge||O.current?.clientWidth||0;return F>0?Math.max(tc,F-ya-Ax):Math.max(tc,Kt)},qt=F=>Math.min(Math.max(F,tc),Ot()),W=(()=>{if(ge<=0)return null;let F=st?ya:0;if(St)return {tableWidth:ge,splitterWidth:F,timelineWidth:0};if(Vt)return {tableWidth:0,splitterWidth:F,timelineWidth:ge};if(z==="even"){let me=Math.max(0,(ge-F)/2);return {tableWidth:me,splitterWidth:F,timelineWidth:Math.max(0,ge-F-me)}}let j=qt(zt);return {tableWidth:j,splitterWidth:F,timelineWidth:Math.max(0,ge-F-j)}})(),Q=W?`${W.tableWidth}px ${W.splitterWidth}px ${W.timelineWidth}px`:St?"minmax(0, 1fr) 0px 0px":Vt?"0px 0px minmax(0, 1fr)":z==="even"?`minmax(0, 1fr) ${ya}px minmax(0, 1fr)`:`${zt}px ${ya}px minmax(0, 1fr)`;useEffect(()=>{z==="manual"&&Z(F=>F===null?null:qt(F));},[z,Kt,ge]);let fe=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),U(null),B("manual"),ve.current={startX:F.clientX,startWidth:Y.current?.getBoundingClientRect().width??zt};let j=Pe=>{let Je=ve.current;if(!Je)return;let qe=qt(Je.startWidth+Pe.clientX-Je.startX);Z(qe);},me=()=>{ve.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",me),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",j),window.addEventListener("pointerup",me);},ye=()=>{U(null),B("even"),Z(null);},Ee=F=>!k||!F?false:It.get(F)?.reorderable!==false,$e=(F,j)=>{if(!F||!j||F===j||!Ee(F)||!Ee(j))return false;if(te.grouping.length===0)return true;let me=It.get(F),Pe=It.get(j);return !me||!Pe?false:te.grouping.every(Je=>me[Je]===Pe[Je])},Ke=(F,j)=>{if(!$e(F,j))return;let me=Oe.filter(At=>At.type!=="group").map(At=>String((At.data||At)?.id)),Pe=me.indexOf(F),Je=me.indexOf(j);if(Pe<0||Je<0)return;let qe=[...me];[qe[Pe],qe[Je]]=[qe[Je],qe[Pe]];let wt=new Set(me),ft=nt.map(At=>At.id),mt=[...qe,...ft.filter(At=>!wt.has(At))],yt=Ye.get(F),oo=Ye.get(j);if(te.setOrder("asc"),te.setOrderBy(""),Ae(mt),yt&&oo){let{level:At,...Xt}=yt,{level:Bt,...Gt}=oo,Wt=mt.reduce((eo,ro)=>{let go=Ye.get(ro);if(go){let{level:To,...Io}=go;eo.push(Io);}return eo},[]);w?.(Wt,{activeTask:Xt,targetTask:Gt});}},Ze=(F,j)=>{if(!Ee(j.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",j.id),ze({activeId:j.id,overId:null}),C?.(Ye.get(j.id)||j);},ut=(F,j)=>{if(!$e(ke.activeId,j)){ze(me=>me.overId===null?me:{...me,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",ze(me=>me.overId===j?me:{...me,overId:j});},gt=(F,j)=>{let me=ke.activeId||F.dataTransfer.getData("text/plain");if(!$e(me,j)){ze({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Ke(me,j),ze({activeId:null,overId:null});},Mt=()=>{ze({activeId:null,overId:null});},bt=F=>{if(q.current)return;let j=F==="table"?Y.current:H.current,me=F==="table"?H.current:Y.current;!j||!me||(q.current=true,me.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{q.current=false;}));};return useLayoutEffect(()=>{let F=O.current;if(!F){ie(0);return}let j=0,me=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let Je=F.clientWidth;ie(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(me(),typeof ResizeObserver>"u")return window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",me);};let Pe=new ResizeObserver(me);return Pe.observe(F),window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),Pe.disconnect(),window.removeEventListener("resize",me);}},[xt.length]),useLayoutEffect(()=>{if(!b$1||Dt)return;let F=H.current,j=Y.current;if(!F)return;let me=`row-${b$1}`,Pe=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(wt=>wt.dataset.planningTimelineRowKey===me),Je=It.get(b$1);if(!Pe||!Je)return;let qe=window.requestAnimationFrame(()=>{let wt=F.getBoundingClientRect(),ft=Pe.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-We),yt=F.scrollTop+ft.top-wt.top-We-(mt-ft.height)/2;q.current=true,F.scrollTop=Math.max(0,yt),j&&!ht&&(j.scrollTop=F.scrollTop);let oo=Math.max(1,F.scrollWidth),At=De.length>0?oo/De.length:ee.width,Xt=oc(tr(Je.startDate),De,At),Bt=Math.max(0,Xt-At);F.scrollLeft=Math.min(Bt,Math.max(0,oo-F.clientWidth)),window.requestAnimationFrame(()=>{q.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[ee.width,We,b$1,ht,It,Dt,Oe,De]),useLayoutEffect(()=>{let F=Y.current;if(!F)return;let j=0,me=0,Pe=false,Je=()=>{if(Pe)return;let Bt=F.querySelector("thead"),Gt=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Gt.length===0)return;let Wt=Bt?.getBoundingClientRect().height||Jl,eo={};Gt.forEach(ro=>{let go=ro.dataset.ctableRowKey;go&&(eo[go]=ro.getBoundingClientRect().height);}),we(ro=>Math.abs(ro-Wt)<.01?ro:Wt),xe(ro=>{let go=Object.keys(ro),To=Object.keys(eo);return go.length===To.length&&To.every(Io=>Math.abs((ro[Io]??0)-eo[Io])<.01)?ro:eo});},qe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(me),me=window.requestAnimationFrame(()=>{me=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Pe||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{Pe=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),window.removeEventListener("resize",qe);};let wt=new ResizeObserver(qe),ft=F.querySelector("table"),mt=F.querySelector("tbody"),yt=F.querySelector("thead");ft&&wt.observe(ft),yt&&wt.observe(yt);let oo=new WeakSet,At=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Bt=>{oo.has(Bt)||(wt.observe(Bt),oo.add(Bt));});};At();let Xt=null;return mt&&typeof MutationObserver<"u"&&(Xt=new MutationObserver(()=>{At(),qe();}),Xt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{Pe=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),wt.disconnect(),Xt?.disconnect(),window.removeEventListener("resize",qe);}},[Oe,te.visibleColumns,te.grouping,te.columnWidths]),g(Ne,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${A.palette.divider}`,...D},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(li,{value:te.filterText,onChange:F=>{te.setFilterText(F),te.setPage(0);}}),f(si,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:h,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),he.length>0&&f("div",{className:"orb-table-toolbar-custom",children:he.map((F,j)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${j}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ne,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>te.setAnchorEl(F.currentTarget),sx:co,children:f(an,{fontSize:"small"})}),f(ne,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>te.setGroupAnchorEl(F.currentTarget),sx:co,children:f(Cr,{fontSize:"small"})}),f(ne,{className:`orb-table-tool-button ${te.sortBy.length>0||te.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:te.sortBy.length>0||!!te.orderBy,onClick:()=>K(true),sx:co,children:f(jd,{fontSize:"small"})})]}),Ge&&f("div",{className:"orb-table-tool-group",children:Ge}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(zn,{"aria-label":"Planning pane layout",size:"small",value:G??(z==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(ei,{fontSize:"small"})}],onValueChange:F=>{F==="split"?ye():U(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(Ht,{label:"",value:d,options:jl.map(F=>({value:F.value,label:F.label})),onChange:F=>u?.(F.target.value)})})]})]})}),xt.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:T}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:O,sx:{height:"100%",display:"grid",gridTemplateColumns:Q,minWidth:0,transition:`grid-template-columns ${_r}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:Y,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ht?0:1,transform:ht?"translateX(-10px)":"translateX(0)",pointerEvents:ht?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f(DndContext,{sensors:Re,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let j=F?.active?.id,me=F?.over?.id;typeof j=="string"&&typeof me=="string"&&te.handleColumnReorder(j,me);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Kt,"& thead th":{height:Jl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(pi,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(F,j)=>{F.preventDefault(),F.stopPropagation(),rt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:j});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),f(ui,{visibleRows:Oe,columns:te.columns,visibleColumns:te.visibleColumns,selected:b$1?[b$1]:[],expandedGroups:te.expandedGroups,toggleGroupExpand:te.toggleGroupExpand,handleExpandGroupRecursively:te.handleExpandGroupRecursively,handleCollapseGroupRecursively:te.handleCollapseGroupRecursively,isGroupFullyExpanded:te.isGroupFullyExpanded,grouping:te.grouping,rowKeyProp:"id",page:te.page,rowsPerPage:te.rowsPerPage,emptyLabel:T,handleClick:(F,j)=>{C?.(Ye.get(j.id)||j);},getRowDataKey:({entry:F})=>le(F),getGroupRowProps:()=>({style:{height:ec}}),getRowProps:({data:F})=>{let j=F,me=Ee(j.id),Pe=ke.activeId===j.id,Je=ke.overId===j.id&&$e(ke.activeId,j.id);return {draggable:me,className:Je?"orb-is-drop-target":void 0,style:{cursor:Pe?"grabbing":me?"grab":C?"pointer":"default",height:ec,opacity:Pe?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ze(qe,j),onDragOver:qe=>ut(qe,j.id),onDragEnter:qe=>ut(qe,j.id),onDrop:qe=>gt(qe,j.id),onDragEnd:Mt}}})]})})}),f("div",{onPointerDown:st?fe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:st?ya:0,cursor:st?"col-resize":"default",opacity:st?1:0,pointerEvents:st?"auto":"none",borderLeft:st?`1px solid ${A.palette.divider}`:"0 solid transparent",borderRight:st?`1px solid ${A.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${_r}, opacity ${_r}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:A.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:st?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Dt?0:1,transform:Dt?"translateX(10px)":"translateX(0)",pointerEvents:Dt?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:H,onScroll:()=>bt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:je||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:dt,height:We,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:De.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${A.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(ae,{sx:{position:"relative"},children:Oe.map(F=>{let j=le(F),me=pe[j]??ec;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":j,sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},F.id);let Pe=F.data||F,Je=tr(Pe.startDate),qe=tr(Pe.endDate),wt=oc(Je,De,it),ft=oc(qe,De,it),mt=Math.max(0,ft-wt),yt=fg(Pe.progress),oo=Pe.id===b$1,At=Ee(Pe.id),Xt=ke.activeId===Pe.id,Bt=ke.overId===Pe.id&&$e(ke.activeId,Pe.id),Gt=Pe.color??(Pe.statusTone==="blocked"?A.palette.error.main:A.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${oo?"orb-is-selected":""}`,"data-planning-timeline-row-key":j,draggable:At,onDragStart:Wt=>Ze(Wt,Pe),onDragOver:Wt=>ut(Wt,Pe.id),onDragEnter:Wt=>ut(Wt,Pe.id),onDrop:Wt=>gt(Wt,Pe.id),onDragEnd:Mt,onClick:()=>C?.(Ye.get(Pe.id)||Pe),sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Xt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:A.palette.primary.main,opacity:Bt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Ft,cursor:Xt?"grabbing":At?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:f(lt,{title:`${Pe.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${wt}%`,top:Math.max(8,(me-24)/2),width:`max(18px, ${mt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:oo?`2px solid ${A.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${yt}%`,backgroundColor:Gt}}),f(E,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Pe.code})]})})},Pe.id)})})]})})})]})}),f(cn,{groupAnchorEl:te.groupAnchorEl,setGroupAnchorEl:te.setGroupAnchorEl,grouping:te.grouping,setGrouping:te.setGrouping,columns:te.columns}),f(dn,{anchorEl:te.anchorEl,setAnchorEl:te.setAnchorEl,columns:te.columns,visibleColumns:te.visibleColumns,toggleColumnVisibility:te.toggleColumnVisibility}),f(hp,{contextMenu:et,handleClose:()=>rt(null),columns:te.columns,visibleColumns:te.visibleColumns,grouping:te.grouping,summaryColumns:te.summaryColumns,showSummary:te.showSummary,sortBy:te.sortBy,orderBy:te.orderBy,order:te.order,onSortAsc:F=>{te.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{te.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let j=te.sortBy.filter(me=>me.field!==F);j.length>0?te.applyMultiSort(j):(te.clearMultiSort(),te.orderBy===F&&te.setOrderBy(""));},onHideColumn:F=>{te.visibleColumns.includes(F)&&te.toggleColumnVisibility(F);},onToggleGroup:F=>te.toggleGroupField(F),onToggleSummary:F=>te.toggleSummaryColumn(F),onOpenSortDialog:()=>K(true)}),f(bp,{open:at,onClose:()=>K(false),columns:te.columns,initialRules:te.sortBy.length>0?te.sortBy:te.orderBy?[{field:te.orderBy,direction:te.order}]:[],onApply:F=>te.applyMultiSort(F),onClear:()=>{te.clearMultiSort(),te.setOrderBy("");}})]})};var g5=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(ae,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(Vo,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(yg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Cg=640,Bx=360,Hx=360,Ps=8,Dn="220ms cubic-bezier(0.2, 0, 0, 1)",ac=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...ac(i,o,r+1,[...n,a.id])]:s}),Sg=t=>t.flatMap(o=>[o,...Sg(o.children??[])]),wg=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...wg(a,o+1,[...r,n.id])]}),kg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...kg(r)]}),xg=t=>Object.entries(t).filter(([o])=>o!=="children").map(([,o])=>o==null?"":typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):"").join(" ").toLowerCase(),P5=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:m,defaultPaneMode:f$1="split",minTreePaneWidth:h=Bx,minDetailPaneWidth:p=Hx,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g$1,filterConfig:x,searchQuery:b$1,searchToken:C,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:P,emptyLabel:I="No tree items available.",headerAction:S,sx:N,className:R})=>{let T=ao(),D=useRef(null),A=useRef(null),L=useRef(null),[O,Y]=useState(s??r[0]?.id??null),[H,q]=useState(u??kg(r).slice(0,3)),[V,Z]=useState(f$1),[z,B]=useState(Cg),[G,U]=useState(0),[ge,ie]=useState(0),[pe,xe]=useState(k),We=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:le=>g(ae,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:le.label}),le.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:le.subtitle})]})}],[n]),we=useMemo(()=>new Set(d??H),[d,H]),se=useMemo(()=>ac(r,we),[r,we]),Ae=useMemo(()=>Sg(r),[r]),Ie=useMemo(()=>wg(r),[r]),ke=i===void 0?O:i,ze=useMemo(()=>Ae.find(le=>le.id===ke)??null,[ke,Ae]),et=le=>{let be=A.current?.clientWidth??0,ee=be>0?Math.max(h,be-Ps-p):Math.max(h,le);return Math.min(Math.max(le,h),ee)},rt=V==="detail",at=V==="tree"||!a,K=V==="split"&&!!a,ve=(()=>{if(G<=0)return null;if(V==="tree"||!a)return {treeWidth:G,splitterWidth:0,detailWidth:0};if(V==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:G};let le=K?Ps:0,be=et(z);return {treeWidth:be,splitterWidth:le,detailWidth:Math.max(0,G-le-be)}})(),Fe=ve?`${ve.treeWidth}px ${ve.splitterWidth}px ${ve.detailWidth}px`:V==="tree"||!a?"minmax(0, 1fr) 0px 0px":V==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${z}px) ${Ps}px minmax(${p}px, 1fr)`;useEffect(()=>{let le=A.current;if(!le){U(0);return}let be=0,ee=()=>{window.cancelAnimationFrame(be),be=window.requestAnimationFrame(()=>{let De=le.clientWidth;U(je=>Math.abs(je-De)<.5?je:De);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(be),window.removeEventListener("resize",ee);};let he=new ResizeObserver(ee);return he.observe(le),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(be),he.disconnect(),window.removeEventListener("resize",ee);}},[]);let nt=le=>{d===void 0&&q(le),m?.(le);},Ye=le=>{let be=new Set(we);be.has(le)?be.delete(le):be.add(le),nt(Array.from(be));},xt=le=>{i===void 0&&Y(le.id),l?.(le);};useEffect(()=>{ie(0);},[r]),useEffect(()=>{let le=b$1?.trim().toLowerCase();if(!le)return;let be=Ie.find(({node:dt})=>xg(dt).includes(le));if(!be)return;let ee=new Set(we);be.parentIds.forEach(dt=>ee.add(dt)),nt(Array.from(ee)),xt(be.node);let De=ac(r,ee).findIndex(({node:dt})=>dt.id===be.node.id);De>=0&&pe>0&&ie(Math.floor(De/pe));let je=0,it=0;return je=window.requestAnimationFrame(()=>{it=window.requestAnimationFrame(()=>{let dt=D.current?.querySelector("tr.orb-selected"),Ft=dt?.closest(".orb-table-container");if(dt&&Ft){let Kt=Ft.getBoundingClientRect(),zt=dt.getBoundingClientRect(),St=zt.top-Kt.top+Ft.scrollTop;Ft.scrollTo({top:St-Ft.clientHeight/2+zt.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(it);}},[b$1,C,Ie,r,pe]);let It=useMemo(()=>se.map(({node:le,level:be,hasChildren:ee})=>({...le,id:le.id,__node:le,__level:be,__hasChildren:ee,__expanded:we.has(le.id),__searchText:xg(le)})),[we,se]),Lt=useMemo(()=>We.map((le,be)=>({id:le.id,label:le.label,minWidth:typeof le.width=="number"?le.width:le.minWidth??(be===0?320:120),numeric:le.numeric??le.align==="right",render:(ee,he)=>{let De=he.__node,je=le.render?le.render(De):De[le.id];if(be!==0)return f(Te,{sx:{minWidth:0,color:le.align==="right"?"text.primary":"text.secondary",fontWeight:le.align==="right"?750:500,textAlign:le.align??"left"},children:je});let it=Number(he.__level??0),dt=!!he.__hasChildren,Ft=!!he.__expanded;return g(ae,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${it*24}px`},children:[f(ne,{tooltip:dt?Ft?"Collapse":"Expand":"",onClick:Kt=>{Kt.stopPropagation(),dt&&Ye(De.id);},disabled:!dt,sx:{width:24,height:24,visibility:dt?"visible":"hidden",transform:Ft?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(zo,{sx:{fontSize:20}})}),f(Te,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:De.markerColor??T.palette.primary.main}}),f(Te,{sx:{minWidth:0},children:je})]})}})),[We,we,T.palette.primary.main]),Nt=le=>{if(!K)return;le.preventDefault(),le.currentTarget.setPointerCapture(le.pointerId),L.current={startX:le.clientX,startWidth:z};let be=he=>{let De=L.current;De&&B(et(De.startWidth+he.clientX-De.startX));},ee=()=>{L.current=null,window.removeEventListener("pointermove",be),window.removeEventListener("pointerup",ee),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",be),window.addEventListener("pointerup",ee);},te=()=>{let le=A.current?.clientWidth??0,be=le>0?Math.max(h,(le-Ps)/2):Cg;Z("split"),B(et(be));},Ge=()=>a?typeof a=="function"?a(ze):a:null,Oe=a?f(zn,{"aria-label":"Tree pane layout",value:V,options:[{value:"tree",label:"Expand tree",icon:f(ti,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(ei,{fontSize:"small"})}],onValueChange:le=>{le==="split"?te():Z(le);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Te,{ref:D,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${T.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(T.palette.common.black,b()==="dark"?.24:.08)}`,...N},children:[Oe,g(Te,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Fe,transition:`grid-template-columns ${Dn}`,minWidth:0},children:[g(Te,{"aria-hidden":rt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:rt?0:1,transform:rt?"translateX(-12px)":"translateX(0)",pointerEvents:rt?"none":"auto",transition:`opacity ${Dn}, transform ${Dn}`,willChange:"opacity, transform"},children:[g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[g(ae,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(Cr,{sx:{color:"primary.main",fontSize:28}}),g(Te,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),S!==void 0?S:f(ne,{tooltip:"Add node",color:"default",children:f(Fr,{fontSize:"small"})})]}),g(Te,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(jo,{appId:v,tableKey:y,title:g$1??(typeof t=="string"?t:"Tree"),columns:Lt,rows:It,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ke?[ke]:[],onSelectionChange:le=>{let be=le[le.length-1],ee=Ae.find(he=>he.id===be);ee&&xt(ee);},page:ge,rowsPerPage:pe,rowsPerPageOptions:w,count:It.length,onPageChange:ie,onRowsPerPageChange:le=>{ie(0),xe(le);},filterConfig:x,serviceUrl:P,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),It.length===0&&f(Te,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(Te,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?Nt:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${Dn}, background-color 120ms ease`,"&:hover":{backgroundColor:K?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Te,{"aria-hidden":at?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:at?0:1,transform:at?"translateX(12px)":"translateX(0)",pointerEvents:at?"none":"auto",transition:`opacity ${Dn}, transform ${Dn}`,willChange:"opacity, transform"},children:[f(Te,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Te,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ge()})]})]})]})};var $x={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},D5=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=yr("(prefers-reduced-motion: reduce)"),[u,m]=useState("to"),f$1=!s&&!d&&r!=="none";useEffect(()=>{if(!f$1){m("to");return}m("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(v)},[o,f$1]);let h=$x[r],p=useMemo(()=>f$1?u==="from"?h.from:h.to:{opacity:1,transform:"none"},[f$1,u,h.from,h.to]);return f(Te,{sx:{willChange:f$1?"opacity, transform":"auto",transition:f$1?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...l},children:t})},N5={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{nz as AIBrowserGlow,uc as Activity,Pm as AgentPanel,Ca as AlertCircle,mc as AlertTriangle,p0 as ArrowDown,u0 as ArrowRight,gc as ArrowUp,Ms as BarChart,m0 as Bot,Fs as Button,oy as CAINavProvider,tn as CAlert,Pp as CAmapChart,Fi as CAppHeader,fl as CAppHeaderSearch,VA as CAppPageLayout,Iz as CAuthPage,en as CAvatar,Oa as CBadge,jn as CBarChart,Se as CButton,Wn as CCalendar,Vp as CCardDetailPanel,$p as CCardGrid,pb as CCardGridCard,hD as CCardPage,fi as CChartCard,Tt as CCheckbox,Ct as CChip,Cp as CComboChart,Ip as CCustomizeAgent,Rf as CDatePicker,HN as CDetailInfoPage,Zp as CDetailSearchAiBar,Ni as CDetailSectionCard,Et as CDialog,Rt as CDivider,Nf as CFileUpload,QP as CFilterField,Sp as CFishboneChart,kp as CGoogleMapChart,Tp as CGraphCharts,vp as CGraphKpiCards,yi as CGraphReport,xp as CHeatmapChart,ne as CIconButton,uA as CKanbanBoard,tu as CKanbanBucket,cl as CKanbanCard,Fp as CLayoutManagement,gn as CLayoutManager,yp as CLineChart,$P as CList,_P as CListItem,XP as CListItemAvatar,GP as CListItemButton,UP as CListItemIcon,KP as CListItemText,qP as CListSubheader,Zt as CMenu,qn as CMessageBox,ls as CMetricChartCard,ii as CPageLayout,D5 as CPageTransition,Ne as CPaper,hi as CPieChart,ML as CPivotTable,yg as CPlanningGantt,g5 as CPlanningLayout,Es as CPopover,Hn as CProgress,ef as CRadioGroup,zn as CSegmentedControl,Ht as CSelect,lf as CSkeleton,Vo as CSmartFilter,O1 as CSmartTable,qo as CSpinner,ae as CStack,$1 as CStandardPage,zP as CStatusBadge,La as CSwitch,jo as CTable,D1 as CTableBody,N1 as CTableCell,A1 as CTableContainer,E1 as CTableHead,L1 as CTableRow,Pf as CTabs,Bn as CTextArea,He as CTextField,lt as CTooltip,P5 as CTreeComp,E as CTypography,cp as CValueHelp,wi as CVariantManagement,Np as CVariantManager,Pl as CVoiceWaveOverlay,wp as CWaterfallChart,Rs as Calendar,g0 as CalendarDays,f0 as Camera,h0 as ChartNoAxesCombined,Ko as Check,xa as CheckCircle,Oo as ChevronDown,Sa as ChevronLeft,Fo as ChevronRight,b0 as ChevronUp,v0 as ChevronsDown,y0 as ChevronsUp,wa as CircleAlert,En as CircleCheck,C0 as CircleCheckBig,fc as CircleStop,hc as Clipboard,x0 as ClipboardCheck,S0 as ClipboardList,bc as Clock,na as CodeBlock,w0 as Columns3,tz as CopilotChat,hr as Copy,k0 as CopyPlus,P0 as Delete,T0 as Download,vc as Edit,yc as Expand,I0 as Eye,M0 as EyeOff,ka as File,Cc as FileText,R0 as Filter,qH as FloatingAgentPanel,Ln as FolderTree,xc as GitBranch,LP as GlobalMessage,On as Globe,Sc as Grid,D0 as GripVertical,N0 as Hammer,wc as Image,Pa as Info,Ll as InputArea,A0 as Languages,E0 as Layers,L0 as LayoutDashboard,Ta as Lightbulb,kc as LineChart,Pc as Loader2,Ia as Lock,O0 as LockKeyhole,Tc as LogOut,ss as METRIC_CHART_TYPES,Ds as Mail,Ic as MapPin,sa as MarkdownRenderer,aa as MathBlock,Mc as Menu,tl as MermaidBlock,Bg as MessageCircle,Rc as MessageSquare,Ma as Mic,F0 as MicOff,Dc as Moon,B0 as MoreHorizontal,Zc as NavigationIsland,zs as NavigationIsland2,ix as OMPHApprovalCard,FH as OMPHPanel,_n as ORBCAFE_I18N_MESSAGES,Tg as ORB_DARK,Gx as ORB_FONT_STACK,Pg as ORB_LIGHT,Kx as ORB_RADIUS,Ts as ORB_TOKENS,qx as ORB_TRANSITION_FAST,Ha as OrbcafeI18nProvider,An as OrbisModeProvider,N5 as PAGE_TRANSITION_PRESETS,tF as PAppPageLayout,KL as PBarcodeScanner,Zu as PNavIsland,sO as PNumericKeypad,Uu as PSmartFilter,qv as PTable,JL as PTouchCard,Ku as PWorkloadNav,H0 as PackageCheck,z0 as PackageSearch,Ra as PanelLeftOpen,Da as PanelRight,V0 as PanelsTopLeft,Nc as PieChart,Qr as Pin,Fu as PivotChartPanel,W0 as Play,jr as Plus,$0 as QrCode,_0 as ReceiptText,Na as RefreshCw,G0 as Rocket,U0 as RotateCcw,Ac as RotateCw,K0 as Rows3,Pt as SapIcon,q0 as Save,X0 as ScanLine,Bo as Search,Hg as Send,Ec as SendHorizontal,Jr as Settings,Y0 as ShieldCheck,Z0 as Sigma,Q0 as SortAsc,j0 as SquareSplitHorizontal,J0 as Star,wm as StdChat,Lc as Sun,eS as Table2,rl as TableBlock,tS as TabletSmartphone,Fn as Terminal,Ri as ThinkBlock,Oc as ThumbsDown,Fc as ThumbsUp,Bc as Trash2,Gn as TreeMenu,oS as TreePine,Hc as TrendingDown,Aa as TriangleAlert,rS as Truck,zc as UploadCloud,Ns as User,uF as VoiceNavigatorProvider,iF as VoiceWaveOverlay,Vc as Volume2,nS as Warehouse,aS as Workflow,Yt as X,Ea as XCircle,ou as addKanbanBucket,bi as buildAmapEmbedUrl,Jn as buildGoogleMapEmbedUrl,TM as buildGoogleMapIframe,Ff as buttonVariants,nu as createKanbanBoardModel,re as createSapIcon,$o as findKanbanCard,TP as message,nr as messageManager,Li as moveKanbanCard,tt as orbAlpha,Ux as orbChartSeries,Mi as parseMarkdownTable,Bl as parseOmphFileHref,ru as renameKanbanBucket,dN as renderMarkdown,Ti as resolveVariantFilters,Ii as resolveVariantLayout,ry as useAINav,DD as useAmapEmbedUrl,vz as useAuthPage,xD as useCardPage,jp as useDetailInfo,RD as useGoogleMapEmbedUrl,kD as useGraphChartData,xi as useGraphInteraction,pn as useGraphReport,bA as useKanbanBoard,Ro as useMediaQuery,od as useNavigationIsland,yo as useOrbMode,Is as useOrbTokens,de as useOrbcafeI18n,BL as usePadLayout,VL as usePadRecordEditor,pu as usePageLayout,EL as usePivotTable,mg as usePlanningGantt,Oz as usePlanningLayout,X1 as useStandardReport,Cn as useVoiceInput,mF as useVoiceNavigator};
|